Blender V5.3
gpu_shader_material_volume_scatter.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 float density,
12 float anisotropy,
13 float /*ior*/,
14 float /*backscatter*/,
15 float /*alpha*/,
16 float /*diameter*/,
17 float weight,
18 KernelGlobals &kg,
19 ShadingData &sd,
20 Closure &result)
21{
22 color = max(color, float4(0.0f));
23 density = max(density, 0.0f);
24
25 ClosureVolumeScatter volume_scatter_data;
26 volume_scatter_data.scattering = color.rgb * (density * weight);
27 volume_scatter_data.anisotropy = anisotropy * weight;
28
29 result = closure_eval(kg, sd, volume_scatter_data);
30}
btScalar max
Closure closure_eval(KernelGlobals &kg, ShadingData &sd, ClosureDiffuse diffuse)
void node_volume_scatter(float4 color, float density, float anisotropy, float, float, float, float, float weight, KernelGlobals &kg, ShadingData &sd, Closure &result)