Blender V4.3
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 b.add_input<decl::Float>("Weight").available(false);
20 b.add_output<decl::Shader>("Background");
21}
22
24 bNode *node,
25 bNodeExecData * /*execdata*/,
26 GPUNodeStack *in,
27 GPUNodeStack *out)
28{
29 return GPU_stack_link(mat, node, "node_background", in, out);
30}
31
32} // namespace blender::nodes::node_shader_background_cc
33
34/* node type definition */
36{
38
39 static blender::bke::bNodeType ntype;
40
41 sh_node_type_base(&ntype, SH_NODE_BACKGROUND, "Background", NODE_CLASS_SHADER);
42 ntype.declare = file_ns::node_declare;
44 ntype.gpu_fn = file_ns::node_shader_gpu_background;
45
47}
#define NODE_CLASS_SHADER
Definition BKE_node.hh:417
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
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, int type, const char *name, short nclass)
bool world_shader_nodes_poll(const bContext *C)
Defines a node type.
Definition BKE_node.hh:218
bool(* add_ui_poll)(const bContext *C)
Definition BKE_node.hh:288
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:318
NodeDeclareFunction declare
Definition BKE_node.hh:347