You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
converting to linear space manually
converting to _SRgb on rasterization
It works but is quite an overhead.
The text was updated successfully, but these errors were encountered:
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
textureAnd when writing to color buffer:
It works but is quite an overhead.
The text was updated successfully, but these errors were encountered: