linearToSrgb#

Fully qualified name: usdex::core::linearToSrgb

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

Translate a linear color value to sRGB 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 – linear representation of a color to be translated to sRGB color space

Returns:

The color in sRGB color space