Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpu_shader_compositor_luminance_matte.glsl « library « compositor « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3647ac583fea9f3695fbd328e4dccc44b2fe8b7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma BLENDER_REQUIRE(gpu_shader_common_color_utils.glsl)

void node_composite_luminance_matte(vec4 color,
                                    float high,
                                    float low,
                                    const vec3 luminance_coefficients,
                                    out vec4 result,
                                    out float matte)
{
  float luminance = get_luminance(color.rgb, luminance_coefficients);
  float alpha = clamp(0.0, 1.0, (luminance - low) / (high - low));
  matte = min(alpha, color.a);
  result = color * matte;
}