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

Improve PCF13 shadow rendering in GLES2 by using a soft PCF filter #46301

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 21, 2021

This suppresses the blocky shadow appearance, bringing the shadow rendering much closer to GLES3. This soft filter is more demanding as it requires more lookups, but it makes PCF13 shadows more usable.

Preview

Before (PCF13)

2021-02-21_23 16 07

After ("PCF16 Soft" as PCF13)

2021-02-21_22 52 09

In motion

The directional shadow size was set to 2048 (instead of the default 4096) to make the smoothness more visible.

d.mp4

@Calinou Calinou added this to the 3.2 milestone Feb 21, 2021
@Calinou Calinou force-pushed the gles2-improve-shadow-rendering branch from fbb4484 to 09caa2e Compare February 22, 2021 00:42
@Calinou Calinou changed the title Improve shadow rendering in GLES2 by using a soft PCF filter Improve PCF13 shadow rendering in GLES2 by using a soft PCF filter Feb 22, 2021
@Calinou Calinou marked this pull request as ready for review February 22, 2021 00:43
@Calinou Calinou requested review from a team as code owners February 22, 2021 00:43
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.

Just the one suggestion. The rest looks good

drivers/gles2/shaders/scene.glsl Outdated Show resolved Hide resolved
This suppresses the blocky shadow appearance, bringing the shadow rendering
much closer to GLES3. This soft filter is more demanding as it requires
more lookups, but it makes PCF13 shadows more usable.

The soft PCF filter was adapted from three.js.
@Calinou Calinou force-pushed the gles2-improve-shadow-rendering branch from 09caa2e to 83eec8f Compare February 22, 2021 12:36
@akien-mga akien-mga merged commit 38c168b into godotengine:3.2 Feb 22, 2021
@akien-mga
Copy link
Member

Thanks!

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