-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically generate GBuffer.glsllib #6
Comments
Any ideas you'd like to share? About it's structure and assembly. Also would it be possible to make an array of objects assigned to a struct(i mean extending that type)? Like PointLight extends Light and that instance of point light to be added to an array and then iterated in the main? |
hmm well apparently this works: struct TestStruct { struct TestStruct2 { Main()
Was thinking if teststruct can be used as Light and teststruct2 could be the type extending it.. but it looks inappropriate and cant really see it implemented somehow.. only if there was some way to bind the lights to the shader code... like the uniforms are.. |
hm, check this. http://pyopengl.sourceforge.net/context/tutorials/shader_7.xhtml After going through it.. aparently we cna set a uniform with an array of structs:
struct TestStruct {
float val;
};
So i got this idea where we can set that uniform with our lights array. |
This issue is about packing/unpacking the GBuffer, I think you are talking about lighting now? But I imagine the same approach can be taken for the lights.
This way we breaks the dependency between how we pass the light data and how we use it.
I think something similar would work =) |
Well thats what im talking about.. im talking about a light glsllib. Looks badass |
Submit a new issue on the light glsl-lib also. Implement this in a separate branch from my master so I can pull only those changes in =) |
i kinda need more info on this, before submitting an issue. So let me get this straight, that layout u gave there for the point light, want me to do it in a LightPass.lib(gimmi a name to use), and it will be like struct DM_PointLight, struct DM_SpotLight, struct DM_DirectionalLight, and i'll do smth like fill_struct(vars) and it will fill that type(and which type it is will be a define), then when perform_lighting() is called it has everything it needs? |
Or.. you would like me to make a template glsllib and for the specific light a shader will be dynamically created for that light material from the glsllib. |
To be honest I have not thought about all of this. Maybe do a quick spike (small test) on one light type and we will se if it will be a viable solution =) |
Cool, tho im heading for work XD |
No description provided.
The text was updated successfully, but these errors were encountered: