31 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
32 .compositor_domain_priority(0);
39 .default_value({1.0f, 1.0f, 1.0f, 1.0f})
40 .compositor_domain_priority(1);
90 const float z_combine_factor =
float(first_z_value < second_z_value);
91 const float alpha_factor =
use_alpha() ? first_color.w : 1.0f;
92 const float mix_factor = z_combine_factor * alpha_factor;
98 combined_color.w =
use_alpha() ?
math::max(second_color.w, first_color.w) : combined_color.w;
106 const float combined_z_value =
math::interpolate(second_z_value, first_z_value, mix_factor);
165 mask.bind_as_texture(shader,
"mask_tx");
182 mask.unbind_as_texture();
203 mask.bind_as_image(shader,
"mask_img");
209 mask.unbind_as_image();
216 return anti_aliased_mask;
244 ntype.
declare = file_ns::cmp_node_zcombine_declare;
245 ntype.
draw_buttons = file_ns::node_composit_buts_zcombine;
#define NODE_CLASS_OP_COLOR
void GPU_shader_bind(GPUShader *shader)
void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
struct GPUShader GPUShader
int compositor_domain_priority() const
void execute_anti_aliased()
void execute_single_value()
GPUShader * get_shader(const char *info_name, ResultPrecision precision)
Result create_result(ResultType type, ResultPrecision precision)
NodeOperation(Context &context, DNode node)
const bNode & bnode() const
Result & get_input(StringRef identifier) const
Result & get_result(StringRef identifier)
Context & context() const
virtual Domain compute_domain()
float get_float_value() const
void bind_as_image(GPUShader *shader, const char *image_name, bool read=false) const
void unbind_as_texture() const
float4 get_color_value() const
void unbind_as_image() const
void set_float_value(float value)
void allocate_texture(Domain domain, bool from_pool=true)
void set_color_value(const float4 &value)
void bind_as_texture(GPUShader *shader, const char *texture_name) const
void allocate_single_value()
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
void node_register_type(bNodeType *ntype)
T interpolate(const T &a, const T &b, const FactorT &t)
T max(const T &a, const T &b)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void node_composit_buts_zcombine(uiLayout *layout, bContext *, PointerRNA *ptr)
static void cmp_node_zcombine_declare(NodeDeclarationBuilder &b)
void smaa(Context &context, Result &input, Result &output, float threshold=0.1f, float local_contrast_adaptation_factor=2.0f, int corner_rounding=25)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
VecBase< int32_t, 2 > int2
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_cmp_zcombine()
NodeGetCompositorOperationFunction get_compositor_operation
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare