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

Shadows broken with orthogonal camera in 3d both in editor and in game #78422

Closed
FXRoux opened this issue Jun 18, 2023 · 5 comments · Fixed by #92287
Closed

Shadows broken with orthogonal camera in 3d both in editor and in game #78422

FXRoux opened this issue Jun 18, 2023 · 5 comments · Fixed by #92287

Comments

@FXRoux
Copy link

FXRoux commented Jun 18, 2023

Godot version

v4.0.2.stable.official [7a0977c]

System information

Windows 10 (Version 10.0.19045 Build 19045) - Forward+ - Intel Core i7-7700K CPU - NVIDIA GeForce RTX 3080 (driver version 536.23)

Issue description

Orthogonal camera in editor:
Ortho

With the perspective camera:
Perspective
I would expect the shadow to be of the same quality whether in perspective or orthogonal camera

Cinematic view orthogonal camera:
CinematicPreviewOrtho
This screenshot uses a camera further away to show that the LOD used to generate the shadow break the shadow.

Steps to reproduce

Use the orthogonal camera.

Minimal reproduction project

MinimalProject.zip

@ghost
Copy link

ghost commented Jun 18, 2023

It looks like the shadow is picking a different LOD stage than the mesh.

@Calinou
Copy link
Member

Calinou commented Jun 19, 2023

The shadow texel density appears lower in the editor because the editor camera's default Z Far value is 4000. If you decrease it in the View settings at the top of the 3D editor viewport, shadows with an orthogonal camera should look better.

It looks like the shadow is picking a different LOD stage than the mesh.

This is actually desired in many cases. The issue is that it's picking a stage that is way too low given the amount of pixels it takes on the shadow map.

@golddotasksquestions
Copy link

golddotasksquestions commented Oct 6, 2023

Posting this here for documentation sake:

Many people who come new to Godot seem to have a problem with the Shadow Mesh showing a different LOD than the visible Mesh.

https://www.reddit.com/r/godot/comments/170wqon/weird_shadows_in_godot_3d_tutorial/

It is about shadow geometry LOD, not shadow texture LOD, so I wonder if it is related to this issue here.

image

Also the description of the Shadow Mesh in the import tab states that Shadow Mesh is currently supposed to always have the same LOD as the visible Mesh. Which does not seem to be true here.

@Calinou
Copy link
Member

Calinou commented Mar 2, 2024

@karlmacklin
Copy link

Not sure this helps, but I too was following the standard 3D tutorial and wound up with almost the exact thing as in the screenshot above, the orange 3D model has a boxy shadow.

I tried to disable the LOD generation for the import by editing the .import file directly and setting meshes/generate_lods=false but that did nothing sadly.

However, I went into my DirectionalLight3D > Directional Shadow and changed Pancake Size from 20 to down to 4 and boom - shadow is properly round 🤷‍♂️

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.

5 participants