LinearEncoding vs sRGBEncoding

I’ve been researching the whole Linear/Gamma color spaces for some time, and I’m still struggling with a few issues.

I (mostly?) understand the concept of Gamma Correction and how our eyes don’t perceive light linearly and all that.

Please correct me if I’m wrong anywhere:

If I’m getting a textured 3D model created with 3Ds Max - which I understand creates textures in sRGB color space - and the FBXLoader gives its textures an sRGB Encoding, then I need my WebGLRenderer to have an outputEncoding of sRGB as well in order for the model to look as it should, right? This is called a Gamma Workflow?

But If I’m commenting out the lines in FBXLoader which give the textures an sRGB encoding, and keeps both them and the renderer with a linear encoding, I get correct colors as well. Is this what’s called a Linear Workflow?

If in both cases the results are the same, then why one should be preferred over the other? What are the pros and cons?

I read that usually the renderer’s outputEncoding should be sRGB (unless post-processing is involved), but I see the default in THREE is LinearEncoding. Why is that?

Hopefully I was clear enough and someone can help me make sense with all this.

It is called a sRGB workflow. Keep in mind that simple gamma correction and sRGB are two different things.

Yes, although this approach is not correct from a strict technical point of view since your texture actually contains sRGB encoded data.

For many simple scenes the flaws of ignoring color spaces are not obvious. However, it is of course more correct to use a proper color conversion workflow. Simply because lighting equations, post-processing or many other shader code assume color values in linear space. If devs pay no attention to color space, things can quickly break.

It was considered once but not implemented because it would break existing applications which rely on the current default value.

2 Likes

Thanks for the answer!

So, to be clear, when I use textured models - which as I understand are usually encoded in sRGB in the software they were created - I should use sRGB workflow?

Yes, that’s correct.

1 Like

Since when has that stopped THREE before?! Its pretty much a given things will break each version for a good reason mind you. It would be better to setup proper defaults i say.

I think it is probably a question of “when”, not “if”. There are some remaining questions (see Add THREE.ColorManagement by donmccurdy · Pull Request #22346 · mrdoob/three.js · GitHub) I’d hope to have answered before the defaults would be changed.