[Bf-blender-cvs] [fc31bae] master: Cleanup: Avoid temp variable in portal sampling code.

Thomas Dinges noreply at git.blender.org
Wed May 13 19:55:07 CEST 2015


Commit: fc31bae66fdf0daa14da2eb81ba537f2ff325a96
Author: Thomas Dinges
Date:   Wed May 13 19:54:20 2015 +0200
Branches: master
https://developer.blender.org/rBfc31bae66fdf0daa14da2eb81ba537f2ff325a96

Cleanup: Avoid temp variable in portal sampling code.

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

M	intern/cycles/kernel/kernel_light.h

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

diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index 3983947..1badbc3 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -355,16 +355,14 @@ ccl_device float3 background_portal_sample(KernelGlobals *kg,
 			float3 axisu = make_float3(data1.y, data1.z, data1.w);
 			float3 axisv = make_float3(data2.y, data2.z, data2.w);
 
-			float3 lightPoint = lightpos;
-
-			*pdf = area_light_sample(P, &lightPoint,
+			*pdf = area_light_sample(P, &lightpos,
 			                         axisu, axisv,
 			                         randu, randv,
 			                         true);
 
 			*pdf /= num_possible;
 			*sampled_portal = p;
-			return normalize(lightPoint - P);
+			return normalize(lightpos - P);
 		}
 
 		portal--;




More information about the Bf-blender-cvs mailing list