Page MenuHome

Cycles: Correct sRGB conversion for interpolated textures.
Needs RevisionPublic

Authored by Stefan Werner (swerner) on Wed, Sep 18, 5:07 PM.



Conversion from sRGB->linear must happen before texure interpolation.
Previously, compress_as_srgb was a flag of the image node and
the node code did the conversion after the filtered lookup.
Now it's saved in the texture info and conversion happens before
the lookup filter. We can now also leverage GPU color space

Fixing T69982

Diff Detail

rB Blender
Build Status
Buildable 5016
Build 5016: arc lint + arc unit

Event Timeline

  • Cleanup: Whitespace

Note that there's one case where the color space conversion still happens in the wrong place, that is when OSL is enabled and reading external textures. OpenImageIO's TextureSys is loading 8 bit sRGB textures without color transform and calculates temporary mip maps and any interpolations in the wrong color space.

Brecht Van Lommel (brecht) requested changes to this revision.Thu, Sep 19, 1:39 PM

Code seems fine, but render tests with 16bit images seems to be missing sRGB to linear conversion.

This revision now requires changes to proceed.Thu, Sep 19, 1:39 PM

This should be u_colorspace_srgb, and then the OSL code should somehow handle that builtin colorspace.

We can't assume that the OCIO configuration contains a colorspace named "sRGB", for example the ACES one does not.