Better distant shadow handling
Rendering shadow maps for things a long way away takes a lot of time because distant shadow maps cover a lot of area, and so have a lot of things in them.
One or more of the following may help:
- A heuristic in QuadTreeWorld based on maximum steepness in a cell and the angle of the sun in the sky which affects the
ComputeLightSpaceBoundsvisitor. This would stop terrain which isn't slopey enough to cast a shadow from expanding the shadow map.
- A maximum shadow map distance setting.
- This could potentially even be tied to the current framerate for more consistent performance like this Fallout 4 mod
A naive implementation (i.e. just setting the existing OSG setting) looks really bad with the current shadow cascade selection mechanism, so more work than just that would be needed.We've got a slightly-better-than-naive implementation that works fine.
- Rejecting terrain drawables over a certain distance from the view point. This would stop distant mountains casting shadows, but would still allow terrain shadows for short distances.