Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_eevee_metallic.c
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | static bNodeSocketTemplate sh_node_eevee_metallic_in[] = { | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_eevee_metallic_out[] = { | static bNodeSocketTemplate sh_node_eevee_metallic_out[] = { | ||||
| { SOCK_SHADER, 0, N_("BSDF")}, | { SOCK_SHADER, 0, N_("BSDF")}, | ||||
| { -1, 0, "" } | { -1, 0, "" } | ||||
| }; | }; | ||||
| static int node_shader_gpu_eevee_metallic(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) | static int node_shader_gpu_eevee_metallic(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, 0); | |||||
| /* Metallic */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, 1); | |||||
| /* Specular */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, 2); | |||||
| /* Roughness */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, 3); | |||||
| /* Emissive Color */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, 4); | |||||
| /* Transparency */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, 5); | |||||
| /* Normals */ | /* Normals */ | ||||
| if (!in[6].link) { | if (!in[6].link) { | ||||
| GPU_link(mat, "world_normals_get", &in[6].link); | GPU_link(mat, "world_normals_get", &in[6].link); | ||||
| } | } | ||||
| /* Clear Cloat */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, 7); | |||||
| /* Clear Cloat Roughness */ | |||||
| GPU_uniformbuffer_link_in(mat, &node->inputs, in, 8); | |||||
| /* Clearcoat Normals */ | /* Clearcoat Normals */ | ||||
| if (!in[9].link) { | if (!in[9].link) { | ||||
| GPU_link(mat, "world_normals_get", &in[9].link); | GPU_link(mat, "world_normals_get", &in[9].link); | ||||
| } | } | ||||
| /* Occlusion */ | /* Occlusion */ | ||||
| if (!in[10].link) { | if (!in[10].link) { | ||||
| GPU_link(mat, "set_value", GPU_uniform(&one), &in[10].link); | GPU_link(mat, "set_value", GPU_uniform(&one), &in[10].link); | ||||
| Show All 20 Lines | |||||