From 0203c5f2a2632451f4f56b43135be4108b46b559 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 11 Feb 2014 12:18:10 +0100 Subject: Cycles: Clamp Direct now affects the Background too. Reviewed by: brecht Differential Revision: https://developer.blender.org/D306 --- intern/cycles/kernel/kernel_accumulate.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'intern') diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h index 80f3bfd33a0..a8563f9a501 100644 --- a/intern/cycles/kernel/kernel_accumulate.h +++ b/intern/cycles/kernel/kernel_accumulate.h @@ -324,6 +324,9 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, PathRadi float3 L_direct = L->direct_diffuse + L->direct_glossy + L->direct_transmission + L->direct_subsurface + L->emission; float3 L_indirect = L->indirect_diffuse + L->indirect_glossy + L->indirect_transmission + L->indirect_subsurface; + + if(!kernel_data.background.transparent) + L_direct += L->background; #ifdef __CLAMP_SAMPLE__ float clamp_direct = kernel_data.integrator.sample_clamp_direct; @@ -343,6 +346,7 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, PathRadi L->direct_transmission *= scale; L->direct_subsurface *= scale; L->emission *= scale; + L->background *= scale; } /* Indirect */ @@ -361,9 +365,6 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, PathRadi /* Combine */ float3 L_sum = L_direct + L_indirect; - if(!kernel_data.background.transparent) - L_sum += L->background; - return L_sum; } else -- cgit v1.2.3