Blender V5.0
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
5#include "node_shader_util.hh"
6
8
10{
11 b.add_input<decl::Shader>("Surface");
12 b.add_input<decl::Shader>("Volume").translation_context(BLT_I18NCONTEXT_ID_ID);
13}
14
16 bNode * /*node*/,
17 bNodeExecData * /*execdata*/,
19 GPUNodeStack * /*out*/)
20{
21 GPUNodeLink *outlink_surface, *outlink_volume;
22 if (in[0].link) {
23 GPU_link(mat, "node_output_world_surface", in[0].link, &outlink_surface);
24 GPU_material_output_surface(mat, outlink_surface);
25 }
26 if (in[1].link) {
27 GPU_link(mat, "node_output_world_volume", in[1].link, &outlink_volume);
28 GPU_material_output_volume(mat, outlink_volume);
29 }
30 return true;
31}
32
33} // namespace blender::nodes::node_shader_output_world_cc
34
35/* node type definition */
37{
39
40 static blender::bke::bNodeType ntype;
41
42 sh_node_type_base(&ntype, "ShaderNodeOutputWorld", SH_NODE_OUTPUT_WORLD);
43 ntype.ui_name = "World Output";
44 ntype.ui_description = "Output light color information to the scene's World";
45 ntype.enum_name_legacy = "OUTPUT_WORLD";
47 ntype.declare = file_ns::node_declare;
49 ntype.gpu_fn = file_ns::node_shader_gpu_output_world;
50
51 ntype.no_muting = true;
52
54}
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:448
#define SH_NODE_OUTPUT_WORLD
#define BLT_I18NCONTEXT_ID_ID
void GPU_material_output_surface(GPUMaterial *material, GPUNodeLink *link)
void GPU_material_output_volume(GPUMaterial *material, GPUNodeLink *link)
bool GPU_link(GPUMaterial *mat, const char *name,...)
#define in
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_output_world(GPUMaterial *mat, bNode *, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *)
void register_node_type_sh_output_world()
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