diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2014-05-23 02:05:23 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2014-05-23 02:05:23 +0400 |
commit | d7e4a793880796e7236f73df3f35abb045941aad (patch) | |
tree | 190c54d274a35946864e752a0363a94d5430b479 /intern | |
parent | 2bfc3debd90ac0176e62de37d7aeea1a5316e658 (diff) |
Cycles-Bake: fix T40270 Combined Type fails to bake Emission node
Main code and review by Brecht Van Lommel
Differential Revision: https://developer.blender.org/D543
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/kernel_bake.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h index abe356996ab..b64c5cecbff 100644 --- a/intern/cycles/kernel/kernel_bake.h +++ b/intern/cycles/kernel/kernel_bake.h @@ -66,6 +66,12 @@ ccl_device void compute_light_pass(KernelGlobals *kg, ShaderData *sd, PathRadian /* sample light and BSDF */ if((!is_sss) && (!is_ao)) { + + if(sd->flag & SD_EMISSION) { + float3 emission = indirect_primitive_emission(kg, sd, 0.0f, state.flag, state.ray_pdf); + path_radiance_accum_emission(&L_sample, throughput, emission, state.bounce); + } + if(kernel_path_integrate_lighting(kg, &rng, sd, &throughput, &state, &L_sample, &ray)) { #ifdef __LAMP_MIS__ state.ray_t = 0.0f; @@ -98,6 +104,12 @@ ccl_device void compute_light_pass(KernelGlobals *kg, ShaderData *sd, PathRadian /* sample light and BSDF */ if((!is_sss) && (!is_ao)) { + + if(sd->flag & SD_EMISSION) { + float3 emission = indirect_primitive_emission(kg, sd, 0.0f, state.flag, state.ray_pdf); + path_radiance_accum_emission(&L_sample, throughput, emission, state.bounce); + } + kernel_branched_path_integrate_lighting(kg, &rng, sd, throughput, 1.0f, &state, &L_sample); } |