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

Shadow atlas size setting does not change resolution #24587

Closed
SavageMcCabbage opened this issue Dec 24, 2018 · 2 comments · Fixed by #37678
Closed

Shadow atlas size setting does not change resolution #24587

SavageMcCabbage opened this issue Dec 24, 2018 · 2 comments · Fixed by #37678

Comments

@SavageMcCabbage
Copy link

Godot version: 3.1 alpha 4, also appears in 3.0.6 stable

OS/device including version: Windows 10, GTX 1070ti, NVidia 417.35 Drivers

Issue description:
Changing the shadow atlas size appears to affect the softness of the filtering, rather than increasing the resolution of the shadow.

I've tested the default project quality settings with shadow filtering set to PCF13, using shadow atlas sizes from 512 by 512 to 16384 by 16384. The scene is a cuboid and a plane, with one omni light casting a shadow. It looks like the shadow just gradually loses the effect of the filtering as the resolution increases, rather than increasing the resolution itself.

512 by 512:
512

1024 by 1024:
1024

2048 by 2048:
2048

4096 by 4096:
4096

8192 by 8192:
8192

16384 by 16384:
16384

I can't tell by eye if the resolution is actually changing as expected at the lower resolutions, but it's clear to me that the shadows are exactly the same between 4096, 8192 and 16384, aside from the higher two looking worse due to not having the edges smoothed as much. Currently, it doesn't seem worth it to turn shadows to anything other than somewhere between 2048 or 1024, as those seem to be the best balance between clarity and smooth edges.

Steps to reproduce:

  1. Set shadow filtering to PCF13.
  2. Set shadow atlas resolution to any low power of 2 in project settings, then raise until hitting the max.
  3. Observe how shadow blockiness never changes (aside from being imperceptible at the lower resolutions due to excessive smoothing), but smooth filtering decreases as resolution increases.

Minimal reproduction project:
Shadow Test.zip
The only setting I changed between the screenshots was shadow atlas size. It's
currently set to max in this project. The omni light has its bias set to 0.05, but is otherwise unchanged.

@Zylann
Copy link
Contributor

Zylann commented Dec 25, 2018

Note that resolution and smoothness are two different things: if the lower resolution looks blurrier, it's probably not directly intented. If you want a smoother blur, that would be a new feature to control the filtering of shadows rather than their resolution, though real shadows do present varying levels of blur the further they are from their projector. What we have at the moment is just antialiased sharp shadows.

However, as I look at the last screenshots, it indeed looks like the filter runs on an image that should have been higher resolution, because pixelation becomes apparent.

@SavageMcCabbage
Copy link
Author

Yeah, you're right, the smoothing doesn't seem related. I tried again with it disabled, and it's a lot clearer that it works fine up to 4096, but it seems almost as if a lower res shadow map is being used to determine where the higher res map is dark, so there's a smaller, second jagged edge along the first, more visible edge.

jaggy

(Using 8192 for that one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants