12 "Distance to displace the surface along the normal");
18 "Neutral displacement value that causes no displacement.\n"
19 "Lower values cause the surface to move inwards, "
20 "higher values push the surface outwards");
22 "Increase or decrease the amount of displacement");
39 GPU_link(mat,
"world_normals_get", &in[3].link);
43 return GPU_stack_link(mat, node,
"node_displacement_object", in, out);
46 return GPU_stack_link(mat, node,
"node_displacement_world", in, out);
53 NodeItem midlevel = get_input_value(
"Midlevel", NodeItem::Type::Float);
54 NodeItem height = get_input_value(
"Height", NodeItem::Type::Float) - midlevel;
55 NodeItem scale = get_input_value(
"Scale", NodeItem::Type::Float);
57 return create_node(
"displacement",
58 NodeItem::Type::DisplacementShader,
59 {{
"displacement", height}, {
"scale", scale}});
74 ntype.
declare = file_ns::node_declare;
75 ntype.
initfunc = file_ns::node_shader_init_displacement;
76 ntype.
gpu_fn = file_ns::gpu_shader_displacement;
#define NODE_CLASS_OP_VECTOR
#define SH_NODE_DISPLACEMENT
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
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 gpu_shader_displacement(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_shader_init_displacement(bNodeTree *, bNode *node)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_displacement()
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
NodeMaterialXFunction materialx_fn
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeDeclareFunction declare