forked from bartvdbraak/blender
Fix T40695: world surface shader incorrectly visible with world volume.
This commit is contained in:
parent
16baa8c273
commit
4b209f063c
@ -132,6 +132,9 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, Ray ray,
|
||||
scatter = kernel_path_volume_bounce(kg, rng, &volume_sd, &throughput, &state, L, &ray, 1.0f);
|
||||
}
|
||||
|
||||
if(result != VOLUME_PATH_SCATTERED)
|
||||
throughput *= volume_segment.accum_transmittance;
|
||||
|
||||
/* free cached steps */
|
||||
kernel_volume_decoupled_free(kg, &volume_segment);
|
||||
|
||||
@ -514,6 +517,9 @@ ccl_device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample,
|
||||
scatter = kernel_path_volume_bounce(kg, rng, &volume_sd, &throughput, &state, &L, &ray, 1.0f);
|
||||
}
|
||||
|
||||
if(result != VOLUME_PATH_SCATTERED)
|
||||
throughput *= volume_segment.accum_transmittance;
|
||||
|
||||
/* free cached steps */
|
||||
kernel_volume_decoupled_free(kg, &volume_segment);
|
||||
|
||||
|
@ -741,8 +741,6 @@ ccl_device VolumeIntegrateResult kernel_volume_decoupled_scatter(
|
||||
{
|
||||
int closure_flag = segment->closure_flag;
|
||||
|
||||
/* XXX add probalistic scattering! */
|
||||
|
||||
if(!(closure_flag & SD_SCATTER))
|
||||
return VOLUME_PATH_MISSED;
|
||||
|
||||
@ -760,8 +758,10 @@ ccl_device VolumeIntegrateResult kernel_volume_decoupled_scatter(
|
||||
/* rescale random number so we can reuse it */
|
||||
xi = 1.0f - (1.0f - xi - sample_transmittance)/(1.0f - sample_transmittance);
|
||||
}
|
||||
else
|
||||
else {
|
||||
*throughput /= sample_transmittance;
|
||||
return VOLUME_PATH_MISSED;
|
||||
}
|
||||
}
|
||||
|
||||
VolumeStep *step;
|
||||
|
Loading…
Reference in New Issue
Block a user