diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-20 20:16:17 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-20 20:16:17 +0400 |
commit | 8b4c1f729b2023d16bd8817521cb9cb033527144 (patch) | |
tree | 370d97ae53c96a4a5c3b90194d706ce6d08a963b /intern | |
parent | 6628318fdbf9c070e34372865d6414bb273e9747 (diff) |
Cycles: fix issue reported in IRC, rendering a material that mixes a transparent
and glass BSDF would give a different result with/without using light passes.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/kernel_accumulate.h | 30 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 1 |
2 files changed, 12 insertions, 19 deletions
diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h index 7d9aaf81906..7860913ce94 100644 --- a/intern/cycles/kernel/kernel_accumulate.h +++ b/intern/cycles/kernel/kernel_accumulate.h @@ -151,26 +151,20 @@ __device_inline void path_radiance_bsdf_bounce(PathRadiance *L, float3 *throughp #ifdef __PASSES__ if(L->use_light_pass) { - if(bounce == 0) { - if(bsdf_label & LABEL_TRANSPARENT) { - /* transparent bounce before first hit */ - *throughput *= bsdf_eval->transparent*inverse_pdf; - } - else { - /* first on directly visible surface */ - float3 value = *throughput*inverse_pdf; - - L->indirect_diffuse = bsdf_eval->diffuse*value; - L->indirect_glossy = bsdf_eval->glossy*value; - L->indirect_transmission = bsdf_eval->transmission*value; - - *throughput = L->indirect_diffuse + L->indirect_glossy + L->indirect_transmission; - - L->direct_throughput = *throughput; - } + if(bounce == 0 && !(bsdf_label & LABEL_TRANSPARENT)) { + /* first on directly visible surface */ + float3 value = *throughput*inverse_pdf; + + L->indirect_diffuse = bsdf_eval->diffuse*value; + L->indirect_glossy = bsdf_eval->glossy*value; + L->indirect_transmission = bsdf_eval->transmission*value; + + *throughput = L->indirect_diffuse + L->indirect_glossy + L->indirect_transmission; + + L->direct_throughput = *throughput; } else { - /* indirectly visible through BSDF */ + /* transparent bounce before first hit, or indirectly visible through BSDF */ float3 sum = (bsdf_eval->diffuse + bsdf_eval->glossy + bsdf_eval->transmission + bsdf_eval->transparent)*inverse_pdf; *throughput *= sum; } diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 154add55004..23860b41de3 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -288,7 +288,6 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R throughput /= probability; - #ifdef __AO__ /* ambient occlusion */ if(kernel_data.integrator.use_ambient_occlusion) { |