diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-23 16:52:10 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-23 16:52:10 +0400 |
commit | 779662aff7e815962b43eacff46c9a5710c48e3f (patch) | |
tree | b039651c9f26ab4408bc5098a3c00c60a9207f8d /intern | |
parent | ba14beb000fef2c5911b4e17c0bf260de1cf251d (diff) |
Fix #33641: cycles self intersection artifacts with motion blur and one of the
X/Y/Z coordinates close to 0.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/kernel_bvh.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_bvh.h b/intern/cycles/kernel/kernel_bvh.h index d70485fd6cf..73e7fb0e5d6 100644 --- a/intern/cycles/kernel/kernel_bvh.h +++ b/intern/cycles/kernel/kernel_bvh.h @@ -457,12 +457,15 @@ __device_inline float3 ray_offset(float3 P, float3 Ng) { #ifdef __INTERSECTION_REFINE__ 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 int epsilon_i = 32; float3 res; /* x component */ - if(fabsf(P.x) < epsilon_f) { + if(fabsf(P.x) < epsilon_test) { res.x = P.x + Ng.x*epsilon_f; } else { @@ -472,7 +475,7 @@ __device_inline float3 ray_offset(float3 P, float3 Ng) } /* y component */ - if(fabsf(P.y) < epsilon_f) { + if(fabsf(P.y) < epsilon_test) { res.y = P.y + Ng.y*epsilon_f; } else { @@ -482,7 +485,7 @@ __device_inline float3 ray_offset(float3 P, float3 Ng) } /* z component */ - if(fabsf(P.z) < epsilon_f) { + if(fabsf(P.z) < epsilon_test) { res.z = P.z + Ng.z*epsilon_f; } else { |