-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 exhibits light bleeding through occluded areas after denoising due to occluded pixels still receiving light #87815
Comments
Can you reproduce this issue when using OIDN as a denoiser? |
Hi, I have created a small project containing several test scenes to verify the correct generation and display of LightmapGI and LightmapProbes. The scene that verifies light leaks is called Test 03. In my case, the boxes are completely closed and it seems to me that regardless of the denoising method, it should be completely black inside. Toggling "Interior" in the LightmapGI settings doesn't change anything. Only changing "Environment" to "Disabled" removes the influence of the external environment (shouldn't turning on "Interior" work the same?) |
This is interesting, I created a box without one face in Blender, normals pointing inside, then I generated UV2 also in Blender, imported into Godot v4.3.dev4.official [df78c06] and the result is like this (clearly visible brighter edges): UV2 in Blender (UV Lightmap Pack : Margin = 1) Baked lightmap from Godot (Quality : Ultra, Denoiser: Off, Texel Scale: 4) After generating new UV2 in Godot (Light Baking : Static Lightmap, Lightmap Texel Size: 0.2): Baked lightmap from Godot with new UV: |
It's strange this occurs, considering Godot's UV2 is padded more aggressively. Does this occur with a MeshInstance3D with a BoxMesh that has Add UV2 enabled in its properties? This procedurally generates UV2 without calling xatlas on import. |
OK I'm checking, I just don't know if it is possible to remove one of the faces in the boxmesh to make the test object identical to the one imported from Blender. Anyway:
Baked lightmap: Looks okayish? Not counting the black pixels in the corner. I don't know if this is a good test due to the fact that cull mode is probably not supported and the inner faces are illuminated as if they were outer faces (issue #89402) |
OK, now same test but with 5 planes, each one with UV2 generated in Godot, LightmapGI with texel size 1. The edges of the planes are adjacent to each other. Zoomed baked lightmap: There is no difference if I turn on or off "use_texture_for_bounces". When Texel Size is bigger, brighter edges edges become narrower but do not disappear. Here's use_texture_for_bounces = off, texel size = 8: |
Tested versions
v4.2.1.stable.official [b09f793]
System information
Godot v4.2.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 31.0.15.3758) - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)
Issue description
Continuation on/Reopening of #63437
Pixels inside intersecting or overlapping geometry still receive light. This is an issue when:
Both those situations are fine without denoising, but cause light leaking/bleeding after the rendered result is denoised.
Before denoising (left) and after (right) with a relatively high texel density and "use textures for bounces" enabled in both. The visible seams between the flat modular meshes is related to #82607
Inside a wall section with "use textures for bounces" enabled (left) and disabled (right). Note that when disabled there are still pixels visible within the occluded areas that are receiving light.
Light leaking at a 'reduced' texel density, "use textures for bounces" disabled in both, with denoising disabled (left) and enabled (right). Note the various light leaks, not only on the walls near the ceilings, but on the wall next to the door mesh, and several corners of individual wall-meshes on the far wall.
In this last example I had raised the ceiling meshes slightly to ensure there should be no ambiguity for the lightmapper on whether the interior-side face of the wall should be entirely occluded or not. This did not make a difference in the resulting lightbake.
Raised ceiling mesh to completely occlude the interior facing side of the wall (left), view from inside the ceiling mesh showing that light is reaching the top of the wall which is expected to be occluded.
Increasing the texel density can unreliably (slightly) alleviate the issue, but is not a legitimate solution since the texel densities used in these tests should be more than sufficient and are representative of what should be expected to work and used in the average project. Also worth noting is that these meshes are imported with a reduced texel size of 0.05 in the first 4 screenshots, and 0.1 in the last 4 screenshots, compared to the default texel size of 0.2
Using custom lightmap UVs with more padding has not made a difference in my tests.
Compared to the average modular game environment (anecdotally, but coming from a professional background in both AAA and indie development as a point of reference), the meshes used in these tests provide a forgiving scenario for the lightmapper to deal with: The meshes are manifold, there is no intricate geometry, and all meshes have plenty of thickness to cover a decent amount of pixels on the lightmap when intersecting or overlapping with other geometry.
Taking possible light leaking at the borders of the occluded areas in account (i.e. single pixels bleeding through at intersections), an artist should be able to expect the resolution, overlap and thickness in this scenario to provide a sufficient buffer for the lightmapper to avoid leaking.
This issue is also discussed in #75440
Steps to reproduce
The MRP has "use texture for bounces" disabled, since this seems to just worsen the existing issue and does not seem like the cause.
Minimal reproduction project (MRP)
LightmapGiLeaking.zip
The text was updated successfully, but these errors were encountered: