2023-08-24 10:54:59 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
|
2024-10-04 15:48:22 +02:00
|
|
|
#include "gpu_shader_compositor_texture_utilities.glsl"
|
2022-08-10 09:40:07 +02:00
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
ivec2 texel = ivec2(gl_GlobalInvocationID.xy);
|
2023-12-03 23:20:44 +01:00
|
|
|
ivec2 output_size = imageSize(output_img);
|
2022-08-10 09:40:07 +02:00
|
|
|
#if defined(SPLIT_HORIZONTAL)
|
2023-12-07 18:10:42 +01:00
|
|
|
bool condition = (output_size.x * split_ratio) <= texel.x;
|
2022-08-10 09:40:07 +02:00
|
|
|
#elif defined(SPLIT_VERTICAL)
|
2023-12-07 18:10:42 +01:00
|
|
|
bool condition = (output_size.y * split_ratio) <= texel.y;
|
2022-08-10 09:40:07 +02:00
|
|
|
#endif
|
|
|
|
|
vec4 color = condition ? texture_load(first_image_tx, texel) :
|
|
|
|
|
texture_load(second_image_tx, texel);
|
2023-12-03 23:20:44 +01:00
|
|
|
imageStore(output_img, texel, color);
|
2022-08-10 09:40:07 +02:00
|
|
|
}
|