I'm currently using Forward Lighting and trying to do my best to make sure that the FPS game will always render all the lights
1. In Pixel Shader 2.0, I have
DirectionalLight dirLights[maxLights]; PointLight pointLights[maxLights]; SpotLight spotLights[maxLights];
What is the appropriate number for the variable maxLights?
2. Since Forward Lighting is limited to a certain amount of lights, I have been thinking that I could:
- Detect collision between the light and the camera bounding frustum and only render the light if the camera can see it
- Arrange the lights from closest to farthest to the camera and remove any light if it's index is over 'maxLights' variable
What do you think about my idea? What is the most efficient way to work with forward lighting?
Edited by Medo3337, 13 June 2014 - 06:04 PM.