Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c
| Show All 36 Lines | static bNodeSocketTemplate sh_node_bsdf_toon_in[] = { | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_bsdf_toon_out[] = { | static bNodeSocketTemplate sh_node_bsdf_toon_out[] = { | ||||
| { SOCK_SHADER, 0, N_("BSDF")}, | { SOCK_SHADER, 0, N_("BSDF")}, | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static int node_shader_gpu_bsdf_toon(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int node_shader_gpu_bsdf_toon(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| /* Color */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_VEC4, 0); | |||||
| /* Size */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 1); | |||||
| /* Smooth */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 2); | |||||
| if (!in[3].link) | if (!in[3].link) | ||||
| in[3].link = GPU_builtin(GPU_VIEW_NORMAL); | in[3].link = GPU_builtin(GPU_VIEW_NORMAL); | ||||
| else | else | ||||
| GPU_link(mat, "direction_transform_m4v3", in[3].link, GPU_builtin(GPU_VIEW_MATRIX), &in[3].link); | GPU_link(mat, "direction_transform_m4v3", in[3].link, GPU_builtin(GPU_VIEW_MATRIX), &in[3].link); | ||||
| return GPU_stack_link(mat, "node_bsdf_toon", in, out); | return GPU_stack_link(mat, "node_bsdf_toon", in, out); | ||||
| } | } | ||||
| Show All 15 Lines | |||||