mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 13:10:39 +00:00
- complete transfer of vk_hdr fix from gzdoom (was missing the shader component)
This commit is contained in:
parent
c9a94a4899
commit
e8b31d3c08
1 changed files with 8 additions and 3 deletions
|
@ -31,9 +31,14 @@ vec4 Dither(vec4 c)
|
|||
return vec4(floor(c.rgb * ColorScale + threshold) / ColorScale, c.a);
|
||||
}
|
||||
|
||||
vec4 sRGBtoLinear(vec4 c)
|
||||
vec3 sRGBtoLinear(vec3 c)
|
||||
{
|
||||
return vec4(mix(c.rgb / 12.92, pow((c.rgb + 0.055) / 1.055, vec3(2.4)), step(c.rgb, vec3(0.04045))), c.a);
|
||||
return mix(c / 12.92, pow((c + 0.055) / 1.055, vec3(2.4)), step(vec3(0.04045), c));
|
||||
}
|
||||
|
||||
vec3 sRGBtoscRGBLinear(vec3 c)
|
||||
{
|
||||
return pow(c, vec3(2.2)) * 1.1;
|
||||
}
|
||||
|
||||
vec4 ApplyHdrMode(vec4 c)
|
||||
|
@ -41,7 +46,7 @@ vec4 ApplyHdrMode(vec4 c)
|
|||
if (HdrMode == 0)
|
||||
return c;
|
||||
else
|
||||
return sRGBtoLinear(c);
|
||||
return vec4(sRGBtoscRGBLinear(c.rgb), c.a);
|
||||
}
|
||||
|
||||
void main()
|
||||
|
|
Loading…
Reference in a new issue