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

LightmapGI does not recognise cull mode in the material #89402

Open
Tracked by #56033
patwork opened this issue Mar 11, 2024 · 0 comments
Open
Tracked by #56033

LightmapGI does not recognise cull mode in the material #89402

patwork opened this issue Mar 11, 2024 · 0 comments

Comments

@patwork
Copy link
Contributor

patwork commented Mar 11, 2024

Tested versions

  • Reproducible in: v4.3.dev4.official [df78c06]

System information

Windows 10 - Godot v4.3.dev4.official [df78c06] - Vulcan (Forward+) - Geforce GTX 960

Issue description

It appears that LightmapGI does not take into account the Cull Mode of materials when generating lightmaps. Objects made up of single walls that have double-sided materials only accept lighting from one side.

lightmap-on

In the example above, only the first box on the left is correctly lit (not counting the light leakage at the edges). In this case, the material is one-sided and the normals point inwards. This makes the walls on the outside invisible.

The second and third boxes have double-sided materials and normals pointing outwards. Although for the renderer the walls are visible from both sides, lightmapgi treats them as one-sided and does not illuminate them with the objects inside with emission on. In addition, for some reason the top faces are bright (light leakage from above from DirectLight3D?).

When lightmaps are turned off, the scene is lit only by DirectLight3D and, not counting inaccuracies in the shadows, the Cull Mode support in the materials looks correct.

lightmap-off

Steps to reproduce

  • create a cube
  • remove one of the walls
  • set normals to point outwards
  • add material to the cube and set Cull Mode to disabled
  • place a light source inside the cube
  • generate lightmap

Minimal reproduction project (MRP)

Test 04 in https://github.com/patwork/Godot-LightmapGI-Tests

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