Fix #33915: tweak self intersection epsilon for motion blur a bit further, still
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 23 Jan 2013 16:56:02 +0000 (16:56 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 23 Jan 2013 16:56:02 +0000 (16:56 +0000)
had some cases where there were artifacts. Also fix rendering error with shutter
time set to 0.

intern/cycles/kernel/kernel_bvh.h
intern/cycles/kernel/kernel_camera.h
intern/cycles/render/camera.cpp

index a1195e4..1a85b5b 100644 (file)
@@ -929,7 +929,7 @@ __device_inline float3 ray_offset(float3 P, float3 Ng)
        const float epsilon_f = 1e-5f;
        /* ideally this should match epsilon_f, but instancing/mblur
         * precision makes it problematic */
-       const float epsilon_test = 1e-1f;
+       const float epsilon_test = 1.0f;
        const int epsilon_i = 32;
 
        float3 res;
index cd896ff..f9d5bd3 100644 (file)
@@ -213,7 +213,7 @@ __device void camera_sample(KernelGlobals *kg, int x, int y, float filter_u, flo
 
 #ifdef __CAMERA_MOTION__
        /* motion blur */
-       if(kernel_data.cam.shuttertime == 0.0f)
+       if(kernel_data.cam.shuttertime == -1.0f)
                ray->time = TIME_INVALID;
        else
                ray->time = 0.5f + 0.5f*(time - 0.5f)*kernel_data.cam.shuttertime;
index a78ede9..3ca1949 100644 (file)
@@ -216,9 +216,9 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
 
        /* motion blur */
 #ifdef __CAMERA_MOTION__
-       kcam->shuttertime = (need_motion == Scene::MOTION_BLUR) ? shuttertime: 0.0f;
+       kcam->shuttertime = (need_motion == Scene::MOTION_BLUR) ? shuttertime: -1.0f;
 #else
-       kcam->shuttertime = 0.0f;
+       kcam->shuttertime = -1.0f;
 #endif
 
        /* type */