[Bf-blender-cvs] [e7a554e551e] master: Fix T94698: Cycles: Volume-scattered light is always counted as diffuse

Lukas Stockner noreply at git.blender.org
Sun Jan 8 23:18:43 CET 2023


Commit: e7a554e551e45332292aefebfedf5edf08c7400b
Author: Lukas Stockner
Date:   Sun Jan 8 22:54:51 2023 +0100
Branches: master
https://developer.blender.org/rBe7a554e551e45332292aefebfedf5edf08c7400b

Fix T94698: Cycles: Volume-scattered light is always counted as diffuse

At the first bounce, the diffuse/glossy/transmission weights are stored so that
contributions along the path can be split into the d/g/t indirect passes.

However, volume bounces always set the weight even at indirect bounces, so
even paths that had their first bounce on a purely glossy object would suddenly
start counting towards the diffuse indirect pass after a secondary volume bounce.

===================================================================

M	intern/cycles/kernel/integrator/shade_volume.h

===================================================================

diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h
index 456bebe771a..624aeb5edee 100644
--- a/intern/cycles/kernel/integrator/shade_volume.h
+++ b/intern/cycles/kernel/integrator/shade_volume.h
@@ -979,8 +979,10 @@ ccl_device_forceinline bool integrate_volume_phase_scatter(
   INTEGRATOR_STATE_WRITE(state, path, throughput) = throughput_phase;
 
   if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) {
-    INTEGRATOR_STATE_WRITE(state, path, pass_diffuse_weight) = one_spectrum();
-    INTEGRATOR_STATE_WRITE(state, path, pass_glossy_weight) = zero_spectrum();
+    if (INTEGRATOR_STATE(state, path, bounce) == 0) {
+      INTEGRATOR_STATE_WRITE(state, path, pass_diffuse_weight) = one_spectrum();
+      INTEGRATOR_STATE_WRITE(state, path, pass_glossy_weight) = zero_spectrum();
+    }
   }
 
   /* Update path state */



More information about the Bf-blender-cvs mailing list