This can be a really dumb question but I can't find the correct way to do it.
I have deferred rendering working but with a single light of each(directional, point, spot). Which is a waste because deferred rendering is at its finest when used with many sources of light at the same time.
But when I try to implement it I don't know how to pass the light information of the scene to the shader that processes all the lights, since HLSL doesn't have dynamic arrays.
I read somewhere that setting a Max. number of lights for the array in HLSL would do it. But then, how to avoid looping through the rest of the light array that is not needed.
For example, let's set the max num of lights to 500. This scene in particular uses only 10 point lights. Should I be sending 500 point light data to the shader but with a boolean that confirms if the point light is active or not? Meaning that only 10 would have active = true.
That's how I think it can be done, but I'm not exactly sure if that's a right way to do it.
Isn't it costly to pass 490 useless data to the shader?
And one question regarding rendering pipeline. What part of the hardware would "bottleneck" when passing a large amount of data to the shader? I know processing through the data in the shader would be GPU's work, but what about just passing the information?
Thank you very much.