Is There Any Cheap Way To Switch useSRGB Between True and False

I use babylonjs to build a 3d-model-previewer, artist ask a droplist to select SRGB or Raw. I notice that we can only decide useSRGBBuffer or not when we create texture, updateUrl is not support to change useSRGBBuffer. does there any cheap way to switch texture SRGB or not in place, remap a new texture into material is a huge work. :face_holding_back_tears:

It’s not possible, sRGB is a different texture format than regular RGB, so the texture must be recreated at the WebGL (WebGPU) level.

1 Like

Could we set _useSRGBBuffer and then use updateUrl to reload this texture? Or we have to create a new texture, and replace old one with new one in all material

Yes, you can do it that way:


Thank you very much! :smiling_face_with_three_hearts: