Code refactor: better distinguish scatter and absorption for volume integration.

This commit is contained in:
Brecht Van Lommel
2013-12-29 15:49:16 +01:00
parent 5d3adafcbb
commit 30aa0c2482
4 changed files with 68 additions and 57 deletions

View File

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