-
-
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
New Lightmapper renders black textures with PanoramaSky EXR in GLES 2. Godot_v3.2.4-rc3_win64 #46442
Comments
I have traced back the origin of the problem to the usage of an HDR .exr texture as the environment texture. It seems like the GLES2 doesn't play nice with HDR textures (AFAIK it doesn't support HDR lighting, so it makes sense) and getting data from them gives scrambled data. I try to find a way around the limitation, but in the meantime converting your EXR image to png should work fine. |
@JFonS Thank you for taking a look! I guess this should be obvious since it is stated in the documentation that GLES 2 doesn't use HDR rendering features. https://docs.godotengine.org/en/stable/tutorials/misc/gles2_gles3_differences.html#hdr My fault for not realizing this extends to all HDR related operations and not just the viewport. Can confirm that the same image converted to PNG does appear to bake correctly. |
However, @JFonS this does raise another question. In the BakedLightmap node Inspector settings, there is an option to "Use HDR" which renders HDR EXR images for the lightmaps. If the project is set to GLES2, wouldn't the previously mentioned issue also be present here as well? |
Not really... From what I see, the only thing that is not working with HDR textures in GLES2 is getting the texture data from the GPU to the CPU (probably a bug somewhere, needs to be investigated). So if you set an HDR texture as the environment panorama, when the lightmapper tries to read it, it gets invalid data. Just sending the lightmap texture as HDR to the GPU should work fine. I debated disabling the "Use HDR" option in GLES2, since any light value over 1 will get clamped by the renderer anyway. But the increased precision reduces banding in the lightmap, so I decided to keep it. |
Heh! So looking forward to the GPU lightmapper ;) Actually, if I may humbly suggest, perhaps the pop up text on the "Use HDR" button in GLES2 could describe what is actually going on as to not confuse the user that they are actually rendering HDR lightmaps. (unless I don't understand what's happening) Lastly, would you suggest that an issue be created to explore that bug regarding getting HDR texture data from the GPU to the CPU? |
Godot version:
Godot_v3.2.4-rc3_win64
Issue description:
New Lightmapper renders black textures when the Environment Background is set to PanoramaSky EXR.
Issue appears to maybe only be present in GLES 2.
Setting LightMapper Environment to Custom Sky and loading the same PanoramaSky yields same result.
Steps to reproduce:
Minimal reproduction project:
BUG_Bake.zip
The text was updated successfully, but these errors were encountered: