blob: abd4592dc9dc646ae9259554514ff2df4145c679 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/* Undefine the macro that avoids compilation errors. */
#undef blender_srgb_to_framebuffer_space
#ifndef USE_GPU_SHADER_CREATE_INFO
uniform bool srgbTarget = false;
#endif
vec4 blender_srgb_to_framebuffer_space(vec4 in_color)
{
if (srgbTarget) {
vec3 c = max(in_color.rgb, vec3(0.0));
vec3 c1 = c * (1.0 / 12.92);
vec3 c2 = pow((c + 0.055) * (1.0 / 1.055), vec3(2.4));
in_color.rgb = mix(c1, c2, step(vec3(0.04045), c));
}
return in_color;
}
|