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

DirectionalLight3D is not working correctly when light is pointing away #68143

Closed
Mikeysax opened this issue Nov 1, 2022 · 6 comments
Closed

Comments

@Mikeysax
Copy link

Mikeysax commented Nov 1, 2022

Godot version

4.0beta3

System information

PopOS 22.04, 5.19.0-76051900-generic kernel, Ryzen 6800h, Radeon 6700m, amdgpu, Vulkan

Issue description

Utilizing DirectionalLight3D and Environment, I'm seeing weird light behavior when the scene should be completely dark. I have a day night cycle and it's producing unexpected results and I'm not sure why:

image

Here is a video to demonstrate:

Peek.2022-11-01.20-21.mp4

Steps to reproduce

This is an old project, but it can be reproduced here:

https://github.com/Mikeysax/example-project-for-godot-bug-68143

Here are screenshots of the environment if that helps:

image

image

image

Minimal reproduction project

https://github.com/Mikeysax/example-project-for-godot-bug-68143

@Mikeysax Mikeysax changed the title DirectionalLight3D is acting weird DirectionalLight3D is not working correctly when light is pointing away Nov 1, 2022
@clayjohn
Copy link
Member

clayjohn commented Nov 2, 2022

This looks like it could be a shadow pancaking issue, but I can't confirm as I can't reproduce locally.

@TokisanGames
Copy link
Contributor

Most likely, your meshes are corrupted and this is a duplicate of either upgrading from godot 3 #63550 or upgrading from an earlier version of godot 4 #64854.

You can fix it by reimporting all of your meshes in the latest version, or deleting project/.godot/imported if all of your scenes are still linked to the import files.

@Mikeysax
Copy link
Author

Mikeysax commented Nov 2, 2022

@clayjohn @tinmanjuggernaut , I've uploaded a new project which should be able to replicate:

https://github.com/Mikeysax/example-project-for-godot-bug-68143

I can try your suggestion @tinmanjuggernaut , but the meshes being used are MeshInstances generated by Godot.

UPDATE: The imported suggestion did not change the issue

@Mikeysax
Copy link
Author

Mikeysax commented Nov 2, 2022

It seems as though setting max distance on Directional Shadow to a higher value kinda fixes the issue:

image

Is this a bug though or intentional?

@TokisanGames
Copy link
Contributor

I see, if they are native meshes, then what I wrote does not apply.
I opened up your project. You should learn about .gitignore and exclude .godot and .import.

Yeah Godot leaks light all over the place. It's not a ray tracer, (though the light baker is). Casting a shadow from a 100x100m object onto 4x1m objects right next to it with a 100 shadow distance is a challenge. Try adjusting the scale of your shadow casters and bring them into the same order of magnitude. Increasing shadow distance to 1000 is costly, though 100 is too short. 256-400 is good for modern and previous generation cards.

You can create mesh boxes and under Geometry mark them as cast shadow cast only. Then you can use them as flags to block light the way a gaffer would shape light on a film set. https://www.youtube.com/watch?v=ShFk1Ao9sBw

@Mikeysax
Copy link
Author

Mikeysax commented Nov 2, 2022

I see, if they are native meshes, then what I wrote does not apply. I opened up your project. You should learn about .gitignore and exclude .godot and .import.

Yeah Godot leaks light all over the place. It's not a ray tracer, (though the light baker is). Casting a shadow from a 100x100m object onto 4x1m objects right next to it with a 100 shadow distance is a challenge. Try adjusting the scale of your shadow casters and bring them into the same order of magnitude. Increasing shadow distance to 1000 is costly, though 100 is too short. 256-400 is good for modern and previous generation cards.

You can create mesh boxes and under Geometry mark them as cast shadow cast only. Then you can use them as flags to block light the way a gaffer would shape light on a film set. https://www.youtube.com/watch?v=ShFk1Ao9sBw

I see; thank you for the tips and help!

I was aware of .gitignore although I was not used to what should be excluded from a godot project for source control.

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

5 participants