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

directional light shadows not working in large world #81877

Open
PtrMan opened this issue Sep 18, 2023 · 6 comments
Open

directional light shadows not working in large world #81877

PtrMan opened this issue Sep 18, 2023 · 6 comments

Comments

@PtrMan
Copy link
Contributor

PtrMan commented Sep 18, 2023

Godot version

v4.1.1.stable.custom_build [bd6af8e] (double)

System information

Windows 11

Issue description

The object is at position <75000, 0, -149900> where lighting fails (the shading is completely black), while other nodes also exist at far away distances. The shadows work when the object is close to the origin (~2000 meters).

Steps to reproduce

  • open project
  • stare at black shadows

Minimal reproduction project

bugreportScene.zip

@PtrMan
Copy link
Contributor Author

PtrMan commented Sep 18, 2023

I disabled shadow casting and GI of the meshes for the celestials, this fixes this issue for this scene.

@Zireael07
Copy link
Contributor

Does the issue occur if you keep GI disabled but reenable shadows?

@PtrMan
Copy link
Contributor Author

PtrMan commented Sep 18, 2023

Then it's shaded black

@Calinou
Copy link
Member

Calinou commented Sep 18, 2023

At distances this far away from the world origin, you are expected to use a build with double-precision floats: https://docs.godotengine.org/en/latest/tutorials/physics/large_world_coordinates.html

If you are using official builds, please compile an editor build with precision=double and check if it occurs there.

I was able to reproduce something similar in the large world coordinates demo, but I'm not sure if it still occurs as of 4.2.dev4.

@PtrMan
Copy link
Contributor Author

PtrMan commented Sep 19, 2023

I compiled the tag 4.1.1 with precision=double already, else the coordinates would jitter. The unexpected behaviour still occurs compiled that way.

I may run the latest dev commit to see if this behaviour still occurs. It's not to bad because I don't need shadows to/from the celestial bodies anyways.

@Flarkk
Copy link

Flarkk commented Oct 23, 2024

@PtrMan can you raise the near value of your camera to something that is not farther apart than ~1e7 from your far value, and test again if shadows work on distant objects ?

If yes, then this may be solved by #95944

If you can test your project against this PR, it would help.

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

4 participants