22 return "compositor_morphological_distance_feather_dilate";
24 return "compositor_morphological_distance_feather_erode";
32 input.bind_as_texture(shader,
"input_tx");
35 context.cache_manager().morphological_distance_feather_weights.get(
36 context, falloff_type,
math::abs(distance));
48 const Domain domain = input.domain();
49 const int2 transposed_domain =
int2(domain.size.y, domain.size.x);
53 output.bind_as_image(shader,
"output_img");
58 input.unbind_as_texture();
61 output.unbind_as_image();
68 Result &horizontal_pass_result,
79 context.cache_manager().morphological_distance_feather_weights.get(
80 context, falloff_type,
math::abs(distance));
85 output.allocate_texture(domain);
86 output.bind_as_image(shader,
"output_img");
96 output.unbind_as_image();
103 vertical_pass(context, input, horizontal_pass_result, output, distance, falloff_type);
104 horizontal_pass_result.
release();
void GPU_shader_bind(GPUShader *shader)
struct GPUShader GPUShader
void unbind_distance_falloffs_as_texture() const
void bind_distance_falloffs_as_texture(GPUShader *shader, const char *texture_name) const
void unbind_weights_as_texture() const
void bind_weights_as_texture(GPUShader *shader, const char *texture_name) const
void unbind_as_texture() const
const Domain & domain() const
void allocate_texture(Domain domain, bool from_pool=true)
void bind_as_texture(GPUShader *shader, const char *texture_name) const
static const char * get_shader_name(int distance)
static void vertical_pass(Context &context, Result &original_input, Result &horizontal_pass_result, Result &output, int distance, int falloff_type)
static Result horizontal_pass(Context &context, Result &input, int distance, int falloff_type)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
void morphological_distance_feather(Context &context, Result &input, Result &output, int distance, int falloff_type=PROP_SMOOTH)
VecBase< int32_t, 2 > int2