Skip to content
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

Directional 2 Split Shadow stabilization fix #82974

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

mrjustaguy
Copy link
Contributor

Fixes #59232

Before:

2023-10-07.18-01-10.mp4

After:

2023-10-07.17-59-45.mp4

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally (rebased on top of master 6916349), it works as expected. Shadows are now perfectly stable in motion with all rendering methods (Forward+, Mobile, Compatibility).

4-split PSSM and Orthogonal shadow modes still render correctly.

Note that this doesn't fix #54849.

master

Orthogonal PSSM 2 Splits1 PSSM 4 Splits
Screenshot_20231007_191911 webp Screenshot_20231007_191854 webp Screenshot_20231007_191905 webp

This PR

There are very small differences in still scenes when using PSSM 2 Splits, which is expected.

Orthogonal PSSM 2 Splits1 PSSM 4 Splits
Screenshot_20231007_190245 webp Screenshot_20231007_190223 webp Screenshot_20231007_190239 webp

Footnotes

  1. Split distance increased to 0.2 (instead of 0.1) to improve quality. 2

@akien-mga akien-mga requested a review from a team October 9, 2023 13:06
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing locally I can't see any visual regressions (tested with both a high res and low res shadow maps at varying max distances and varying camera distances).

I can confirm this fixes the stability of the 2 split variant. The fix makes sense as the 2 split variant uses a shadow map that is effectively twice as wide as the regular one.

It also makes sense that it wouldn't break the 4 split variant since 2 is a factor of 4

@akien-mga akien-mga merged commit 9798ae3 into godotengine:master Oct 25, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@mrjustaguy mrjustaguy deleted the Split-fix branch October 25, 2023 10:52
@akien-mga akien-mga changed the title Directional 2 Split Shadow Stabilization Fix Directional 2 Split Shadow stabilization fix Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants