Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_rgb.cc
| Show All 18 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup shdnodes | * \ingroup shdnodes | ||||
| */ | */ | ||||
| #include "node_shader_util.hh" | #include "node_shader_util.hh" | ||||
| /* **************** RGB ******************** */ | /* **************** RGB ******************** */ | ||||
| namespace blender::nodes::node_shader_rgb_cc { | |||||
| static bNodeSocketTemplate sh_node_rgb_out[] = { | static bNodeSocketTemplate sh_node_rgb_out[] = { | ||||
| {SOCK_RGBA, N_("Color"), 0.5f, 0.5f, 0.5f, 1.0f}, | {SOCK_RGBA, N_("Color"), 0.5f, 0.5f, 0.5f, 1.0f}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static int gpu_shader_rgb(GPUMaterial *mat, | static int gpu_shader_rgb(GPUMaterial *mat, | ||||
| bNode *node, | bNode *node, | ||||
| bNodeExecData *UNUSED(execdata), | bNodeExecData *UNUSED(execdata), | ||||
| GPUNodeStack *in, | GPUNodeStack *in, | ||||
| GPUNodeStack *out) | GPUNodeStack *out) | ||||
| { | { | ||||
| GPUNodeLink *link = GPU_uniformbuf_link_out(mat, node, out, 0); | GPUNodeLink *link = GPU_uniformbuf_link_out(mat, node, out, 0); | ||||
| return GPU_stack_link(mat, node, "set_rgba", in, out, link); | return GPU_stack_link(mat, node, "set_rgba", in, out, link); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_rgb_cc | |||||
| void register_node_type_sh_rgb() | void register_node_type_sh_rgb() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_rgb_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT, 0); | sh_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT, 0); | ||||
| node_type_socket_templates(&ntype, nullptr, sh_node_rgb_out); | node_type_socket_templates(&ntype, nullptr, file_ns::sh_node_rgb_out); | ||||
| node_type_gpu(&ntype, gpu_shader_rgb); | node_type_gpu(&ntype, file_ns::gpu_shader_rgb); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||