TextureImporter.linearTexture

Currently, the documentation is the opposite of what the setting is in the inspector.

Reading this, it seems to me that texture would USE sRGB sampling if this option is set to true. However, the corresponding GUI on the texture inspector says “Bypass sRGB sampling”’ which means when this option is true it will not use sRGB sampling. Am I understanding or reading this wrong? If not, I recommend changing the text and/or property name of this variable to match what is expected.

I’m checking this out and will fix it in the docs.

To clarify:

When linearTexture is set to true (“Bypass sRGB” in UI), then no color conversions of any kind are done when sampling the texture. In all color spaces, the value from the texture appears in the shader as-is. This is mostly used for textures that store non-color data (normals, vectors, special data etc.).

The default for color textures is linearTexture=false, i.e. texture is treated as “color” (sRGB color space). When using linear color space rendering, this means that sRGB->Linear conversion is performed when sampling the texture in the shader.

This will be added to the docs.

Thanks for checking into this. This now makes more sense with that clarifying information. I look forward to the doc update.