Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c
| Show All 35 Lines | static bNodeSocketTemplate sh_node_bsdf_velvet_in[] = { | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_bsdf_velvet_out[] = { | static bNodeSocketTemplate sh_node_bsdf_velvet_out[] = { | ||||
| { SOCK_SHADER, 0, N_("BSDF")}, | { SOCK_SHADER, 0, N_("BSDF")}, | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static int node_shader_gpu_bsdf_velvet(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int node_shader_gpu_bsdf_velvet(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| if (!in[2].link) | if (!in[2].link) | ||||
| GPU_link(mat, "world_normals_get", &in[2].link); | GPU_link(mat, "world_normals_get", &in[2].link); | ||||
| return GPU_stack_link(mat, "node_bsdf_velvet", in, out); | return GPU_stack_link(mat, node, "node_bsdf_velvet", in, out); | ||||
| } | } | ||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_bsdf_velvet(void) | void register_node_type_sh_bsdf_velvet(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_BSDF_VELVET, "Velvet BSDF", NODE_CLASS_SHADER, 0); | sh_node_type_base(&ntype, SH_NODE_BSDF_VELVET, "Velvet BSDF", NODE_CLASS_SHADER, 0); | ||||
| node_type_compatibility(&ntype, NODE_NEW_SHADING); | node_type_compatibility(&ntype, NODE_NEW_SHADING); | ||||
| node_type_socket_templates(&ntype, sh_node_bsdf_velvet_in, sh_node_bsdf_velvet_out); | node_type_socket_templates(&ntype, sh_node_bsdf_velvet_in, sh_node_bsdf_velvet_out); | ||||
| node_type_init(&ntype, NULL); | node_type_init(&ntype, NULL); | ||||
| node_type_storage(&ntype, "", NULL, NULL); | node_type_storage(&ntype, "", NULL, NULL); | ||||
| node_type_gpu(&ntype, node_shader_gpu_bsdf_velvet); | node_type_gpu(&ntype, node_shader_gpu_bsdf_velvet); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||