-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Use the Light3D Indirect Energy property in LightmapGI #52256
Use the Light3D Indirect Energy property in LightmapGI #52256
Conversation
@Calinou the plan is to make it work for static as well, right? BTW static baking is not entirely working right now |
If someone manages to find a way, yes 🙂
Could you describe what's not working? Here, it works as expected as long as Directional is not enabled. |
Baking spot lights doesn't work even if directional is not enabled. |
Please open a new issue with a minimal reproduction project attached. |
It currently only works if the light's bake mode is Dynamic, not Static.
ce787cd
to
b611e8b
Compare
The current changes look good. I haven't tested it, but adding support for static indirect light may just be a matter of adding the factor multiplication here: godot/modules/lightmapper_rd/lm_compute.glsl Line 358 in b611e8b
Or better yet, multiply directly in the |
I've tried this, but unfortunately, it multiplies both the direct and indirect light: DirectionalLight and OmniLight Indirect Energy set to 2DirectionalLight and OmniLight Indirect Energy set to 1DirectionalLight and OmniLight Indirect Energy set to 0(The red light source is an emissive cube, not a light node.) |
@Calinou Right, that makes sense. In this case, I think we need to have two separate buffers for the direct light pass. The currently used one should stay the same, as it's the final light accumulation buffer, and we should add a new one that stores the "scaled" direct light depending on the light's indirect energy value. This new buffer can then be used as the source buffer for the first bounce and discarded. |
If this is a relevant fix for a regression in 4.0, it needs a rebase. cc @clayjohn |
The way this is implemented is incomplete, and it's too difficult for me to do it in a complete way. This can be done for a future 4.0.x release anyway, as this property isn't relied upon very often (at least with lightmaps). |
It is use a lot by artist. Most of the UE4 lighting tutorials I've seen use indirect energy when baking lightmaps |
This was resolved for all light types and bake modes by #82068, so this PR is no longer necessary. Both per-light and global indirect energy controls work as of 4.2, closing. |
Follow-up to #52252. See also #51705.
This implementation currently only works if the light's bake mode is Dynamic, not Static. I'm not sure how to make it work for static as well, but I documented this limitation nonetheless.
This closes #52257.
Testing project: test_lightmap_normalmap2.zip