Commit: 7fec7eee2070aac701f7918311a05ca2bfd1b3b0
Author: Scott Wu
Date:   Sat Oct 15 00:11:42 2016 +0200
Branches: master
https://developer.blender.org/rB7fec7eee2070aac701f7918311a05ca2bfd1b3b0

Cycles: use near clipping distance in panorama camera.

Reviewed By: sergey, brecht, dfelinto

Differential Revision: https://developer.blender.org/D1952

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

M       intern/cycles/kernel/kernel_camera.h

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

diff --git a/intern/cycles/kernel/kernel_camera.h 
b/intern/cycles/kernel/kernel_camera.h
index 8e0aa67..ed9726e 100644
--- a/intern/cycles/kernel/kernel_camera.h
+++ b/intern/cycles/kernel/kernel_camera.h
@@ -221,14 +221,6 @@ ccl_device_inline void 
camera_sample_panorama(KernelGlobals *kg,
 
        /* create ray form raster position */
        ray->P = make_float3(0.0f, 0.0f, 0.0f);
-
-#ifdef __CAMERA_CLIPPING__
-       /* clipping */
-       ray->t = kernel_data.cam.cliplength;
-#else
-       ray->t = FLT_MAX;
-#endif
-
        ray->D = panorama_to_direction(kg, Pcamera.x, Pcamera.y);
 
        /* indicates ray should not receive any light, outside of the lens */
@@ -302,6 +294,14 @@ ccl_device_inline void 
camera_sample_panorama(KernelGlobals *kg,
        ray->dD.dy = spherical_stereo_direction(kg, tD, tP, Pcamera) - Ddiff;
        /* dP.dy is zero, since the omnidirectional panorama only shift the 
eyes horizontally */
 #endif
+
+#ifdef __CAMERA_CLIPPING__
+       /* clipping */
+       ray->P += kernel_data.cam.nearclip*ray->D;
+       ray->t = kernel_data.cam.cliplength;
+#else
+       ray->t = FLT_MAX;
+#endif
 }
 
 /* Common */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to