-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
DirectionalLight shadow has a visible line between splits due to linear filtering (GLES3 only) #54074
Comments
Another possibility is the wrapping mode used for reading the shadow map? Maybe it is wrapping where it should be clamping, or something like that. |
godot/drivers/gles3/rasterizer_scene_gles3.cpp Lines 5048 to 5050 in 72fb4d7
There's even a comment saying so above for cubemap shadows: godot/drivers/gles3/rasterizer_scene_gles3.cpp Lines 5017 to 5020 in 72fb4d7
|
Actually thinking about it if it is combining these shadow maps on an atlas the clamping is only affecting the edges of the atlas and not the in between areas, so you may have to as you say render slightly outside the intended area. So say you were aiming to fill 512 x 512 you might e.g. set the shadow matrices for rendering to 508x508 centrally, then if it reads a bit outside there is no problem. |
I found a blog post that mentions an issue similar to the one we're facing here:
|
Godot version
3.3.4.stable, 3.4.beta (69b2f1d)
System information
Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)
Issue description
DirectionalLight shadow has a visible line/seam between splits due to linear filtering.
This has been an issue as far back as Godot 3.0, but only in GLES3. In GLES2, hardware linear filtering isn't used. #46301 performs filtering in the shader, which is slower but sidesteps this issue entirely. However, we should aim to keep hardware linear filtering in GLES3 as it performs significantly better.
Changing the shadow filter mode between Disabled, PCF5 and PCF13 doesn't resolve the issue:
Enabling Blend Splits doesn't hide the visible line either:
Also, if you decrease the DirectionalLight's shadow Normal Bias but increase Bias Split Scale, the split line becomes even more visible. Example with PCF5 filter mode:
However, if you modify Godot's source code to revert #8009, the black line is gone. This is the case even with the aforementioned bias tweaks:
Maybe this can be fixed by adding some padding on each shadow map split.
See also #25303. This issue is different though – it's noticeable even on a single continuous mesh, regardless of MSAA, but only in GLES3.
Steps to reproduce
Minimal reproduction project
test_directional_shadow_split_line_3.x.zip
The text was updated successfully, but these errors were encountered: