[Bf-blender-cvs] [54fd3f3] master: Fix T43195: Cycles uses clipping sphere instead of clipping plane
Sergey Sharybin
noreply at git.blender.org
Tue Jan 13 22:37:24 CET 2015
Commit: 54fd3f36a047b4d394c935a0aa387ae8a7b6a8c5
Author: Sergey Sharybin
Date: Wed Jan 14 02:34:49 2015 +0500
Branches: master
https://developer.blender.org/rB54fd3f36a047b4d394c935a0aa387ae8a7b6a8c5
Fix T43195: Cycles uses clipping sphere instead of clipping plane
Basically the title tells it all, now Cycles uses proper clipping plane,
matching other render engines.
===================================================================
M intern/cycles/kernel/kernel_camera.h
===================================================================
diff --git a/intern/cycles/kernel/kernel_camera.h b/intern/cycles/kernel/kernel_camera.h
index 63a3cad..e6d5714 100644
--- a/intern/cycles/kernel/kernel_camera.h
+++ b/intern/cycles/kernel/kernel_camera.h
@@ -88,8 +88,10 @@ ccl_device void camera_sample_perspective(KernelGlobals *kg, float raster_x, flo
#ifdef __CAMERA_CLIPPING__
/* clipping */
- ray->P += kernel_data.cam.nearclip*ray->D;
- ray->t = kernel_data.cam.cliplength;
+ float3 Pclip = normalize(Pcamera);
+ float z_inv = 1.0f / Pclip.z;
+ ray->P += kernel_data.cam.nearclip*ray->D * z_inv;
+ ray->t = kernel_data.cam.cliplength * z_inv;
#else
ray->t = FLT_MAX;
#endif
More information about the Bf-blender-cvs
mailing list