Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_eevee_specular.c
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | static bNodeSocketTemplate sh_node_eevee_specular_in[] = { | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_eevee_specular_out[] = { | static bNodeSocketTemplate sh_node_eevee_specular_out[] = { | ||||
| { SOCK_SHADER, 0, N_("BSDF")}, | { SOCK_SHADER, 0, N_("BSDF")}, | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static int node_shader_gpu_eevee_specular(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int node_shader_gpu_eevee_specular(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| static float one = 1.0f; | static float one = 1.0f; | ||||
| /* Base Color */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_VEC4, 0); | |||||
| /* Specular */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_VEC4, 1); | |||||
| /* Roughness */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 2); | |||||
| /* Emissive Color */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_VEC4, 3); | |||||
| /* Transparency */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 4); | |||||
| /* Normals */ | /* Normals */ | ||||
| if (!in[5].link) { | if (!in[5].link) { | ||||
| GPU_link(mat, "world_normals_get", &in[5].link); | GPU_link(mat, "world_normals_get", &in[5].link); | ||||
| } | } | ||||
| /* Clear Coat */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 6); | |||||
| /* Clear Coat Roughness */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, GPU_FLOAT, 7); | |||||
| /* Clearcoat Normals */ | /* Clearcoat Normals */ | ||||
| if (!in[8].link) { | if (!in[8].link) { | ||||
| GPU_link(mat, "world_normals_get", &in[8].link); | GPU_link(mat, "world_normals_get", &in[8].link); | ||||
| } | } | ||||
| /* Occlusion */ | /* Occlusion */ | ||||
| if (!in[9].link) { | if (!in[9].link) { | ||||
| GPU_link(mat, "set_value", GPU_uniform(&one), &in[9].link); | GPU_link(mat, "set_value", GPU_uniform(&one), &in[9].link); | ||||
| Show All 20 Lines | |||||