blender/intern/cycles/kernel/osl/shaders/node_scatter_volume.osl
Alexandre-Cardaillac 921c2b9d61 Shader: New Volume Coefficients Shader
Add a new shader node to control volume coefficients (scattering,
absorption and emission) directly, making it easier to model existing
volumes with measured data.

Pull Request: https://projects.blender.org/blender/blender/pulls/136287
2025-05-08 19:19:35 +02:00

20 lines
767 B
Text

/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
*
* SPDX-License-Identifier: Apache-2.0 */
#include "node_scatter.h"
shader node_scatter_volume(string phase = "Henyey-Greenstein",
color Color = color(0.8, 0.8, 0.8),
float Density = 1.0,
float Anisotropy = 0.0,
float IOR = 1.33,
float Backscatter = 0.1,
float Alpha = 0.5,
float Diameter = 20.0,
output closure color Volume = 0)
{
closure color scatter_closure = scatter(phase, Anisotropy, IOR, Backscatter, Alpha, Diameter);
Volume = (Color * max(Density, 0.0)) * scatter_closure;
}