Support for multiple lights
Jesse-V opened this issue · 3 comments
Jesse-V commented
A Scene should support multiple lights, which can each be controlled independently.
Jesse-V commented
A Scene should also be able to not have any lights.
Jesse-V commented
A number of things are required here, all of which I need to puzzle out how to solve in an organized fashion.
- Tell each light how many lights there are, and what it's light identification is so that it knows what to sync with in the GLSL array of Light structs.
- Generate GLSL code that does the necessary projection calculations for each light's position.
- When assembling the shader, avoid declaring the lighting methods multiple times.
- Blend all the lights into a final color.
- Figure out the specular or diffuse lighting not in the Light class, but based on the reflective properties of the RenderableObject.
- Should the spread of a light be restricted such that it cuts off at a certain distance? If that is the case, maybe RenderableObjects outside this radius shouldn't know about this light. This should be done GPU-side, between the vertex and fragment shader.