mirror of
https://github.com/blender/blender
synced 2026-10-25 03:07:01 +03:00
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
20 lines
767 B
Text
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;
|
|
}
|