[Bf-blender-cvs] [21bf863] blender-v2.78-release: Cycles: Fix shadowing variable which also causes use of uninitialized variable

Sergey Sharybin noreply at git.blender.org
Mon Oct 24 14:08:06 CEST 2016


Commit: 21bf8639348bc75cd0c654f8ec5c3d110cf0ac5c
Author: Sergey Sharybin
Date:   Mon Oct 24 14:04:31 2016 +0200
Branches: blender-v2.78-release
https://developer.blender.org/rB21bf8639348bc75cd0c654f8ec5c3d110cf0ac5c

Cycles: Fix shadowing variable which also causes use of uninitialized variable

Was causing wrong aperture for panorama cameras.

Seems to be a regression in 371d357.

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

M	intern/cycles/kernel/kernel_camera.h

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

diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h
index b99a82b..dedac6b 100644
--- a/intern/cycles/kernel/kernel_camera.h
+++ b/intern/cycles/kernel/kernel_camera.h
@@ -264,13 +264,13 @@ ccl_device_inline void camera_sample_panorama(KernelGlobals *kg,
 		float2 lensuv = camera_sample_aperture(kg, lens_u, lens_v)*aperturesize;
 
 		/* compute point on plane of focus */
-		float3 D = normalize(D);
-		float3 Pfocus = D * kernel_data.cam.focaldistance;
+		float3 Dfocus = normalize(D);
+		float3 Pfocus = Dfocus * kernel_data.cam.focaldistance;
 
-		/* calculate orthonormal coordinates perpendicular to D */
+		/* calculate orthonormal coordinates perpendicular to Dfocus */
 		float3 U, V;
-		U = normalize(make_float3(1.0f, 0.0f, 0.0f) -  D.x * D);
-		V = normalize(cross(D, U));
+		U = normalize(make_float3(1.0f, 0.0f, 0.0f) -  Dfocus.x * Dfocus);
+		V = normalize(cross(Dfocus, U));
 
 		/* update ray for effect of lens */
 		P = U * lensuv.x + V * lensuv.y;




More information about the Bf-blender-cvs mailing list