Fix: Cycles: Remove volume density cutoff in OSL

The cutoff was removed for SVM in !131696, but the change was not
applied to OSL

Pull Request: https://projects.blender.org/blender/blender/pulls/157654
This commit is contained in:
Weizhen Huang 2026-04-28 10:45:54 +02:00 • committed by Weizhen Huang
parent f7eae38144
commit 8bc0d293b1

View file

@ -22,13 +22,13 @@ shader node_principled_volume(color Color = color(0.5, 0.5, 0.5),
float primitive_density = 1.0;
float density = max(Density, 0.0);
if (density > 1e-5) {
if (density > 0.0) {
if (getattribute(DensityAttribute, primitive_density)) {
density = max(density * primitive_density, 0.0);
}
}
if (density > 1e-5) {
if (density > 0.0) {
/* Compute scattering color. */
color scatter_color = Color;
color primitive_color;
@ -48,11 +48,11 @@ shader node_principled_volume(color Color = color(0.5, 0.5, 0.5),
float emission_strength = max(EmissionStrength, 0.0);
float blackbody_intensity = BlackbodyIntensity;
if (emission_strength > 1e-5) {
if (emission_strength > 0.0) {
Volume += emission_strength * EmissionColor * emission();
}
if (blackbody_intensity > 1e-3) {
if (blackbody_intensity > 0.0) {
float T = Temperature;
/* Add temperature from attribute if available. */
@ -68,7 +68,7 @@ shader node_principled_volume(color Color = color(0.5, 0.5, 0.5),
float sigma = 5.670373e-8 * 1e-6 / M_PI;
float intensity = sigma * mix(1.0, T4, blackbody_intensity);
if (intensity > 1e-5) {
if (intensity > 0.0) {
color bb = blackbody(T);
float l = luminance(bb);