Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_eevee_specular.cc
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2005 Blender Foundation. | * The Original Code is Copyright (C) 2005 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| #include "node_shader_util.hh" | #include "node_shader_util.hh" | ||||
| /* **************** OUTPUT ******************** */ | /* **************** OUTPUT ******************** */ | ||||
| namespace blender::nodes::node_shader_eevee_specular_cc { | |||||
| static bNodeSocketTemplate sh_node_eevee_specular_in[] = { | static bNodeSocketTemplate sh_node_eevee_specular_in[] = { | ||||
| {SOCK_RGBA, N_("Base Color"), 0.8f, 0.8f, 0.8f, 1.0f}, | {SOCK_RGBA, N_("Base Color"), 0.8f, 0.8f, 0.8f, 1.0f}, | ||||
| {SOCK_RGBA, N_("Specular"), 0.03f, 0.03f, 0.03f, 1.0f}, | {SOCK_RGBA, N_("Specular"), 0.03f, 0.03f, 0.03f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Roughness"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | {SOCK_FLOAT, N_("Roughness"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | ||||
| {SOCK_RGBA, N_("Emissive Color"), 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_RGBA, N_("Emissive Color"), 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Transparency"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | {SOCK_FLOAT, N_("Transparency"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | ||||
| {SOCK_VECTOR, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, | {SOCK_VECTOR, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, | ||||
| {SOCK_FLOAT, N_("Clear Coat"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | {SOCK_FLOAT, N_("Clear Coat"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | if (!in[9].link) { | ||||
| GPU_link(mat, "set_value", GPU_constant(&one), &in[9].link); | GPU_link(mat, "set_value", GPU_constant(&one), &in[9].link); | ||||
| } | } | ||||
| GPU_material_flag_set(mat, (eGPUMatFlag)(GPU_MATFLAG_DIFFUSE | GPU_MATFLAG_GLOSSY)); | GPU_material_flag_set(mat, (eGPUMatFlag)(GPU_MATFLAG_DIFFUSE | GPU_MATFLAG_GLOSSY)); | ||||
| return GPU_stack_link(mat, node, "node_eevee_specular", in, out, GPU_constant(&node->ssr_id)); | return GPU_stack_link(mat, node, "node_eevee_specular", in, out, GPU_constant(&node->ssr_id)); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_eevee_specular_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_eevee_specular(void) | void register_node_type_sh_eevee_specular(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_eevee_specular_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_EEVEE_SPECULAR, "Specular BSDF", NODE_CLASS_SHADER, 0); | sh_node_type_base(&ntype, SH_NODE_EEVEE_SPECULAR, "Specular BSDF", NODE_CLASS_SHADER, 0); | ||||
| node_type_socket_templates(&ntype, sh_node_eevee_specular_in, sh_node_eevee_specular_out); | node_type_socket_templates( | ||||
| &ntype, file_ns::sh_node_eevee_specular_in, file_ns::sh_node_eevee_specular_out); | |||||
| node_type_init(&ntype, nullptr); | node_type_init(&ntype, nullptr); | ||||
| node_type_storage(&ntype, "", nullptr, nullptr); | node_type_storage(&ntype, "", nullptr, nullptr); | ||||
| node_type_gpu(&ntype, node_shader_gpu_eevee_specular); | node_type_gpu(&ntype, file_ns::node_shader_gpu_eevee_specular); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||