Blender V4.3
node_shader_volume_info.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_output<decl::Color>("Color");
12 b.add_output<decl::Float>("Density");
13 b.add_output<decl::Float>("Flame");
14 b.add_output<decl::Float>("Temperature");
15}
16
18 bNode * /*node*/,
19 bNodeExecData * /*execdata*/,
20 GPUNodeStack * /*in*/,
21 GPUNodeStack *out)
22{
23 if (out[0].hasoutput) {
24 out[0].link = GPU_attribute(mat, CD_AUTO_FROM_NAME, "color");
25 GPU_link(mat, "node_attribute_color", out[0].link, &out[0].link);
26 }
27 if (out[1].hasoutput) {
28 out[1].link = GPU_attribute(mat, CD_AUTO_FROM_NAME, "density");
29 GPU_link(mat, "node_attribute_density", out[1].link, &out[1].link);
30 }
31 if (out[2].hasoutput) {
32 out[2].link = GPU_attribute(mat, CD_AUTO_FROM_NAME, "flame");
33 GPU_link(mat, "node_attribute_flame", out[2].link, &out[2].link);
34 }
35 if (out[3].hasoutput) {
36 out[3].link = GPU_attribute(mat, CD_AUTO_FROM_NAME, "temperature");
37 GPU_link(mat, "node_attribute_temperature", out[3].link, &out[3].link);
38 }
39
40 return true;
41}
42
43} // namespace blender::nodes::node_shader_volume_info_cc
44
46{
48
49 static blender::bke::bNodeType ntype;
50
52 ntype.declare = file_ns::node_declare;
53 ntype.gpu_fn = file_ns::node_shader_gpu_volume_info;
54
56}
#define SH_NODE_VOLUME_INFO
Definition BKE_node.hh:988
#define NODE_CLASS_INPUT
Definition BKE_node.hh:404
@ CD_AUTO_FROM_NAME
GPUNodeLink * GPU_attribute(GPUMaterial *mat, eCustomDataType type, const char *name)
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_volume_info(GPUMaterial *mat, bNode *, bNodeExecData *, GPUNodeStack *, GPUNodeStack *out)
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_sh_volume_info()
Defines a node type.
Definition BKE_node.hh:218
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:318
NodeDeclareFunction declare
Definition BKE_node.hh:347