Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_valToRgb.cc
| Show All 28 Lines | |||||
| #include "node_shader_util.h" | #include "node_shader_util.h" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void sh_node_valtorgb_declare(NodeDeclarationBuilder &b) | static void sh_node_valtorgb_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.is_function_node(); | b.is_function_node(); | ||||
| b.add_input<decl::Float>("Fac").default_value(0.5f).min(0.0f).max(1.0f).subtype(PROP_FACTOR); | b.add_input<decl::Float>(N_("Fac")).default_value(0.5f).min(0.0f).max(1.0f).subtype(PROP_FACTOR); | ||||
| b.add_output<decl::Color>("Color"); | b.add_output<decl::Color>(N_("Color")); | ||||
| b.add_output<decl::Float>("Alpha"); | b.add_output<decl::Float>(N_("Alpha")); | ||||
| }; | }; | ||||
| } // namespace blender::nodes | } // namespace blender::nodes | ||||
| static void node_shader_exec_valtorgb(void *UNUSED(data), | static void node_shader_exec_valtorgb(void *UNUSED(data), | ||||
| int UNUSED(thread), | int UNUSED(thread), | ||||
| bNode *node, | bNode *node, | ||||
| bNodeExecData *UNUSED(execdata), | bNodeExecData *UNUSED(execdata), | ||||
| ▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | void register_node_type_sh_valtorgb(void) | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void sh_node_rgbtobw_declare(NodeDeclarationBuilder &b) | static void sh_node_rgbtobw_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Color>("Color").default_value({0.5f, 0.5f, 0.5f, 1.0f}); | b.add_input<decl::Color>(N_("Color")).default_value({0.5f, 0.5f, 0.5f, 1.0f}); | ||||
| b.add_output<decl::Float>("Val"); | b.add_output<decl::Float>(N_("Val")); | ||||
| }; | }; | ||||
| } // namespace blender::nodes | } // namespace blender::nodes | ||||
| static void node_shader_exec_rgbtobw(void *UNUSED(data), | static void node_shader_exec_rgbtobw(void *UNUSED(data), | ||||
| int UNUSED(thread), | int UNUSED(thread), | ||||
| bNode *UNUSED(node), | bNode *UNUSED(node), | ||||
| bNodeExecData *UNUSED(execdata), | bNodeExecData *UNUSED(execdata), | ||||
| Show All 31 Lines | |||||