Csm optimization

Is it possible to optimize the rendering of csm?The same object, at the same time, is only rendered once when rendering shadows.

Could you please be more specific? “The same object”? Or the “Same object’s shadow”? Or what’s the point? Thanks

look at this https://playground.babylonjs.com/#IIZ9UU#36,when i add one torus to shadow list,
shadowGenerator.getShadowMap().renderList.push(torus); draw call will increase four

Because CSM does 4 passes by default to render the shadow.

We don’t do culling per cascade, but you can implement your own culling strategy, see:

https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows_csm#culling

@Evgeni_Popov please let me know it it’s not the case. I’d like to be sure that I’ll not fool anyone in the future. :wink:

We make as many draw calls as the number of cascades, indeed, and you can reduce the number of draw calls by implementing culling per cascade. It’s not always advantageous to implement culling (it’s an additional Javascript process that takes time), it will depend on the scene and the number of objects that can be culled on average.

1 Like