Blender  V3.3
node_shader_volume_info.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
4 #include "node_shader_util.hh"
5 
7 
9 {
10  b.add_output<decl::Color>(N_("Color"));
11  b.add_output<decl::Float>(N_("Density"));
12  b.add_output<decl::Float>(N_("Flame"));
13  b.add_output<decl::Float>(N_("Temperature"));
14 }
15 
17  bNode *UNUSED(node),
18  bNodeExecData *UNUSED(execdata),
19  GPUNodeStack *UNUSED(in),
21 {
22  if (out[0].hasoutput) {
23  out[0].link = GPU_attribute(mat, CD_AUTO_FROM_NAME, "color");
24  GPU_link(mat, "node_attribute_color", out[0].link, &out[0].link);
25  }
26  if (out[1].hasoutput) {
27  out[1].link = GPU_attribute(mat, CD_AUTO_FROM_NAME, "density");
28  GPU_link(mat, "node_attribute_density", out[1].link, &out[1].link);
29  }
30  if (out[2].hasoutput) {
31  out[2].link = GPU_attribute(mat, CD_AUTO_FROM_NAME, "flame");
32  GPU_link(mat, "node_attribute_flame", out[2].link, &out[2].link);
33  }
34  if (out[3].hasoutput) {
35  out[3].link = GPU_attribute(mat, CD_AUTO_FROM_NAME, "temperature");
36  GPU_link(mat, "node_attribute_temperature", out[3].link, &out[3].link);
37  }
38 
39  return true;
40 }
41 
42 } // namespace blender::nodes::node_shader_volume_info_cc
43 
45 {
47 
48  static bNodeType ntype;
49 
53 
54  nodeRegisterType(&ntype);
55 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
#define SH_NODE_VOLUME_INFO
Definition: BKE_node.h:1176
#define NODE_CLASS_INPUT
Definition: BKE_node.h:345
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
@ CD_AUTO_FROM_NAME
GPUNodeLink * GPU_attribute(GPUMaterial *mat, eCustomDataType type, const char *name)
bool GPU_link(GPUMaterial *mat, const char *name,...)
OperationNode * node
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_volume_info(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *UNUSED(in), GPUNodeStack *out)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_sh_volume_info()
Defines a node type.
Definition: BKE_node.h:226
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)