I am currently thinking about how to organize shadowing and lighting.
We use forward rendering and currently, our algorithm looks like this:
- collect all items that are visible in the view
- for each item, collect a list of lights where the item is in the attenuation radius (each item keeps a list of lights)
- determine the shadow light by the distance of the main character (only one light can currently cast shadow)
- render the scene by using a constant buffer of the currently processed item to shade it (each item is rendered with a constant buffer which contains light properties. the number of lights per item is predefined so we have a
numLightsin the constant buffer)
How would I do multiple shadow-casting lights in an organisatory way?
We do not want to go the deferred way, since we dont want to limit us to GBuffers.