Strange behaviour of PSSM shadows drawcalls & polycount
by Oscar Velzi · in Torque 3D Professional · 06/01/2010 (1:01 pm) · 1 replies
I'm having some trouble in discerning the logic behind the rendering of the PSSM shadows. I'm working on an isometric game, which means that the camera is not the player character. From almost all positions, the PSSM shadows drawcalls are a constant, as if the whole level shadows are rendered all the time, despite they are on screen or not. Let me show you some screenshots:
In the first screen the whole level is rendered, and the shadow count of drawcalls is 304.

Now we have a shot completely zoomed in, where not many shadows are rendered, and the drawcalls are 316. This shot is taken near the left side of the level.

And even with the shadows not being rendered (you can see that the rendering is cut from the middle part upward since I used a different shadow distance value), the drawcalls, polycount and performance stay the same.

BUT if we go to the upper right corner of the level, closer to position of the sun, the drawcalls are 23.

Can someone knowledgeable explain to me why it works this way? I've come to accept the shadows drawcalls as a constant no matter what I'm looking in the level, but it would be nice if there's a way to make it relative to what is being rendered on the screen.
BTW, we've devised a way to have really high quality looking shadows with very little performance hit. Those shadows you see in the screenshots are using just 2 split passes. It only works with isometric games, though. If you want to know how we did it, I can post a thread about it.
In the first screen the whole level is rendered, and the shadow count of drawcalls is 304.

Now we have a shot completely zoomed in, where not many shadows are rendered, and the drawcalls are 316. This shot is taken near the left side of the level.

And even with the shadows not being rendered (you can see that the rendering is cut from the middle part upward since I used a different shadow distance value), the drawcalls, polycount and performance stay the same.

BUT if we go to the upper right corner of the level, closer to position of the sun, the drawcalls are 23.

Can someone knowledgeable explain to me why it works this way? I've come to accept the shadows drawcalls as a constant no matter what I'm looking in the level, but it would be nice if there's a way to make it relative to what is being rendered on the screen.
BTW, we've devised a way to have really high quality looking shadows with very little performance hit. Those shadows you see in the screenshots are using just 2 split passes. It only works with isometric games, though. If you want to know how we did it, I can post a thread about it.
About the author
Lead Artist of Iron Tower Studio
Associate Manoel Neto
Default Studio Name
Since your game uses a top-down camera, you can both boost your shadow quality *and* reduce the number of draw calls by reducing the shadow caster box in LightShadowMap::calcLightMatrices():
// Calculate the bonding box of the shadowed area // we're interested in... this is the shadow box // transformed by the frustum transform. Box3F viewBB( -p->shadowDistance, -p->shadowDistance, -p->shadowDistance, p->shadowDistance, p->shadowDistance, p->shadowDistance );Scale that box down by some constant and you're set. A very good optimization is to clamp the box height to the height of the highest building/mountain in your level (or the maximum height at which you have flying shadow casters).