Manny wrote:
Currently if you have more than one pass with lighting (i.e. DoForwardLightingLoop) the shadow map is rendered as many times as you have passes. This isn’t an issue in the samples as the transparent pass is unlit. I’m lighting my transparent objects, which means when I render the transparent pass all the geometry is rendered to the shadow map a second time. To combat this extra unnecessary cost I’ve pulled out the shadow map rendering to a separate pass where everything that casts shadows is rendered up front, and this shadow map is used for all subsequent passes
Yeah, several passes using the same shadow map are currently not supported efficiently. In your implementation, how do you handle the case of several light sources where you require several shadow maps?
Manny wrote:
In addition to this, updateQueues is called for every pass (for DrawGeometry and DrawLightGeometry etc). Again I may be misunderstanding this, but I think that this must be called at least once for generating the shadow map, and once for every camera you render to. But presumably it doesn’t need to be called for each pass to the same camera which it currently is.
You are right here, that is still quite inefficient. Sorry for that, but the optimization phase is just about to start.