Blender V5.0
node_shader_background.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::Color>("Color")
12 .default_value({0.8f, 0.8f, 0.8f, 1.0f})
13 .description("Color of the emitted light");
14 b.add_input<decl::Float>("Strength")
15 .default_value(1.0f)
16 .min(0.0f)
17 .max(1000000.0f)
18 .description("Strength of the emitted light")
19 .translation_context(BLT_I18NCONTEXT_AMOUNT);
20 b.add_input<decl::Float>("Weight").available(false);
21 b.add_output<decl::Shader>("Background");
22}
23
25 bNode *node,
26 bNodeExecData * /*execdata*/,
29{
30 return GPU_stack_link(mat, node, "node_background", in, out);
31}
32
33} // namespace blender::nodes::node_shader_background_cc
34
35/* node type definition */
37{
39
40 static blender::bke::bNodeType ntype;
41
42 sh_node_type_base(&ntype, "ShaderNodeBackground", SH_NODE_BACKGROUND);
43 ntype.ui_name = "Background";
44 ntype.ui_description =
45 "Add background light emission.\nNote: This node should only be used for the world surface "
46 "output";
47 ntype.enum_name_legacy = "BACKGROUND";
49 ntype.declare = file_ns::node_declare;
51 ntype.gpu_fn = file_ns::node_shader_gpu_background;
52
54}
#define NODE_CLASS_SHADER
Definition BKE_node.hh:460
#define SH_NODE_BACKGROUND
#define BLT_I18NCONTEXT_AMOUNT
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
#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_background(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
void register_node_type_sh_background()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
bool world_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