15#include "RNA_prototypes.hh"
28 b.add_input<
decl::Color>(
"Color"_ustr).default_value({0.0f, 0.0f, 0.0f, 1.0f});
29 b.add_input<
decl::Float>(
"Value"_ustr).default_value(0.0f).min(0.0f).max(1.0f);
35 if (aov_name.empty()) {
36 return ICON_RECORD_OFF;
45 return ICON_NODE_SOCKET_RGBA;
47 return ICON_NODE_SOCKET_FLOAT;
51 return ICON_RECORD_OFF;
59 if (scene && view_layer) {
61 scene->
id, RNA_ViewLayer, view_layer);
63 ptr,
"aov_name", &view_layer_rna_ptr,
"aovs",
"",
aov_icon(view_layer, ptr));
88 "GPUCodegen: AOV hash needs float and uint to be the same size.");
117 "Arbitrary Output Variables.\nProvide custom render passes for arbitrary shader node "
121 ntype.
declare = file_ns::node_declare;
122 ntype.
draw_buttons = file_ns::node_shader_buts_output_aov;
123 ntype.
initfunc = file_ns::node_shader_init_output_aov;
126 ntype.
gpu_fn = file_ns::node_shader_gpu_output_aov;
#define NODE_CLASS_OUTPUT
#define SH_NODE_OUTPUT_AOV
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
static void node_shader_init_output_aov(bNodeTree *, bNode *node)
static void node_shader_buts_output_aov(ui::Layout &layout, bContext *C, PointerRNA *ptr)
static BIFIconID aov_icon(const ViewLayer *view_layer, PointerRNA *ptr)
static int node_shader_gpu_output_aov(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
@ ITEM_R_SPLIT_EMPTY_NAME
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
BLI_STATIC_ASSERT(ARRAY_SIZE(data_mode_strings)==CTX_MODE_NUM+1, "Must have a string for each context mode") const char *CTX_data_mode_string(const bContext *C)
@ GPU_MATFLAG_OBJECT_INFO
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
ViewLayer * CTX_data_view_layer(const bContext *C)
GPUNodeLink * GPU_constant(const float *num)
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
GPUNodeLink * GPU_shading_data()
void GPU_material_add_output_link_aov(GPUMaterial *material, GPUNodeLink *link, int hash)
void register_node_type_sh_output_aov()
BLI_INLINE unsigned int BLI_hash_string(const char *str)
PointerRNA RNA_pointer_create_id_subdata(ID &id, StructRNA *type, void *data)
GPUNodeLink * GPU_kernel_globals()
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
Scene * CTX_data_scene(const bContext *C)
void node_free_standard_storage(bNode *node)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
ListBaseT< ViewLayerAOV > aovs
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGPUExecFunction gpu_fn
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare
void prop_search(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop, PropertyRNA *item_searchpropname, std::optional< StringRefNull > name, int icon, bool results_are_suggestions)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)