Differential D13480 Diff 45666 source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2018 Blender Foundation. | * The Original Code is Copyright (C) 2018 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_hair_principled_cc { | |||||
| /* Color, melanin and absorption coefficient default to approximately same brownish hair. */ | /* Color, melanin and absorption coefficient default to approximately same brownish hair. */ | ||||
| static bNodeSocketTemplate sh_node_bsdf_hair_principled_in[] = { | static bNodeSocketTemplate sh_node_bsdf_hair_principled_in[] = { | ||||
| {SOCK_RGBA, N_("Color"), 0.017513f, 0.005763f, 0.002059f, 1.0f, 0.0f, 1.0f}, | {SOCK_RGBA, N_("Color"), 0.017513f, 0.005763f, 0.002059f, 1.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Melanin"), 0.8f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | {SOCK_FLOAT, N_("Melanin"), 0.8f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | ||||
| {SOCK_FLOAT, N_("Melanin Redness"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | {SOCK_FLOAT, N_("Melanin Redness"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | ||||
| {SOCK_RGBA, N_("Tint"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f}, | {SOCK_RGBA, N_("Tint"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f}, | ||||
| {SOCK_VECTOR, N_("Absorption Coefficient"), 0.245531f, 0.52f, 1.365f, 0.0f, 0.0f, 1000.0f}, | {SOCK_VECTOR, N_("Absorption Coefficient"), 0.245531f, 0.52f, 1.365f, 0.0f, 0.0f, 1000.0f}, | ||||
| {SOCK_FLOAT, N_("Roughness"), 0.3f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | {SOCK_FLOAT, N_("Roughness"), 0.3f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) { | ||||
| } | } | ||||
| else if (STREQ(sock->name, "Random Color")) { | else if (STREQ(sock->name, "Random Color")) { | ||||
| nodeSetSocketAvailability( | nodeSetSocketAvailability( | ||||
| ntree, sock, parametrization == SHD_PRINCIPLED_HAIR_PIGMENT_CONCENTRATION); | ntree, sock, parametrization == SHD_PRINCIPLED_HAIR_PIGMENT_CONCENTRATION); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_bsdf_hair_principled_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_bsdf_hair_principled(void) | void register_node_type_sh_bsdf_hair_principled(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_bsdf_hair_principled_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base( | sh_node_type_base( | ||||
| &ntype, SH_NODE_BSDF_HAIR_PRINCIPLED, "Principled Hair BSDF", NODE_CLASS_SHADER, 0); | &ntype, SH_NODE_BSDF_HAIR_PRINCIPLED, "Principled Hair BSDF", NODE_CLASS_SHADER, 0); | ||||
| node_type_socket_templates( | node_type_socket_templates( | ||||
| &ntype, sh_node_bsdf_hair_principled_in, sh_node_bsdf_hair_principled_out); | &ntype, file_ns::sh_node_bsdf_hair_principled_in, file_ns::sh_node_bsdf_hair_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_hair_principled); | node_type_init(&ntype, file_ns::node_shader_init_hair_principled); | ||||
| node_type_storage(&ntype, "", nullptr, nullptr); | node_type_storage(&ntype, "", nullptr, nullptr); | ||||
| node_type_update(&ntype, node_shader_update_hair_principled); | node_type_update(&ntype, file_ns::node_shader_update_hair_principled); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||