Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_bsdf_principled.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_bsdf_principled_cc { | |||||
| static bNodeSocketTemplate sh_node_bsdf_principled_in[] = { | static bNodeSocketTemplate sh_node_bsdf_principled_in[] = { | ||||
| {SOCK_RGBA, N_("Base Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, | {SOCK_RGBA, N_("Base Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Subsurface"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | {SOCK_FLOAT, N_("Subsurface"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | ||||
| {SOCK_VECTOR, | {SOCK_VECTOR, | ||||
| N_("Subsurface Radius"), | N_("Subsurface Radius"), | ||||
| 1.0f, | 1.0f, | ||||
| 0.2f, | 0.2f, | ||||
| 0.1f, | 0.1f, | ||||
| ▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { | ||||
| } | } | ||||
| if (STR_ELEM(sock->name, "Subsurface IOR", "Subsurface Anisotropy")) { | if (STR_ELEM(sock->name, "Subsurface IOR", "Subsurface Anisotropy")) { | ||||
| nodeSetSocketAvailability(ntree, sock, sss_method != SHD_SUBSURFACE_BURLEY); | nodeSetSocketAvailability(ntree, sock, sss_method != SHD_SUBSURFACE_BURLEY); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_bsdf_principled_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_bsdf_principled(void) | void register_node_type_sh_bsdf_principled(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_bsdf_principled_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_BSDF_PRINCIPLED, "Principled BSDF", NODE_CLASS_SHADER, 0); | sh_node_type_base(&ntype, SH_NODE_BSDF_PRINCIPLED, "Principled BSDF", NODE_CLASS_SHADER, 0); | ||||
| node_type_socket_templates(&ntype, sh_node_bsdf_principled_in, sh_node_bsdf_principled_out); | node_type_socket_templates( | ||||
| &ntype, file_ns::sh_node_bsdf_principled_in, file_ns::sh_node_bsdf_principled_out); | |||||
| node_type_size_preset(&ntype, NODE_SIZE_LARGE); | node_type_size_preset(&ntype, NODE_SIZE_LARGE); | ||||
| node_type_init(&ntype, node_shader_init_principled); | node_type_init(&ntype, file_ns::node_shader_init_principled); | ||||
| node_type_storage(&ntype, "", nullptr, nullptr); | node_type_storage(&ntype, "", nullptr, nullptr); | ||||
| node_type_gpu(&ntype, node_shader_gpu_bsdf_principled); | node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_principled); | ||||
| node_type_update(&ntype, node_shader_update_principled); | node_type_update(&ntype, file_ns::node_shader_update_principled); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||