Blender V4.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
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*/,
18 GPUNodeStack *in,
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
43 ntype.declare = file_ns::node_declare;
45 ntype.gpu_fn = file_ns::node_shader_gpu_output_world;
46
47 ntype.no_muting = true;
48
50}
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:405
#define SH_NODE_OUTPUT_WORLD
Definition BKE_node.hh:914
#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,...)
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_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, 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