Skip to content
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

Open
Tracked by #56080
AlphaVDP2 opened this issue Feb 26, 2021 · 5 comments

Comments

@AlphaVDP2
Copy link

AlphaVDP2 commented Feb 26, 2021

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:

  • Create project with GLES2
  • Set Environment Background to PanoramaSky
  • Set EXR as Image
  • Set Environment in LightMapper to Scene.
  • Bake :)

bake_bug

Minimal reproduction project:
BUG_Bake.zip

@JFonS
Copy link
Contributor

JFonS commented Mar 3, 2021

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.

@AlphaVDP2
Copy link
Author

AlphaVDP2 commented Mar 4, 2021

@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.
png_gles2_bake

@AlphaVDP2
Copy link
Author

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?

@JFonS
Copy link
Contributor

JFonS commented Mar 4, 2021

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.

@AlphaVDP2
Copy link
Author

AlphaVDP2 commented Mar 4, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants