Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c
| Show All 38 Lines | static bNodeSocketTemplate sh_node_bsdf_anisotropic_in[] = { | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[] = { | static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[] = { | ||||
| { SOCK_SHADER, 0, N_("BSDF")}, | { SOCK_SHADER, 0, N_("BSDF")}, | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static void node_shader_init_anisotropic(bNodeTree *UNUSED(ntree), bNode *node) | |||||
| { | |||||
| node->custom1 = SHD_GLOSSY_GGX; | |||||
| } | |||||
| static int node_shader_gpu_bsdf_anisotropic(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int node_shader_gpu_bsdf_anisotropic(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| if (!in[3].link) | if (!in[3].link) | ||||
| in[3].link = GPU_builtin(GPU_VIEW_NORMAL); | in[3].link = GPU_builtin(GPU_VIEW_NORMAL); | ||||
| return GPU_stack_link(mat, "node_bsdf_anisotropic", in, out); | return GPU_stack_link(mat, "node_bsdf_anisotropic", in, out); | ||||
| } | } | ||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_bsdf_anisotropic(void) | void register_node_type_sh_bsdf_anisotropic(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_BSDF_ANISOTROPIC, "Anisotropic BSDF", NODE_CLASS_SHADER, 0); | sh_node_type_base(&ntype, SH_NODE_BSDF_ANISOTROPIC, "Anisotropic 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_anisotropic_in, sh_node_bsdf_anisotropic_out); | node_type_socket_templates(&ntype, sh_node_bsdf_anisotropic_in, sh_node_bsdf_anisotropic_out); | ||||
| node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); | node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); | ||||
| node_type_init(&ntype, NULL); | node_type_init(&ntype, node_shader_init_anisotropic); | ||||
| node_type_storage(&ntype, "", NULL, NULL); | node_type_storage(&ntype, "", NULL, NULL); | ||||
| node_type_gpu(&ntype, node_shader_gpu_bsdf_anisotropic); | node_type_gpu(&ntype, node_shader_gpu_bsdf_anisotropic); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||