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
This commit is contained in:
Dalai Felinto 2014-05-22 19:05:23 -03:00
parent 2bfc3debd9
commit d7e4a79388
Notes: blender-bot 2023-02-14 11:28:39 +01:00
Referenced by issue #40270, Cycles bake: Combined Type fails to bake Emission node
1 changed files with 12 additions and 0 deletions

View File

@ -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);
}