30 if (
out[5].hasoutput) {
34 const float val[4] = {0.0f, 0.0f, 0.0f, 0.0f};
46 if (
ELEM(
i, 1, 2, 4)) {
48 "vector_math_normalize",
65 NodeItem res = empty();
66 std::string
name = socket_out_->identifier;
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);
96 ntype.
ui_description =
"Retrieve geometric information about the current shading point";
99 ntype.
declare = file_ns::node_declare;
100 ntype.
gpu_fn = file_ns::node_shader_gpu_geometry;
#define SH_NODE_NEW_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,...)
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, std::string idname, const std::optional< int16_t > legacy_type)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *, GPUNodeLink **link)
NodeMaterialXFunction materialx_fn
std::string ui_description
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare