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

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

void main()
{
  ivec2 texel = ivec2(gl_GlobalInvocationID.xy);
  /* The lower bound is inclusive and upper bound is exclusive. */
  bool is_inside = all(greaterThanEqual(texel, lower_bound)) && all(lessThan(texel, upper_bound));
  /* Write the pixel color if it is inside the cropping region, otherwise, write zero. */
  vec4 color = is_inside ? texture_load(input_tx, texel) : vec4(0.0);
  imageStore(output_img, texel, color);
}