-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
DirectionalLight3D shadows don't use the Shadow Max Distance property when the camera is in orthogonal mode (it uses the camera's Far distance instead) #58332
Comments
Judging by the screenshot, the shadows in orthogonal mode look correct to me. You should probably reduce Shadow Max Distance in the DirectionalLight3D node to increase their effective resolution – the default value is tuned for fairly large open worlds, not small-scale games. Can you try following the same steps in 3.4.2 and see if shadows look better out of the box, with the same Shadow Max Distance value in both projects? Also, the minimal reproduction project didn't upload (likely because you clicked away from the text field while it was still uploading). Try editing your post and upload it again. |
You are right, except it was the camera's far property that I had to update. Is it too early to update the documentation? I know a lot of things are in flux with 4.0 |
The Far property defaults to 4000 in The issue here is that DirectionalLight3D does not use the Shadow Max Distance property when the camera is in orthogonal mode, and uses the camera Far value as the maximum distance instead. Can you check whether this happens in 3.4.2 too?
The documentation could be updated, but I feel like the core behavior mentioned above should be changed for 4.0. |
3.4 uses PCF5 shadow filtering by default, while |
You are right again :) Thank you for the help! I've learned a lot |
I can confirm this on
|
Far = 4000 | Far = 500 | Far = 100 |
---|---|---|
3.x
The DirectionalLight's Shadow Max Distance is set to 100 on all screenshots.
Far = 4000 | Far = 500 | Far = 100 |
---|---|---|
It looks like shadow_max_distance has been ignored for a long time |
This appears to be done on purpose here: godot/servers/rendering/renderer_scene_cull.cpp Line 2084 in 251fb83
If you remove the check, shadows will disappear unless you greatly increase Shadow Max Distance in the DirectionalLight3D properties (it must be at least 3,200 or so if the editor camera's Far property is 4,000). |
Many people are reporting Shadow Mesh LOD not working correctly when they try the "Your first 3D game" official tutorial: https://www.reddit.com/r/godot/comments/170wqon/weird_shadows_in_godot_3d_tutorial/ There seems to be a relation to orthogonal camera setting |
@golddotasksquestions This is a different issue, which is tracked in #78422. You can work around the issue by disabling LOD generation on 3D scenes that have problematic shadows in the Import dock. |
Godot version
499eec1
System information
Arch, Vukan, X11, NVIDIA GeForce GTX 1070/PCIe/SSE2
Issue description
Shadows don't appear to be rendered correctly when using an orthogonal perspective.
Orthogonal:
Perspective:
Scene uses a directional light.
Steps to reproduce
Any scene with a directional light and an orthogonal camera perspective should recreate the issue, but I've attached a project for convenience.
Minimal reproduction project
Uploading minimal_project.zip…
The text was updated successfully, but these errors were encountered: