What color transformation does Workbench apply to matcaps?

I like Workbench. I thought I’d try to recreate it for Eevee in order to get a few more features like normal mapping, texture alpha blend, etc.

I made a simple matcap node group, multiplied by texture, and tested it out, but the colors are slightly different. Not just in brightness, but in hue as well. Could potentially be a power relationship, or it could be a more complicated transform that’s hidden somewhere. That’s rendering with no color transform in both Eevee and Workbench, matcap files read as linear color (reading as sRGB is obviously not right.) Disabling features like shadow, cavity, of course.

With a little more testing, I can rule out the difference as being dependent on normal or some AO calculation. Also tested with a homemade UV matcap to see if Workbench was using a different mapping technique, but it looks the same.

It could probably be represented by a 4kt (2^24 = 2^12 * 2^12) tonemap, but trying to make a 4k tonemap texture + lookup sounds irritating to me (have to shift all the lookups over by half a texel, encode 3D data onto a 2D surface, have done it before for HLSL and it was tedious.)

Anybody have any idea how workbench is transforming color?

In terms of HSV, this is what workbench applies to all matcaps by default.

I really dont understand the design choice of having all matcaps darkened by default in blender, but there you have it.

I’m not comparing single color to single color, but texture to texture-- single color settings shouldn’t affect that, right?

There’s more than a straight multiplication going on, anyways-- some colors are lighter, some are darker. (I guess that would rule out a straight power operation too, but some kind of offset power and/or multiply might do it.)

When you switch to single color mode initially, the matcap doesnt change at all. So we know then, that a regular material has the same offset that single color has when you first switch to it. So every matcap can be a little bit brighter than it normally is if you just select it regularly.

That’s because it’s changing from material, and default material color is .906 white, same as the default “single” color, so there’s no change in color.

Here’s an example. Eevee render compared to Workbench, both full renders (not viewport), display device “none”, WB rendering single color set to 1.0 white, Eevee using camera space normals as a lookup on the matcap (basic_2.exr):

Notice especially that some parts are brighter, some parts are darker.