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

Vulkan: LightmapGI always bakes direct light shadows (for fully baked lights), even for lights that have shadows disabled #56611

Open
Tracked by #56033
Calinou opened this issue Jan 8, 2022 · 4 comments

Comments

@Calinou
Copy link
Member

Calinou commented Jan 8, 2022

3.x version of this issue: #56610

Godot version

4.0.dev (8f6cba3)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

Issue description

LightmapGI (GPU lightmapper) always bakes direct light shadows, even for lights that have shadows disabled. I don't know whether this is a bug or a design decision, but this should either be fixed or documented (both in the class reference and Using Lightmap global illumination page).

Orange lights have shadows disabled, blue lights have shadows enabled. Lights on the left are OmniLights, lights on the right are SpotLights.

Fully baked lighting

2022-01-08_02 05 17

Real-time lighting

2022-01-08_02 05 25

Steps to reproduce

  • Import a glTF scene. Set the light bake mode to Static Lightmaps in the Import dock and click Reimport.
  • Add a LightmapGI node.
  • Add an OmniLight3D node with shadows disabled. Add a second OmniLight3D node with shadows enabled. Move them so you can clearly see the difference between shadows being enabled and not. Set both lights' global illumination mode to Static
  • Repeat the above steps with two SpotLight3D nodes.
  • Bake lightmaps. Look at the result; both lights will cast shadows.

Minimal reproduction project

test_lightmapgi_no_shadows.zip

@mrjustaguy
Copy link
Contributor

mrjustaguy commented Jan 8, 2022

I think reflection probes also suffer from this when their "Enabled Shadows" are set to on.

Edit: Reflections don't suffer from that after all, they just render Shadows from things that they shouldn't be able to see, but only for Directional Lights.. (in the mobile renderer at least, cannot test clustered due to bug with culling)

@atirut-w
Copy link
Contributor

This is still an issue on v4.2.2.stable.official [15073afe3]. Anyone working on this?

@Calinou
Copy link
Member Author

Calinou commented Jun 12, 2024

Anyone working on this?

Not that I know of. That said, keep this in mind:

I don't know whether this is a bug or a design decision, but this should either be fixed or documented (both in the class reference and Using Lightmap global illumination page).

For performance reasons, it can make sense not to want real-time shadows for a specific light, but still want it to bake shadows as baking shadows has no runtime performance cost. Lights without shadows don't physically make sense and make objects look like they're floating.

@atirut-w
Copy link
Contributor

Lights without shadows don't physically make sense and make objects look like they're floating.

There are actually artistic uses for it, like casting light from somewhere hidden that doesn't necessarily need shadows which Unity's URP sample project does.

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