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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_channel_matte.glsl')
-rw-r--r--source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_channel_matte.glsl52
1 files changed, 0 insertions, 52 deletions
diff --git a/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_channel_matte.glsl b/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_channel_matte.glsl
deleted file mode 100644
index f2dcc9543f2..00000000000
--- a/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_channel_matte.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#pragma BLENDER_REQUIRE(gpu_shader_common_color_utils.glsl)
-
-#define CMP_NODE_CHANNEL_MATTE_CS_RGB 1.0
-#define CMP_NODE_CHANNEL_MATTE_CS_HSV 2.0
-#define CMP_NODE_CHANNEL_MATTE_CS_YUV 3.0
-#define CMP_NODE_CHANNEL_MATTE_CS_YCC 4.0
-
-void node_composite_channel_matte(vec4 color,
- const float color_space,
- const float matte_channel,
- const vec2 limit_channels,
- float max_limit,
- float min_limit,
- out vec4 result,
- out float matte)
-{
- vec4 channels;
- if (color_space == CMP_NODE_CHANNEL_MATTE_CS_HSV) {
- rgb_to_hsv(color, channels);
- }
- else if (color_space == CMP_NODE_CHANNEL_MATTE_CS_YUV) {
- rgba_to_yuva_itu_709(color, channels);
- }
- else if (color_space == CMP_NODE_CHANNEL_MATTE_CS_YCC) {
- rgba_to_ycca_itu_709(color, channels);
- }
- else {
- channels = color;
- }
-
- float matte_value = channels[int(matte_channel)];
- float limit_value = max(channels[int(limit_channels.x)], channels[int(limit_channels.y)]);
-
- float alpha = 1.0 - (matte_value - limit_value);
- if (alpha > max_limit) {
- alpha = color.a;
- }
- else if (alpha < min_limit) {
- alpha = 0.0;
- }
- else {
- alpha = (alpha - min_limit) / (max_limit - min_limit);
- }
-
- matte = min(alpha, color.a);
- result = color * matte;
-}
-
-#undef CMP_NODE_CHANNEL_MATTE_CS_RGB
-#undef CMP_NODE_CHANNEL_MATTE_CS_HSV
-#undef CMP_NODE_CHANNEL_MATTE_CS_YUV
-#undef CMP_NODE_CHANNEL_MATTE_CS_YCC