This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/shaders/compositor/compositor_flip.glsl
Omar Emara 40c45985a9 Realtime Compositor: Add basic distort nodes
This patch implements the following nodes for the realtime compositor:

- Crop node.
- Flip node.
- Lens distort node.
- Rotate node.
- Transform node.
- Translate node.

Differential Revision: https://developer.blender.org/D15231

Reviewed By: Clement Foucault
2022-08-10 10:30:27 +02:00

16 lines
406 B
GLSL

#pragma BLENDER_REQUIRE(gpu_shader_compositor_texture_utilities.glsl)
void main()
{
ivec2 texel = ivec2(gl_GlobalInvocationID.xy);
ivec2 size = texture_size(input_tx);
ivec2 flipped_texel = texel;
if (flip_x) {
flipped_texel.x = size.x - texel.x - 1;
}
if (flip_y) {
flipped_texel.y = size.y - texel.y - 1;
}
imageStore(output_img, texel, texture_load(input_tx, flipped_texel));
}