[Bf-blender-cvs] [d7e4a79] master: Cycles-Bake: fix T40270 Combined Type fails to bake Emission node

Dalai Felinto noreply at git.blender.org
Fri May 23 00:06:48 CEST 2014


Commit: d7e4a793880796e7236f73df3f35abb045941aad
Author: Dalai Felinto
Date:   Thu May 22 19:05:23 2014 -0300
https://developer.blender.org/rBd7e4a793880796e7236f73df3f35abb045941aad

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

===================================================================

M	intern/cycles/kernel/kernel_bake.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h
index abe3569..b64c5ce 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);
 			}




More information about the Bf-blender-cvs mailing list