sRgbToLinear#

Fully qualified name: usdex::core::sRgbToLinear

pxr::GfVec3f usdex::core::sRgbToLinear(const pxr::GfVec3f &color)#

Translate an sRGB color value to linear color space.

Many 3D modeling applications define colors in sRGB (0-1) color space. Many others use a linear color space that aligns with how light and color behave in the natural world. When authoring UsdShadeShader color input data, including external texture assets, you may need to translate between color spaces.

Note

Color is a complex topic in 3D rendering and providing utilities covering the full breadth of color science is beyond the scope of this module. See this MathWorks article for a relatively brief introduction. If you need more specific color handling please use a dedicated color science library like OpenColorIO.

Parameters:

color – sRGB representation of a color to be translated to linear color space

Returns:

The translated color in linear color space