Updates to Color Management in three.js r152

I wouldn’t memorize a rule for each material texture slot – there is no such restriction in three.js. I’d think of it this way:

  1. If the texture is meant to be used as data, not viewed as a color — like .roughnessMap or .normalMap — then you need NoColorSpace to prevent any color-related conversions.
  2. If the texture contains color, and its range is limited [0,1] — most .png or .jpg files — then the texture is very likely to be in SRGBColorSpace.
  3. If the texture contains color, and its range is outside [0,1] — most .hdr or .exr files — then your texture is very likely to be in LinearSRGBColorSpace.

I say “likely” here because it’s certainly possible to put linear data into .png or .jpg files, or sRGB data into .exr files. But most of the time you’d have to go out of your way to create textures that don’t follow these rules.

For a specific example, .emissiveMap could easily be a Linear-sRGB .exr file, or an sRGB .png file. Either would be fine — .png files generally compress better, but .exr files could be used for a much wider range of emissive values.

7 Likes