Hi All, today i'll show you a recent improvement in high performance realtime shadows in our BTR game.
Release date is approaching ( official announcement in the beginning of next week! Stay tuned! ) so we are working very hard, fixing bugs, tweaking gameplay and polishing everything.
One of the things we implemented soon but never tuned properly was dynamic shadow maps and Parallel Split Shadow Mapping.
Shadow mapping is an efficient algorithm for real-time shadow rendering, which is extensively adopted in real-time applications by its generality and efficiency. However, shadow mapping usually suffers from the inherent aliasing errors due to the image-based nature.
The Parallel-Split Shadow Maps (PSSMs) split the view frustum into different parts by using the planes parallel to the view plane and then generate multiple smaller shadow maps for the split parts.
PSSM uses multiple shadow maps generated from partitioning the scene into multiple volumes and rendering depth information using a light perspective transformation into a shadow map per volume. We use an atlas to hold the maps of the slices in a single surface. Objects in a given volume are then lit using depth information from the shadow map associated with the volume.
Here is our Janiculum scene ( one of the most shadow intensive ones ) rendered without PSSM enabled.
Here is the same scene again, but now rendered with PSSM enabled.
Looks far more better, huh?
In both cases we also use smoothed PCF (percentage closer filtering) shadows. When used on SM 3.0 and above graphics cards we use 4x4 PCF, instead we use bilinear 2x2 PCF on SM 2.0 graphics cards.
PSSM enhancement let also use to limit to 2048 the shadow map size, with a lot of benefits on performances.
This let our game run to 60 fps even on low end cards with shadows at maximum detail.
So stay tuned! And you'll try it on your hardware soon!