diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_image_linear_frag.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_image_linear_frag.glsl | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_image_linear_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_linear_frag.glsl index 97eb3afc177..d843550cd9a 100644 --- a/source/blender/gpu/shaders/gpu_shader_image_linear_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_image_linear_frag.glsl @@ -9,22 +9,23 @@ out vec4 fragColor; float linearrgb_to_srgb(float c) { - if (c < 0.0031308) - return (c < 0.0) ? 0.0 : c * 12.92; - else - return 1.055 * pow(c, 1.0 / 2.4) - 0.055; + if (c < 0.0031308) + return (c < 0.0) ? 0.0 : c * 12.92; + else + return 1.055 * pow(c, 1.0 / 2.4) - 0.055; } void linearrgb_to_srgb(vec4 col_from, out vec4 col_to) { - col_to.r = linearrgb_to_srgb(col_from.r); - col_to.g = linearrgb_to_srgb(col_from.g); - col_to.b = linearrgb_to_srgb(col_from.b); - col_to.a = col_from.a; + col_to.r = linearrgb_to_srgb(col_from.r); + col_to.g = linearrgb_to_srgb(col_from.g); + col_to.b = linearrgb_to_srgb(col_from.b); + col_to.a = col_from.a; } -void main() { - fragColor = texture(image, texCoord_interp.st); +void main() +{ + fragColor = texture(image, texCoord_interp.st); - linearrgb_to_srgb(fragColor, fragColor); + linearrgb_to_srgb(fragColor, fragColor); } |