Blender V4.3
node_shader_volume_absorption.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::Color>("Color").default_value({0.8f, 0.8f, 0.8f, 1.0f});
12#define SOCK_COLOR_ID 0
13 b.add_input<decl::Float>("Density").default_value(1.0f).min(0.0f).max(1000.0f);
14#define SOCK_DENSITY_ID 1
15 b.add_input<decl::Float>("Weight").available(false);
16 b.add_output<decl::Shader>("Volume").translation_context(BLT_I18NCONTEXT_ID_ID);
17}
18
20 bNode *node,
21 bNodeExecData * /*execdata*/,
22 GPUNodeStack *in,
23 GPUNodeStack *out)
24{
27 }
28 return GPU_stack_link(mat, node, "node_volume_absorption", in, out);
29}
30
31#undef SOCK_COLOR_ID
32#undef SOCK_DENSITY_ID
33
34} // namespace blender::nodes::node_shader_volume_absorption_cc
35
36/* node type definition */
38{
40
41 static blender::bke::bNodeType ntype;
42
43 sh_node_type_base(&ntype, SH_NODE_VOLUME_ABSORPTION, "Volume Absorption", NODE_CLASS_SHADER);
44 ntype.declare = file_ns::node_declare;
45 ntype.gpu_fn = file_ns::node_shader_gpu_volume_absorption;
46
48}
#define NODE_CLASS_SHADER
Definition BKE_node.hh:417
#define BLT_I18NCONTEXT_ID_ID
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ GPU_MATFLAG_VOLUME_ABSORPTION
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static int node_shader_gpu_volume_absorption(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
bool node_socket_not_white(const GPUNodeStack &socket)
bool node_socket_not_zero(const GPUNodeStack &socket)
#define SOCK_DENSITY_ID
void register_node_type_sh_volume_absorption()
#define SOCK_COLOR_ID
Defines a node type.
Definition BKE_node.hh:218
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:318
NodeDeclareFunction declare
Definition BKE_node.hh:347