Blender V5.3
node_shader_shader_to_rgb.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "node_shader_util.hh"
10
11namespace blender {
12
14
16{
17 b.add_input<decl::Shader>("Shader"_ustr);
18 b.add_output<decl::Color>("Color"_ustr);
19 b.add_output<decl::Float>("Alpha"_ustr);
20}
21
23 bNode *node,
24 bNodeExecData * /*execdata*/,
27{
29
30 return GPU_stack_link(
31 mat, node, "node_shader_to_rgba", in, out, GPU_kernel_globals(), GPU_shading_data());
32}
33
34} // namespace nodes::node_shader_shader_to_rgb_cc
35
36/* node type definition */
38{
39 namespace file_ns = nodes::node_shader_shader_to_rgb_cc;
40
41 static bke::bNodeType ntype;
42
43 sh_node_type_base(&ntype, "ShaderNodeShaderToRGB"_ustr, SH_NODE_SHADERTORGB);
44 ntype.ui_name = "Shader to RGB";
45 ntype.ui_description =
46 "Convert rendering effect (such as light and shadow) to color. Typically used for "
47 "non-photorealistic rendering, to apply additional effects on the output of BSDFs.\nNote: "
48 "only supported in EEVEE";
49 ntype.enum_name_legacy = "SHADERTORGB";
51 ntype.declare = file_ns::node_declare;
53 ntype.gpu_fn = file_ns::node_shader_gpu_shadertorgb;
54
56}
57
58} // namespace blender
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:484
#define SH_NODE_SHADERTORGB
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_shadertorgb(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
BMesh Iterators.
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void register_node_type_sh_shadertorgb()
@ GPU_MATFLAG_SHADER_TO_RGBA
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
bool object_eevee_shader_nodes_poll(const bContext *C)
GPUNodeLink * GPU_shading_data()
GPUNodeLink * GPU_kernel_globals()
Defines a node type.
Definition BKE_node.hh:265
std::string ui_description
Definition BKE_node.hh:271
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:373
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeDeclareFunction declare
Definition BKE_node.hh:393
bool(*) add_ui_poll(const bContext *C)
Definition BKE_node.hh:341