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

Soft shadows banding #1309

Open
tomas7770 opened this issue Sep 14, 2024 · 0 comments
Open

Soft shadows banding #1309

tomas7770 opened this issue Sep 14, 2024 · 0 comments

Comments

@tomas7770
Copy link
Contributor

Description

Soft shadows currently exhibit banding artifacts, instead of appearing smooth.

Screenshots

Notice how there is visible banding around the edges of shadows:
image
image

Possible solutions

The current implementation of soft shadows uses PCF (Percentage Closer Filtering), which involves sampling multiple pixels of the shadow map and averaging their shadowed/unshadowed results. The most obvious way to reduce banding is to increase the number of samples, but this appears to cause a noticeable performance impact while still not looking smooth enough.

Modern GPUs support hardware-accelerated shadow smoothing (linear interpolation), exposed in OpenGL through sampler2DShadow, which samples an area of 2x2 pixels. This article describes a possible way to leverage this capability, while still being able to sample a larger area, to allow a configurable blurRadius.

@tomas7770 tomas7770 added A-Engine B-Rendering S-Triage Issues whose priority still has to be figured out labels Sep 14, 2024
@RiscadoA RiscadoA removed the S-Triage Issues whose priority still has to be figured out label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants