Details
Description
To facilitate correct rendering all color data must be in linear color space in the renderer. This does not mean however that all textures should have their color data corrected.
Qt and Qt Quick does provide information about what color space a source image is in (provided the user doesn't provide an incorrect suggestion). For example when loading a user provided texture it is possible to use:
https://doc.qt.io/qt-5/qimage.html#colorSpace
to determine which color space the image is in. If an image containing color data needs to be corrected we can flag it as such, and either convert it before upload, or perform some translation before using the data in the shader code.
All images contain color data, but usage matters. For example a texture that contains normal map data should not be converted, but a diffuse map should be. The same goes for formats like Metallic/Roughness/AO, which should not be corrected. Image data that will be be used as color in fragment shaders should be in linear space.