Cycles: use near clipping distance in panorama camera.

Reviewed By: sergey, brecht, dfelinto

Differential Revision: https://developer.blender.org/D1952
This commit is contained in:
Scott Wu 2016-10-15 00:11:42 +02:00 committed by Brecht Van Lommel
parent 05c727bb00
commit 7fec7eee20
1 changed files with 8 additions and 8 deletions

View File

@ -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 */