Skip to content

Fix sRGB issues with OSPRay

Michael Migliore requested to merge michael.migliore/vtk:srgb-ospray into master

In order to improve further OSPRay/PBR unification, sRGB encoding must be taken into consideration.
So far, Intel has confirmed that all OSPRay colors are expected to be in linear color space.
So we need to convert all sRGB color textures to the correct format, especially base color texture for Principled and diffuse/specular for OBJMaterial. Background color/gradient have to be converted to linear color as well.
Color maps and uniform colors are expressed in linear color space in VTK, so we do not need to convert the colors.
A final conversion to sRGB color space is done to convert the linear output from OSPRay to sRGB result.

Important note: Only OSPRay pathtracer is impacted by this change. OSPRay raycaster does not support materials and OptiX does not support sRGB color space textures.

Here are two comparisons showing how it is important to use the correct color space for both the HDRI and the model color texture:

before old behavior

after fixed

before old behavior

after fixed

Edited by Michael Migliore

Merge request reports