Description
Description
Originally reported in:
https://discourse.threejs.org/t/scene-texture-background-is-lighter-than-image-used/38362
It appears that the editor currently assumes background textures use the working color space, LinearSRGBColorSpace. That's probably correct for .exr or .hdr textures, but it's unlikely that non-HDR textures in PNG/JPG/WebP/AVIF/... formats will be linear. We should assume that these formats are sRGB, like material.map
.
The incorrect (lighter) output in the issue report is the result expected if we set background.colorSpace to NoColorSpace or LinearSRGBColorSpace, when it should be SRGBColorSpace.
I've checked that fog and tone mapping are not involved in this case. We can get the same result by doing a linear-to-sRGB conversion on the already-srgb input:
oiiotool -i ~/Downloads/background.jpeg --iscolorspace lin_srgb --colorconvert lin_srgb srgb -o ~/Downloads/background_srgb_oetf.jpeg
Reproduction steps
- add background texture to Editor (see link)
- observe lighter background than expected
Code
n/a
Live example
n/a
Screenshots
Expected
Actual
Version
r174
Device
No response
Browser
No response
OS
No response