Blender V5.3
node_shader_output_world.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>("Surface"_ustr);
18 b.add_input<decl::Shader>("Volume"_ustr).translation_context(BLT_I18NCONTEXT_ID_ID);
19}
20
22 bNode * /*node*/,
23 bNodeExecData * /*execdata*/,
25 GPUNodeStack * /*out*/)
26{
27 GPUNodeLink *outlink_surface, *outlink_volume;
28 if (in[0].link) {
29 GPU_link(mat, "node_output_world_surface", in[0].link, &outlink_surface);
30 GPU_material_output_surface(mat, outlink_surface);
31 }
32 if (in[1].link) {
33 GPU_link(mat, "node_output_world_volume", in[1].link, &outlink_volume);
34 GPU_material_output_volume(mat, outlink_volume);
35 }
36 return true;
37}
38
39} // namespace nodes::node_shader_output_world_cc
40
41/* node type definition */
43{
44 namespace file_ns = nodes::node_shader_output_world_cc;
45
46 static bke::bNodeType ntype;
47
48 sh_node_type_base(&ntype, "ShaderNodeOutputWorld"_ustr, SH_NODE_OUTPUT_WORLD);
49 ntype.ui_name = "World Output";
50 ntype.ui_description = "Output light color information to the scene's World";
51 ntype.enum_name_legacy = "OUTPUT_WORLD";
53 ntype.declare = file_ns::node_declare;
55 ntype.gpu_fn = file_ns::node_shader_gpu_output_world;
56
57 ntype.no_muting = true;
58
60}
61
62} // namespace blender
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:479
#define SH_NODE_OUTPUT_WORLD
#define BLT_I18NCONTEXT_ID_ID
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_output_world(GPUMaterial *mat, bNode *, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *)
BMesh Iterators.
void register_node_type_sh_output_world()
void GPU_material_output_surface(GPUMaterial *material, GPUNodeLink *link)
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool GPU_link(GPUMaterial *mat, const char *name,...)
bool world_shader_nodes_poll(const bContext *C)
void GPU_material_output_volume(GPUMaterial *material, GPUNodeLink *link)
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