16 .default_value({0.0f, 0.0f, 1.0f})
21 "Normal direction vector.\n"
22 "\u2022 LMB click and drag on the sphere to set the direction of the normal.\n"
23 "\u2022 Holding Ctrl while dragging snaps to 45 degree rotation increments");
25 .default_value({0.0f, 0.0f, 1.0f})
39 return GPU_stack_link(mat, node,
"normal_new_shading", in, out, vec);
45 NodeItem res = get_output_default(
"Normal", NodeItem::Type::Vector3);
47 if (
STREQ(socket_out_->name,
"Dot")) {
48 return res.dotproduct(get_input_value(
"Normal", NodeItem::Type::Vector3));
65 ntype.
declare = file_ns::node_declare;
66 ntype.
gpu_fn = file_ns::gpu_shader_normal;
#define NODE_CLASS_OP_VECTOR
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_uniform(const float *num)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
static void node_declare(NodeDeclarationBuilder &b)
static int gpu_shader_normal(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_normal()
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
NodeMaterialXFunction materialx_fn
NodeGPUExecFunction gpu_fn
NodeDeclareFunction declare