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

Decrease the default soft shadow quality to improve performance #54158

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Oct 23, 2021

Follow-up to #50329.

Soft shadows are relatively expensive to filter. However, with the default blur factors, it's not needed to use too many samples (unless PCSS-like shadows are used with a large size). Textures and screen-space antialiasing can also be used to mask the noise pattern effectively.

On a GeForce GTX 1080, going from Medium to Low for both shadow types saves 0.2-0.4 ms of GPU time per frame in 2560×1440 resolution. This can translate to significantly higher savings on lower-end GPUs.

Given how the shader works, this improves rendering performance even if lights with shadows are never used.

If you need higher quality shadows, the option to change the soft shadow quality in the Project Settings remains.

Preview

Click to view at full size. This is a rather extreme scenario, as there are no textures and FXAA is disabled.

Before (old default)

2021-10-23_16 29 35

After (new default)

2021-10-23_16 29 03

Soft shadows are relatively expensive to filter. However, with the
default blur factors, it's not needed to use too many samples
(unless PCSS-like shadows are used with a large size). Textures
and screen-space antialiasing can also be used to mask the noise
pattern effectively.

On a GeForce GTX 1080, going from Medium to Low for both shadow types
saves 0.2-0.4 ms of GPU time per frame in 2560×1440 resolution.
This can translate to significantly higher savings on lower-end GPUs.

Given how the shader works, this improves rendering performance
even if lights with shadows are never used.
@Calinou
Copy link
Member Author

Calinou commented Nov 25, 2021

After my findings in #53961, we could consider disabling shadow dithering as an alternative to decreasing the shadow quality. Doing both at the same time may look bad, so we should settle for one or the other.

@akien-mga akien-mga merged commit d2fa379 into godotengine:master Feb 10, 2022
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the decrease-default-soft-shadow-quality branch February 10, 2022 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants