30 if (out[5].hasoutput) {
34 const float val[4] = {0.0f, 0.0f, 0.0f, 0.0f};
37 const bool success =
GPU_stack_link(mat, node,
"node_geometry", in, out, orco_link);
46 if (
ELEM(i, 1, 2, 4)) {
48 "vector_math_normalize",
65 NodeItem res = empty();
66 std::string name = socket_out_->name;
68 if (name ==
"Position") {
69 res = create_node(
"position", NodeItem::Type::Vector3, {{
"space", val(std::string(
"world"))}});
71 else if (name ==
"Normal") {
72 res = create_node(
"normal", NodeItem::Type::Vector3, {{
"space", val(std::string(
"world"))}});
74 else if (
ELEM(name,
"Tangent",
"True Normal")) {
75 res = create_node(
"tangent", NodeItem::Type::Vector3, {{
"space", val(std::string(
"world"))}});
78 res = get_output_default(name, NodeItem::Type::Any);
95 ntype.
declare = file_ns::node_declare;
96 ntype.
gpu_fn = file_ns::node_shader_gpu_geometry;
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
@ GPU_MATFLAG_BARYCENTRIC
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
GPUNodeLink * GPU_attribute(GPUMaterial *mat, eCustomDataType type, const char *name)
bool GPU_link(GPUMaterial *mat, const char *name,...)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_geometry(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_geometry()
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *, GPUNodeLink **link)
NodeMaterialXFunction materialx_fn
NodeGPUExecFunction gpu_fn
NodeDeclareFunction declare