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.
This commit is contained in:
Lukas Stockner 2023-01-08 22:54:51 +01:00
parent d11f3267cd
commit e7a554e551
Notes: blender-bot 2023-02-14 09:02:40 +01:00
Referenced by issue #103754, Connecting Curve To Points > Rotation crashes Blender with an access violation
Referenced by issue #94698, Halo artifacts with volumetrics in the "Diffuse Indirect" and "Transmission Indirect" passes
1 changed files with 4 additions and 2 deletions

View File

@ -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 */