16 b.add_input<
decl::Color>(
"Color").default_value({1.0f, 1.0f, 1.0f, 1.0f});
17 b.add_input<
decl::Float>(
"Distance").default_value(1.0f).min(0.0f).max(1000.0f);
37 GPU_link(mat,
"world_normals_get", &
in[2].link);
47 "node_ambient_occlusion",
72 return get_output_default(socket_out_->identifier, NodeItem::Type::Any);
87 ntype.
ui_name =
"Ambient Occlusion";
89 "Compute how much the hemisphere above the shading point is occluded, for example to add "
90 "weathering effects to corners.\nNote: For Cycles, this may slow down renders significantly";
93 ntype.
declare = file_ns::node_declare;
94 ntype.
draw_buttons = file_ns::node_shader_buts_ambient_occlusion;
95 ntype.
initfunc = file_ns::node_shader_init_ambient_occlusion;
96 ntype.
gpu_fn = file_ns::node_shader_gpu_ambient_occlusion;
#define SH_NODE_AMBIENT_OCCLUSION
MINLINE uint divide_ceil_u(uint a, uint b)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
bool GPU_link(GPUMaterial *mat, const char *name,...)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void node_register_type(bNodeType &ntype)
static void node_shader_init_ambient_occlusion(bNodeTree *, bNode *node)
static void node_shader_buts_ambient_occlusion(uiLayout *layout, bContext *, PointerRNA *ptr)
static int node_shader_gpu_ambient_occlusion(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_ambient_occlusion()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
NodeMaterialXFunction materialx_fn
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)