Blender V5.3
gpu_shader_material_volume_absorption.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9[[node]]
11 float4 color, float density, float weight, KernelGlobals &kg, ShadingData &sd, Closure &result)
12{
13 color = max(color, float4(0.0f));
14 density = max(density, 0.0f);
15
16 ClosureVolumeAbsorption volume_absorption_data;
17 volume_absorption_data.absorption = (1.0f - color.rgb) * density * weight;
18
19 result = closure_eval(kg, sd, volume_absorption_data);
20}
btScalar max
Closure closure_eval(KernelGlobals &kg, ShadingData &sd, ClosureDiffuse diffuse)
void node_volume_absorption(float4 color, float density, float weight, KernelGlobals &kg, ShadingData &sd, Closure &result)