Brighter / Saturated colors loaded from texture

Hi, everybody.

I’m experiencing a strange behaviour when loading textures from files.
The colors seems to be distorted somehow -brighter and more saturated- and don’t match the actual texture colors.

I’m using WebGPU and I hope this isn’t an inherent problem with this technology.


Here’s an example using a texture:

I generated it writing this TSL shader:

material.colorNode = vec4(uv(), 1, 1);

This is the result, where I applied the oscSine() function to constantly switch between the color loaded from the texture file and the code that generated my texture.


As you might notice, I’m using a “custom” color shader…
But it’s quite straight-forward… Nothing “exotic”:

material.colorNode = texture(map, uv());

So… I think it isn’t something related to the shader itself…

Where’s the problem?
What am I missing?

Thank you. :face_holding_back_tears:

Just missing:

import { SRGBColorSpace } from 'https://esm.sh/three/webgpu';

map.colorSpace = SRGBColorSpace;

In general, a PNG/JPG texture representing color (as opposed to non-color data, like .normalMap, .roughnessMap, etc.) has probably been exported in the sRGB colorspace, and can be annotated as such.

2 Likes