Files
test2/source/blender/compositor/shaders/compositor_write_output.glsl
Aras Pranckevicius a401089a9d Cleanup: move compositor files out of realtime_compositor folder
By now it is just a "compositor", so move the files one folder up.
Things that were under realtime_compositor/intern move into
already existing intern folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/132004
2024-12-17 10:34:24 +01:00

28 lines
728 B
GLSL

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "gpu_shader_compositor_texture_utilities.glsl"
void main()
{
ivec2 texel = ivec2(gl_GlobalInvocationID.xy);
ivec2 output_texel = texel + lower_bound;
if (any(greaterThan(output_texel, upper_bound))) {
return;
}
vec4 input_color = texture_load(input_tx, texel);
#if defined(DIRECT_OUTPUT)
vec4 output_color = input_color;
#elif defined(OPAQUE_OUTPUT)
vec4 output_color = vec4(input_color.rgb, 1.0);
#elif defined(ALPHA_OUTPUT)
float alpha = texture_load(alpha_tx, texel).x;
vec4 output_color = vec4(input_color.rgb, alpha);
#endif
imageStore(output_img, texel + lower_bound, output_color);
}