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

Crossed omni and spot light shadows cause artifacts. #76260

Closed
Saul2022 opened this issue Apr 19, 2023 · 7 comments
Closed

Crossed omni and spot light shadows cause artifacts. #76260

Saul2022 opened this issue Apr 19, 2023 · 7 comments

Comments

@Saul2022
Copy link

Saul2022 commented Apr 19, 2023

Godot version

Godot 4.0.2 stable

System information

Windows 11 amd radeon Tm graphics , 8gb ram, vulkan clustered

Issue description

It seems that when the shadows from a spotlight and a omnilight are crossed between each other it causes artifacts to appear in the edge of the shadows. This can be more noticeable with there are no directional light as their shadows hide the artifact. Btw to see it better i made it be black so it can be more distingueable.

shadows
shadows2

Also kind of workaround is increasing their resolution, although it has a big impact on perfomance.

Steps to reproduce

1 Open the project zip and extract

2 Add an omni and spot light with shadows enabled

3 make it direction crossed between each other and it has some object

Minimal reproduction project

test_shadow.zip

@clayjohn
Copy link
Member

I'm not sure I understand what the bug is here. I see no difference in shadow quality when enabling/disabling either the OmniLight or the SpotLight.

In the image it appears that you are pointing out the aliasing artifacts on the edge of the omnilight shadow. Those artifacts are present both when the SpotLight is enabled and disabled. To get rid of them you need to set the Positional shadow quality setting from Low (the default) to High. Once you set Quality to high the edge looks very smooth.

To be clear, increasing resolution also helps, but it isn't a proper solution for this type of problem

@Calinou
Copy link
Member

Calinou commented Apr 19, 2023

This is expected, as shadow maps have a limited resolution. You can also increase Shadow Blur on the Light3D's properties if you want to make the shadow blurrier (which will hide sampling artifacts), but don't make it too high or dithering artifacts will become noticeable.

@Saul2022
Copy link
Author

Saul2022 commented Apr 20, 2023

Yea increasing a bit of blur helped a bit, although something weird is that why other engine like wicked seems to have another kind of dithering or something, because it weird they look different
Captura de pantalla 2023-04-20 113212
editor_screenshot_2023-04-20T113131

I think it could be something to do with blur(which the wicked engine doesn´t seem to be possible to modify) or they use different dithering patterm. Also enabling fsr 2.1 in the wicked engine didn´t affect much shadows.

Edit: it also happens on default blur even in soft high
editor_screenshot_2023-04-20T115448

@Calinou
Copy link
Member

Calinou commented Apr 20, 2023

This is shadow acne, which is caused by bias being too low. Increase Shadow Bias and/or Normal Bias in the inspector. Don't set it too high or peter-panning will occur (shadows disconnecting from objects).

@Saul2022
Copy link
Author

This is shadow acne, which is caused by bias being too low. Increase Shadow Bias and/or Normal Bias in the inspector. Don't set it too high or peter-panning will occur (shadows disconnecting from objects).

Yea it helps,. but what would be possible to do with dithering patterm that appears in the floor that look like circles in the below screenshot aside from turning off the filter in soft shadows ? i tried increasing fog there but it only goes back with high amount which makes more artifacts appear.

@Calinou
Copy link
Member

Calinou commented Apr 20, 2023

The shadow dithering pattern is expected; it improves perceptual rendering quality. This pattern becomes less noticeable at higher viewport resolutions, or when you start adding textures to your level. If you disabled dithering, sampling artifacts would become much more noticeable (#53961). Dithering is one of the reasons why shadows look so much better in 4.x than 3.x 🙂

Closing, as this isn't a bug and this will be eventually improved when TAA is enabled as per godotengine/godot-proposals#4179.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2023
@Saul2022
Copy link
Author

Thank you also i found some document about using temporal reprojection, which could help giving shadows a better look if you want to see it and evaluate it aside from fsr 2.2 https://www.google.com/url?sa=t&source=web&rct=j&url=https://diglib.eg.org/bitstream/handle/10.2312/EGWR.EGSR07.045-050/045-050.pdf%3Fsequence%3D1%26isAllowed%3Dy&ved=2ahUKEwia4dCNgMP-AhXzUKQEHThhA-8QFnoECAcQAQ&usg=AOvVaw17_-JjdfO6WHPt7XmBhCjU

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

3 participants