New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cascaded Shadow Maps #13833
Cascaded Shadow Maps #13833
Conversation
Fixes the leaves of the trees but breaks grass
Nice! Some observations... There's a visible change between Cascade 0 and 1 (i.e. as approach a shadow of a larger object there's a visible discontinuity). I also saw some "phantom shadows", as you approach an area without shadow there appear circle shaped darker areas. (I'll see if I can do a short video of that). |
I think the cascade default distances might be too small. And I cannot easily figure out where the distances are actually set for each cascade. |
Just so I remember later... The cascade max distance is set here:
So if viewing_range would 100, the first cascade would end at 20, the next one at around 45, and the last at 100. If we wanted the smaller cascades to reach farther we'd change it to Or maybe we'd start with scale just set to 0.1 (i.e. 1/10 of the viewing range), or 0.2. |
With a changed distance calculation I'm more happy with this. Still have to look into the "phantom shadow"/moire effects with cascade 0 - as time permits. |
Setting the z perspective bias to 0.25 instead of 0.5 gets rid of the "fake" shadows. |
I'll file a separate PR, starting with x2048 and my changes on top as separate commits. |
Upgrades the current shadow mapping implementation to cascaded shadow maps.
Benefits:
Other fixes:
Notes:
To do
This PR is Ready for Review.
How to test