Files
NixOS-configs/modules/wallpaper-engine/shaders/combine_hdr_editor.frag
2025-02-07 17:04:43 -06:00

20 lines
446 B
GLSL

varying vec2 v_TexCoord;
uniform sampler2D g_Texture0;
uniform vec2 g_TexelSize;
// Proper gamma conversion http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html
vec3 srgb(vec3 v)
{
vec3 c = step(0.04045, v);
return c * (pow((v + 0.055) / 1.055, 2.4)) + (1 - c) * (v / 12.92);
}
void main()
{
vec3 albedo = texSample2D(g_Texture0, v_TexCoord).rgb;
gl_FragColor = vec4(srgb(saturate(albedo)), 1.0);
}