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

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

void node_composite_invert(float fac, vec4 color, float do_rgb, float do_alpha, out vec4 result)
{
  result = color;
  if (do_rgb != 0.0) {
    result.rgb = 1.0 - result.rgb;
  }
  if (do_alpha != 0.0) {
    result.a = 1.0 - result.a;
  }
  result = mix(color, result, fac);
}