I’m seeing discrepancy between the values that Color Picker returns when sampling a material in the Base Color Buffer View and what Pixel Inspector reports for Base Color. It was a long round-about way to land where I did and we’ve figured out how to work past the issue, but I wouldn’t mind some clarity on what I’m seeing here.
Background: We’re using a tinting method of dividing out an original color and multiplying in the new color. So if we have a red shirt we can divide the base color by red and multiply by blue and we’ll get a blue shirt. Presumably, then, if we divide and multiply by the same color we’d end up with the exact original, but we were seeing some discrepancies and traced it all down to the color picker. When we color-picked a value from the Buffer View Base Color to use as our divide color we got inaccurate results, but when we used Pixel Inspector and input the values we had the exact results we expected.
So I set up this little test:
[Image Removed]
When I put a Material Instance of this Material onto a mesh and previewed it with Base Color Buffer Vizualization Mode, I expected to be able to color-pick Sampled Albedo, then set Color Original / Sampled to 1 and see no difference in the two, but there was a difference.
The color picker gave me these RGB values: (0.03434, 0.015209, 0.012983).
But Pixel Inspector gave me these RGB values: (0.030713, 0.01096, 0.009134) - the exact values of Original Albedo (in our setup we are using textures in a more complicated material, so we can’t just look at the RGB values and plug them in like in this example).
If I manually entered the Pixel Inspector values into Sampled Albedo, then swapped Color Original / Sampled between 0 and 1, there was no visual difference (because they were the same color values).
Here’s the interesting thing…
Original Albedo is in sRGB, and its corresponding linear values are: (0.2039, 0.1294, 0.1176).
Using the conventional formula for sRGB conversion L = ((S+0.055)/1.055)^2.4 gives the color picked RGB values (0.03434, 0.015209, 0.012983).
Using the widely-accepted approximation conversion L = S^2.2 gives the Pixel Inspector values (0.030713, 0.01096, 0.009134).
It’s surprising to me that the approximation values are being used at all, but what’s more surprising is that those are the ones that I need to use in order for our tinting to work correctly. If anything, I would have expected the other way around.
I’m not exactly sure what my question here is, other than I guess…
Why are Pixel Inspector and Color Picker using different sRGB conversion methods, and is there a way to have them use the same?
Thanks!