diff options
Diffstat (limited to 'intern/cycles/kernel/kernel_emission.h')
-rw-r--r-- | intern/cycles/kernel/kernel_emission.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h index e70958c2b06..c63d1149d03 100644 --- a/intern/cycles/kernel/kernel_emission.h +++ b/intern/cycles/kernel/kernel_emission.h @@ -234,14 +234,13 @@ ccl_device_noinline_cpu float3 indirect_primitive_emission( /* Indirect Lamp Emission */ -ccl_device_noinline_cpu bool indirect_lamp_emission(KernelGlobals *kg, +ccl_device_noinline_cpu void indirect_lamp_emission(KernelGlobals *kg, ShaderData *emission_sd, ccl_addr_space PathState *state, + PathRadiance *L, Ray *ray, - float3 *emission) + float3 throughput) { - bool hit_lamp = false; - for (int lamp = 0; lamp < kernel_data.integrator.num_all_lights; lamp++) { LightSample ls ccl_optional_struct_init; @@ -261,7 +260,7 @@ ccl_device_noinline_cpu bool indirect_lamp_emission(KernelGlobals *kg, } #endif - float3 L = direct_emissive_eval( + float3 lamp_L = direct_emissive_eval( kg, emission_sd, &ls, state, -ray->D, ray->dD, ls.t, ray->time); #ifdef __VOLUME__ @@ -271,7 +270,7 @@ ccl_device_noinline_cpu bool indirect_lamp_emission(KernelGlobals *kg, volume_ray.t = ls.t; float3 volume_tp = make_float3(1.0f, 1.0f, 1.0f); kernel_volume_shadow(kg, emission_sd, state, &volume_ray, &volume_tp); - L *= volume_tp; + lamp_L *= volume_tp; } #endif @@ -279,14 +278,11 @@ ccl_device_noinline_cpu bool indirect_lamp_emission(KernelGlobals *kg, /* multiple importance sampling, get regular light pdf, * and compute weight with respect to BSDF pdf */ float mis_weight = power_heuristic(state->ray_pdf, ls.pdf); - L *= mis_weight; + lamp_L *= mis_weight; } - *emission += L; - hit_lamp = true; + path_radiance_accum_emission(kg, L, state, throughput, lamp_L); } - - return hit_lamp; } /* Indirect Background */ |