BabylonJS/Spector.js

Support SRGB8_ALPHA8 textures

0b5vr opened this issue · 10 comments

0b5vr commented

Description

It would be nice to have a preview of SRGB8_ALPHA8/EXT_sRGB textures.
It's currently not shown on uniforms inspector.
If it's not easily achievable, I want to see the textureType - height section in the screenshot below at least.

Screenshots

texture with internalformat: RGBA8

texture with internalformat: RGBA8

texture with internalformat: SRGB8_ALPHA8

texture with internalformat: SRGB8_ALPHA8

Motivation

Since Three.js r133, it starts using SRGB8_ALPHA8 textures and most of color textures are encoded using SRGB8_ALPHA8, which can't be seen via Spector.js currently.

mrdoob/three.js#22551

Unrelated

Spector.js saves my life many times so far, thank you for your work 🙏

Would be great indeed and should not be to hard to add :-) Would you have a quick repro page I can use to try it out ?

0b5vr commented

This one must be simple enough for example:

https://threejs.org/examples/webgl_materials_normalmap.html

Thanks, I ll have a look ASAP

I ll have a look tonight sorry for the delay thanks for the repro.

So it is currently working in Babylon
image

Here the issue is spector seems to not catch the texture setup required info to render.

The way it is recorded is through either one of ("texImage2D", "compressedTexImage2D", "texStorage2D")

looks like three is using texSubImage2D which we are not supporting so far to detect texture info, I ll see if I can add it

This sounds to be the exact same issue than #227

0b5vr commented

I confirmed it's now previewing sRGB textures on my end.

However the color output does not respect the sRGB EOTF.
I believe it will need an expensive CPU-side conversion, so that's not a priority task I think.
nevermind, it's working properly I think!

Thank you for your work!

0b5vr commented

ahh that was an issue about texStorage2D, should have investigated that depth.

no problem, it was definitely not obvious :-)