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 does not obey the GeometryInstance3D Cast Shadow property set to Off #56870

Open
Tracked by #56033
Calinou opened this issue Jan 17, 2022 · 0 comments

Comments

@Calinou
Copy link
Member

Calinou commented Jan 17, 2022

Related to #56611.

Godot version

4.0.dev (ce6de71)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

Issue description

In the Vulkan GPU lightmapper, meshes will always cast shadows even if they were configured not to. This makes it impossible to have a specific mesh that receives baked lightmaps but does not cast static shadows (when the light's bake mode is set to Static). While there is no run-time performance on baked surfaces, this causes a discrepancy between baked shadows and real-time shadows (which dynamic objects receive when moving around the scene).

From left to right:

  • Single-sided plane with Cast Shadows set to Off
  • Single-sided plane with Cast Shadows set to On
  • Single-sided plane with Cast Shadows set to Double-Sided
  • Single-sided plane with Cast Shadows set to Shadows Only

master (OmniLight3D bake mode set to Dynamic, equivalent to 3.x's Indirect)

2022-01-17_19 02 50

master (OmniLight3D bake mode set to Static, equivalent to 3.x's All)

2022-01-17_19 03 19

In comparison, in 3.x, meshes that have Cast Shadow set to Off will not cast any shadows:

3.x (OmniLight bake mode set to Indirect)

2022-01-17_19 15 27

3.x (OmniLight bake mode set to All)

2022-01-17_19 16 12

Shadows will always be double-sided in 3.x as well, but I think this is expected behavior so that non-sealed levels can be lit properly.

Steps to reproduce

  • Create a scene in Blender with a box and single-sided planes on top. Export as glTF.
  • Import the glTF scene in Godot. Set the light baking mode to Static Lightmaps in the import dock and click Reimport.
  • Instance the glTF scene in Godot.
  • Right-click the plane nodes and enable Editable Children to adjust the Cast Shadow property on each plane.
  • Add an OmniLight3D node and enable shadows.
  • Add a LightmapGI node and bake lightmaps.
  • Set the OmniLight3D node's global illumination mode to Static instead of the default Dynamic. Bake lightmaps again.
  • Notice how shadows are casted differently – some shadows that were not previously present are now displayed.

Minimal reproduction project

master: test_lightmap_mesh_shadow_master.zip

3.x (for comparison): test_lightmap_mesh_shadow_3.x.zip

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

2 participants