I found a case where I had to convert a shader that was supposed to be used with the device in gamma color space.
To make it work as expected I had to surround most of the pixel shader code with these calls:
float4 col = Source.SampleLevel(Sampler0, tc, 0);
col = ColorUtilityTemp.LinearToSRgb(col);
...
col = ColorUtilityTemp.SRgbToLinear(col);
return col;
What this does is that the pixel shader
converts to linear space when sampling the _SRgb texture
manually converts back
And when writing to color buffer:
I found a case where I had to convert a shader that was supposed to be used with the device in gamma color space. To make it work as expected I had to surround most of the pixel shader code with these calls:
... col = ColorUtilityTemp.SRgbToLinear(col); return col;
What this does is that the pixel shader
_SRgb
textureIt works but is quite an overhead.