Add ps5 changes

This commit is contained in:
Wojtek Figat
2021-11-21 19:02:24 +01:00
parent d260681773
commit e8b680c78b
8 changed files with 17 additions and 15 deletions

View File

@@ -37,22 +37,22 @@ float4 FastTonemapInvert(float4 c)
return float4(FastTonemapInvert(c.rgb), c.a);
}
half LinearToSrgbChannel(half linearColor)
float LinearToSrgbChannel(float linearColor)
{
if (linearColor < 0.00313067)
return linearColor * 12.92;
return pow(linearColor, (1.0 / 2.4)) * 1.055 - 0.055;
}
half3 LinearToSrgb(half3 linearColor)
float3 LinearToSrgb(float3 linearColor)
{
return half3(
return float3(
LinearToSrgbChannel(linearColor.r),
LinearToSrgbChannel(linearColor.g),
LinearToSrgbChannel(linearColor.b));
}
half3 sRGBToLinear(half3 color)
float3 sRGBToLinear(float3 color)
{
color = max(6.10352e-5, color);
return color > 0.04045 ? pow(color * (1.0 / 1.055) + 0.0521327, 2.4) : color * (1.0 / 12.92);