diff options
author | Omar Emara <mail@OmarEmara.dev> | 2022-11-02 14:55:23 +0300 |
---|---|---|
committer | Omar Emara <mail@OmarEmara.dev> | 2022-11-02 14:55:23 +0300 |
commit | bc8b15f1a532b078fcc4072295c442d140cdbc06 (patch) | |
tree | 57f5451d2b59e07752a75baef704e21fa8203426 /source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_bright_contrast.glsl | |
parent | c394f510a5150a177919976b5775783c997b6934 (diff) |
Realtime Compositor: Move shaders to compositor module
This patch moves the GLSL shaders and their infos to the compositor
module as decided by the EEVEE & Viewport module. This is a non
functional change.
Differential Revision: https://developer.blender.org/D16360
Reviewed By: Clement Foucault
Diffstat (limited to 'source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_bright_contrast.glsl')
-rw-r--r-- | source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_bright_contrast.glsl | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_bright_contrast.glsl b/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_bright_contrast.glsl deleted file mode 100644 index ce71b4fd8a4..00000000000 --- a/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_bright_contrast.glsl +++ /dev/null @@ -1,38 +0,0 @@ -#pragma BLENDER_REQUIRE(gpu_shader_common_color_utils.glsl) - -/* The algorithm is by Werner D. Streidt - * (http://visca.com/ffactory/archives/5-99/msg00021.html) - * Extracted of OpenCV demhist.c - */ - -#define FLT_EPSILON 1.192092896e-07F - -void node_composite_bright_contrast( - vec4 color, float brightness, float contrast, const float use_premultiply, out vec4 result) -{ - brightness /= 100.0; - float delta = contrast / 200.0; - - float multiplier, offset; - if (contrast > 0.0) { - multiplier = 1.0 - delta * 2.0; - multiplier = 1.0 / max(multiplier, FLT_EPSILON); - offset = multiplier * (brightness - delta); - } - else { - delta *= -1.0; - multiplier = max(1.0 - delta * 2.0, 0.0); - offset = multiplier * brightness + delta; - } - - if (use_premultiply != 0.0) { - color_alpha_unpremultiply(color, color); - } - - result.rgb = color.rgb * multiplier + offset; - result.a = color.a; - - if (use_premultiply != 0.0) { - color_alpha_premultiply(result, result); - } -} |