diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-10-24 15:04:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-10-24 15:04:31 +0300 |
commit | 14a55bc059e40ae72021262510e8c0942e4cc89f (patch) | |
tree | 62d706249715ea960db8d56d33985dcefe368cc7 | |
parent | cde18cf3b349a3a4d3b435fd3f76e5304ee446d6 (diff) |
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.
-rw-r--r-- | intern/cycles/kernel/kernel_camera.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h index b99a82b0203..dedac6b1465 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; |