Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[] = { | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static void node_shader_init_anisotropic(bNodeTree *UNUSED(ntree), bNode *node) | static void node_shader_init_anisotropic(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->custom1 = SHD_GLOSSY_GGX; | 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 *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| /* Color */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_VEC4, 0); | |||||
| /* Roughness */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 1); | |||||
| /* Anisotropy */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 2); | |||||
| /* Rotation */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 3); | |||||
| if (!in[4].link) | if (!in[4].link) | ||||
| GPU_link(mat, "world_normals_get", &in[4].link); | GPU_link(mat, "world_normals_get", &in[4].link); | ||||
| 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) | ||||
| Show All 13 Lines | |||||