-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Directional Shadows disappear with large Camera Z Far values at some angles #89560
Comments
Bisecting points to #84745 as the culprit |
Cc @lawnjelly |
I just checked and it doesn't seem fixed by #89714 which was merged after 4.3 dev 5. It's probably again down to numerical precision at large values, I'll investigate, it could be it needs an epsilon for this case. Until then just switch off tighter culling in |
Also occurs in 3.6 beta 5 (as the tighter culling code is shared). Here's MRP for 3.6: This should be easier to debug in 3.6 and port fix to 4.x. |
Got it, it's the same bug as #89714 , but I forgot to fix it for directional lights. |
Re-opening this temporarily (maybe until the next build) to try and prevent duplicate issues being reported. The issue is fixed, but bug reporters may not see closed issues in their searches. |
Tested versions
System information
Godot v4.3.dev5 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.3623) - AMD Ryzen 7 2700 Eight-Core Processor (16 Threads)
Issue description
When I set the camera's Z Near to 10m and Z Far to 1,000,000m, shadows from a directional light begin to disappear at certain angles. Reducing the Z Far value to 100,000m resolves the issue. The ratio between the near and far planes is not significantly different from the default values (4000 / 0.05 = 80,000, compared to 1,000,000 / 10 = 100,000), so I think that the problem is unlikely to be related to Z fighting or similar issues.
Small Z Far value:
Large Z Far value:
Steps to reproduce
In the MRP, toggle the preview between Camera3D_Ok and Camera3D_Error to observe the disappearance of shadows. Additionally, you can adjust the editor camera settings to match those of Camera3D_Error and rotate it to identify angles at which the shadows fail.
Minimal reproduction project (MRP)
ShadowTest1.zip
The text was updated successfully, but these errors were encountered: