Blender V5.0
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
5#include "node_shader_util.hh"
6
8
10{
11 b.add_input<decl::Shader>("Shader");
12 b.add_output<decl::Color>("Color");
13 b.add_output<decl::Float>("Alpha");
14}
15
17 bNode *node,
18 bNodeExecData * /*execdata*/,
21{
23
24 return GPU_stack_link(mat, node, "node_shader_to_rgba", in, out);
25}
26
27} // namespace blender::nodes::node_shader_shader_to_rgb_cc
28
29/* node type definition */
31{
33
34 static blender::bke::bNodeType ntype;
35
36 sh_node_type_base(&ntype, "ShaderNodeShaderToRGB", SH_NODE_SHADERTORGB);
37 ntype.ui_name = "Shader to RGB";
38 ntype.ui_description =
39 "Convert rendering effect (such as light and shadow) to color. Typically used for "
40 "non-photorealistic rendering, to apply additional effects on the output of BSDFs.\nNote: "
41 "only supported in EEVEE";
42 ntype.enum_name_legacy = "SHADERTORGB";
44 ntype.declare = file_ns::node_declare;
46 ntype.gpu_fn = file_ns::node_shader_gpu_shadertorgb;
47
49}
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:453
#define SH_NODE_SHADERTORGB
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ GPU_MATFLAG_SHADER_TO_RGBA
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
#define in
#define out
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_shadertorgb(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
void register_node_type_sh_shadertorgb()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
bool object_eevee_shader_nodes_poll(const bContext *C)
Defines a node type.
Definition BKE_node.hh:238
std::string ui_description
Definition BKE_node.hh:244
bool(* add_ui_poll)(const bContext *C)
Definition BKE_node.hh:310
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:342
const char * enum_name_legacy
Definition BKE_node.hh:247
NodeDeclareFunction declare
Definition BKE_node.hh:362