Hi folks, apologies, don’t have a PG repro for this just yet, but as this is a relatively recent issue, perhaps it will make sense in terms of what has been recently modified.
What we’re doing: Loading in GLTFs from s3 with a custom loader that creates a node material and plugs the GLTF textures - which are KTX compressed - into the node material nodes (this is why it’s a little hard to get a good PG repro easily).
Our initial issue: When we went from preview 22 to preview 23, we found that all the textures we were loading into the node material were suddenly assumed to be in gamma space - diffuse became too dark, normal textures were broken, roughness became too shiny etc. This issue persists in v31.
Our initial solve: We created a new version of our node materials that set all of the texture nodes to convert the textures back to linear space.
Our issue now: Everything works great on windows desktop, but we’re finding inconsistent results on Macs. Meshes are getting loaded in with the diffuse sometimes appearing correct, but sometimes in the wrong gamma. Only seems to affect Mac - and in both cases we’re running in Chrome.
Correct gamma on PC:
Incorrect gamma on Mac:
It seems to only affect the diffuse channel, so my guess is that there are some assumptions being made when the GLTF is getting unpacked about what the colour space of the textures is, which is being evaluated differently on Macs vs Windows machines for some reason - maybe it’s a decompression issue with KTX compressed textures? Inside the node material we do not have an option to treat the texture as linear or gamma space, only to apply a transform to linear space or to gamma space.
I did try checking if the Babylon Texture object, when it is being assigned to the Node Material Block has its ‘gammaSpace’ property set to true, and that appears to be set to true on both PC and Mac, though it’s worth noting that switching it to false does not seem to make any visual difference to the scene as I would expect it to - which seems incorrect.
So, still working on getting a PG-able example of this up, but since this is related to recent changes, I’m wondering if maybe you guys might have some idea what has changed that might be causing these issues?