We see incorrect, washed-out colors in the 3D rendering if we change Interpolation to PBR in vtkProperty. For example, the image below shows that if we use the same RGB values with Gouraud interpolation (first column) and PBR interpolation (second column) then with PBR the color looks faded. After converting the RGB values from sRGB to linear RGB (third column), the PBR rendering is no longer faded.
It seems that color space of color values in vtkProperty depends on the chosen interpolation mode: RGB values are interpreted as sRGB; except if interpolation is PBR, then the color space is linear RGB.
Is this just a bug? I would expect VTK to take care of converting between color spaces as needed. (except where color is explicitly specified to be a different color space, e.g., for textures)
If for some reason VTK cannot do the necessary conversions under the hood then then at least there should be convenience methods in vtkProperty so that applications can still get/set colors in sRGB color space. For backward compatibility, it would make sense to call these methods SetColor, GetColor, etc. and add new methods (or optional additional method arguments) for specifying colors in other color spaces.
@lassoan, as far as I know, vtkProperty does not use sRGB color space by default unless you explicitly enable it using vtkRenderWindow::SetUseSRGBColorSpace.
Thanks a lot @sankhesh for looking into this. Do you think @michael or other VTK develop will investigate this further or you would need further inputs or help from me?
@lassoan Could you please confirm that the images generated in the screenshot you posted are from a vtkRenderWindow where UseSRGBColorSpace is enabled? Once you confirm, I can make the necessary changes in VTK’s PBR handling.