29 b.add_input<
decl::Color>(
"Image").default_value({0.0f, 0.0f, 0.0f, 1.0f});
30 b.add_input<
decl::Float>(
"Alpha").default_value(1.0f).min(0.0f).max(1.0f);
46 if (!
context().is_valid_compositing_region()) {
58 else if (!
node().input_by_identifier(
"Alpha")->is_logically_linked()) {
77 else if (
node().input_by_identifier(
"Alpha")->is_logically_linked()) {
83 if (this->
context().use_gpu()) {
115 image.bind_as_texture(shader,
"input_tx");
117 output.bind_as_image(shader,
"output_img");
121 image.unbind_as_texture();
134 const int2 output_texel = texel + bounds.min;
135 if (output_texel.x > bounds.max.x || output_texel.y > bounds.max.y) {
167 image.bind_as_texture(shader,
"input_tx");
169 output.bind_as_image(shader,
"output_img");
173 image.unbind_as_texture();
186 const int2 output_texel = texel + bounds.min;
187 if (output_texel.x > bounds.max.x || output_texel.y > bounds.max.y) {
218 image.bind_as_texture(shader,
"input_tx");
223 output.bind_as_image(shader,
"output_img");
227 image.unbind_as_texture();
242 const int2 output_texel = texel + bounds.min;
243 if (output_texel.x > bounds.max.x || output_texel.y > bounds.max.y) {
255 const rcti compositing_region =
context().get_compositing_region();
257 int2(compositing_region.
xmax, compositing_region.
ymax));
290 ntype.
declare = file_ns::cmp_node_composite_declare;
291 ntype.
draw_buttons = file_ns::node_composit_buts_composite;
#define NODE_CLASS_OUTPUT
#define CMP_NODE_COMPOSITE
@ CMP_NODE_OUTPUT_IGNORE_ALPHA
void GPU_shader_uniform_2iv(GPUShader *sh, const char *name, const int data[2])
void GPU_shader_bind(GPUShader *shader)
void GPU_texture_clear(GPUTexture *texture, eGPUDataFormat data_format, const void *data)
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
NodeOperation(Context &context, DNode node)
void execute_set_alpha_cpu()
void execute_ignore_alpha_gpu()
void execute_ignore_alpha_cpu()
void execute_ignore_alpha()
Domain compute_domain() override
void execute_set_alpha_gpu()
Bounds< int2 > get_output_bounds()
GPUShader * get_shader(const char *info_name, ResultPrecision precision)
virtual Result get_output_result()=0
NodeOperation(Context &context, DNode node)
const bNode & bnode() const
const DNode & node() const
Result & get_input(StringRef identifier) const
Context & context() const
float get_float_value() const
float4 load_pixel(const int2 &texel) const
void unbind_as_texture() const
bool is_single_value() const
void bind_as_texture(GPUShader *shader, const char *texture_name) const
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void cmp_node_composite_declare(NodeDeclarationBuilder &b)
static void node_composit_buts_composite(uiLayout *layout, bContext *, PointerRNA *ptr)
void parallel_for(const int2 range, FunctionRef< void(int2)> function)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
void register_node_type_cmp_composite()
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
NodeGetCompositorOperationFunction get_compositor_operation
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
static pxr::UsdShadeInput get_input(const pxr::UsdShadeShader &usd_shader, const pxr::TfToken &input_name)