diff options
Diffstat (limited to 'intern/cycles/kernel/kernel_path.h')
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 7aea673528a..204f782e5f4 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -92,11 +92,10 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ra #endif #ifdef __VOLUME__ - /* volume attenuation */ + /* volume attenuation, emission, scatter */ if(state.volume_stack[0].shader != SHADER_NO_ID) { - Ray segment_ray = ray; - segment_ray.t = (hit)? isect.t: FLT_MAX; - kernel_volume_integrate(kg, &state, &segment_ray, L, &throughput); + ray.t = (hit)? isect.t: FLT_MAX; + kernel_volume_integrate(kg, &state, &ray, L, &throughput); } #endif @@ -514,11 +513,10 @@ ccl_device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, #endif #ifdef __VOLUME__ - /* volume attenuation */ + /* volume attenuation, emission, scatter */ if(state.volume_stack[0].shader != SHADER_NO_ID) { - Ray segment_ray = ray; - segment_ray.t = (hit)? isect.t: FLT_MAX; - kernel_volume_integrate(kg, &state, &segment_ray, &L, &throughput); + ray.t = (hit)? isect.t: FLT_MAX; + kernel_volume_integrate(kg, &state, &ray, &L, &throughput); } #endif @@ -1018,11 +1016,10 @@ ccl_device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, in #endif #ifdef __VOLUME__ - /* volume attenuation */ + /* volume attenuation, emission, scatter */ if(state.volume_stack[0].shader != SHADER_NO_ID) { - Ray segment_ray = ray; - segment_ray.t = (hit)? isect.t: FLT_MAX; - kernel_volume_integrate(kg, &state, &segment_ray, &L, &throughput); + ray.t = (hit)? isect.t: FLT_MAX; + kernel_volume_integrate(kg, &state, &ray, &L, &throughput); } #endif |