CSM Continued

OK! The cascaded shadow maps implementation is starting to show its first usable applications.

Given it still has some things that need to get adjusted to really make it complete, things like the calculations and how it’s integrated with the rest of the engine.

I have some quickly-thrown-together screenshots to share:
(I’m reworking the renderer so I’m without post processing. So no HDR bloom or AA.)

Here’s the result. It casts some nice shadows for the entire scene. As it should.

But. As you can see there are problems to this, such as this. As with the many posts I made a while back about rendering shadows outline, this is a common problem. Lack of hardware filtering ends in a brute-force approach which makes pretty jagged and noisy shadows at low resolution. It’s also possible in this screenshot to see the three cascades used for the shadows (Where the shadow suddenly drops in quality).

Here’s another problem I’m facing. Zooming out reveals the final cascade which is very low resolution compared to the two other cascades which show up close to the camera.
The Percentage Closer Filtering(PCF) doesn’t help a lot as you can see.

And this is a “for good measure” screenshot which shows the different cascades color-coded.

So even though the basics are already in and working there is a lot of work to be done. Part of this is to, again, explore different ways of filtering shadow maps to get softer visuals. I’m half leaning towards putting VSM in, but am tentative because of the light-bleeding artifacts. There’s also the possibility of LVSM which is similar to VSM but aims to reduce the mentioned artifacts.
*shrug* I don’t know yet.

Another part of what I need to improve is the actual calculation for the orthographic projection for the frustum slices. It’s right now at a “fudge” value, which isn’t accurate in any way so I will have to get the bounds of that projection to be more in tune with the bounding sphere.

Yeah, that’s about it. šŸ™‚

Edit: Just as a pointer: I know it’s not really necessary to render different size shadow maps per cascade, but that was just a thing I decided on, don’t take it too seriously.

Edit #2: Another one. Screen space dithering helps with the jagged situation. Still noisy, though. But I often find it’s a worthy tradeoff; Noise for reduced aliasing. šŸ™‚


OK. I don’t want to make a new post about this since it’s pretty minor and it’s connected to this post:

This is a different setup of the CSM which uses a consistent size for the shadow maps, 4 tap PCF and screen space dithering.
It looks a lot better now, albeit a bit noisy. And moving the camera around shimmers the shadows some, which I don’t really know if I’ll bother fixing right.
I think I’ll keep it as is for a while and focus on something else, like deferred shadow maps for spot lights. šŸ™‚
(Bonus: I threw some trees in for testing how that looks.)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s