-
-
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
Vulkan: LightmapGI's Directional property only works correctly when lights' bake mode is Dynamic, not Static #49936
Comments
This was confirmed by Saracen on the Godot contributors chat. |
The option My questions are: should the option In case |
The Directional property toggles support for spherical harmonics, which provides light direction information for normal mapping plus rough reflections. This is expected behavior, as you usually want to disable spherical harmonics when targeting low-end mobile hardware (or to save disk space for mobile/web games in general). Whether it should be enabled by default should be discussed in a different proposal. The Directional property shouldn't change anything else – all light types should be baked as usual, regardless of the property's value. |
Thanks @Calinou, clear now. I will investigate the `Spherical harmonics' implementation. |
I investigated this issue a bit and found that the culprit might be the disparity between the scaling factors of Actually, the lightmap does store the direct lighting information when the lights' bake mode is set to static. It's just that the scaling factor for indirect lighting is much larger than that for direct lighting; it appears as if only indirect lighting was requested. Bumping up the scaling factor of On the other hand, scaling down the factor of With these observations, I suspect that the scaling factor of |
Will attempt to reproduce and investigate. |
Godot version
4.0.dev (659178e)
System information
Fedora 34, GeForce GTX 1080 (NVIDIA 465.31)
Issue description
Vulkan: LightmapGI's Directional property only works correctly when lights' bake mode is Dynamic, not Static. When Directional is enabled and a light has its bake mode set to Static, it will generate lighting as if only indirect lighting was requested. This makes the scene much darker than it should be, since real-time lighting is disabled on baked objects when the bake mode is set to Static.
Having directional lighting in LightmapGI would be useful when the light's bake mode is set to Static, since this is how you can get the best possible performance while preserving normal map appearance. Otherwise, normal maps become useless for static lights if the lightmap doesn't store directional information.
See also #49935.
LightmapGI Directional disabled, DirectionalLight bake mode set to Static (correct)
LightmapGI Directional enabled, DirectionalLight bake mode set to Static (broken)
Steps to reproduce
Minimal reproduction project
test_lightmap_normalmap_1.zip
The text was updated successfully, but these errors were encountered: