-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Reverse Z depth broke LightmapGI #90627
Comments
CC @godotengine/rendering |
This bug is really surprising, looking through the lightmapper_rd code, it doesn't seem to interact with anything that would have been changed by the reverse z PR. Your confirmed changes though sound exactly like the lightmapper is using reverse z somehow though, so there must be something I am missing |
Had a quick look. The lightmapper uses rasterization to plot the base maps and the depth is hard-coded here (and similarly in
I guess the default clear value for depth has been flipped, so |
That looks like the issue, the default clear value flipped in godot/servers/rendering/rendering_device.h Line 1106 in 578d937
We should reverse that and then make sure the proper clear depth is used where it needs to be, or else we are breaking compat for a lot of RD consumers |
Tested versions
Bisect shows that 69a4ff8 is the culprit
System information
Godot v4.3.dev (2886511) - Debian GNU/Linux trixie/sid trixie - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2080 (nvidia) - Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz (8 Threads)
Issue description
After #88328 was merged, baking with LightmapGI outputs a tiny and completely black EXR which obviously doesn't provide any GI at all.
At first glance, changing
RD::COMPARE_OP_LESS
toRD::COMPARE_OP_GREATER
in two places inmodules/lightmapper_rd/lightmapper_rd.cpp
does seem to fix it, but there is more than that going on with depth in that file and I'm not at all familiar with the code so I'll leave a PR to someone else.Steps to reproduce
Minimal reproduction project (MRP)
lightmapgi-reverse-z-mrp.zip
The text was updated successfully, but these errors were encountered: