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 Mobile backend: LightmapGI is not sampled during rendering if a DirectionalLight3D with shadows enabled is visible #55867

Open
Tracked by #55871 ...
Calinou opened this issue Dec 12, 2021 · 2 comments

Comments

@Calinou
Copy link
Member

Calinou commented Dec 12, 2021

Godot version

4.0.dev (2a9dd65)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

Issue description

If a DirectionalLight3D with shadows enabled is visible, LightmapGI won't be sampled during rendering. This means the scene will not receive lighting from the lightmap (but it will still ignore environment lighting).

Vulkan Clustered backend

2021-12-12_20 17 16

Vulkan Mobile backend

2021-12-12_20 17 57

Edit: I've found that this is linked to directional light shadows.

DirectionalLight3D hidden

2021-12-12_22 59 30

DirectionalLight3D without shadows visible

2021-12-12_22 59 54

DirectionalLight3D with shadows visible

2021-12-12_22 59 34

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.
  • Bake lightmaps.
  • Switch to Vulkan Mobile backend in the project settings (search for back end).
    • Note: The MRP linked below already uses the Vulkan Mobile backend by default.
  • Restart the editor. Notice lightmaps no longer contribute to the static objects' lighting.

Minimal reproduction project

test_vulkan_clustered_vs_mobile_lightmap_sampling.zip

With .godot/ included to workaround importing issue: https://0x0.st/orQD.zip (link expires in September 2022)

@Calinou Calinou added this to the 4.0 milestone Dec 12, 2021
@Calinou Calinou changed the title Vulkan Mobile backend: LightmapGI is not sampled during rendering Vulkan Mobile backend: LightmapGI is not sampled during rendering if a DirectionalLight3D with shadows enabled is visible Dec 12, 2021
@clayjohn clayjohn modified the milestones: 4.0, 4.x Feb 23, 2023
@luketrueaxis
Copy link

Workaround: Create a duplicate mesh with shadow casting only, make invisible. Bake light mapping. Turn shadow casting off on the original mesh. Make duplicate mesh visible. Works for me. (Revert the visibility and shadow settings to bake again)

We wasted a bunch of time on this before realizing it seems to be a bug. Surprised it still seems broken all this time later. Got the idea for the work around later after it was discovered disabling shadow casting on the static object enables light maps, while still letting it receive light map shadows from other objects.

@Lasuch69
Copy link
Contributor

Lasuch69 commented Dec 8, 2023

I will take a look into it.

Edit: It is reproducible when selecting any mesh instance in the editor, however I can't find where the issue is. The fact that there are no errors in the editor and in the validation layers isn't helping either. Now that I think about it I should've used --verbose flag.

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