diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-08-19 16:42:43 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-08-19 19:14:16 +0300 |
commit | c22b52cd3666ba25dd62b29a32986ac3684532ee (patch) | |
tree | 9248c2aa5824b8d4c2dfdb9e5c8f1533fcb9ab27 /intern/cycles | |
parent | 4218b9367e11559bdcc7a7b98625dd2984eef3d4 (diff) |
Fix T52452: OSL trace broken after shadow catcher recent changes.
We should only early out with any hit in BVH traversal if the only visibility
bits used are opaque shadow. Not when opaque shadow is one of multiple bits.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/bvh/bvh_traversal.h | 12 | ||||
-rw-r--r-- | intern/cycles/kernel/bvh/qbvh_traversal.h | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/intern/cycles/kernel/bvh/bvh_traversal.h b/intern/cycles/kernel/bvh/bvh_traversal.h index ae8f54821f2..bdf43dcac18 100644 --- a/intern/cycles/kernel/bvh/bvh_traversal.h +++ b/intern/cycles/kernel/bvh/bvh_traversal.h @@ -244,14 +244,14 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, { /* shadow ray early termination */ #if defined(__KERNEL_SSE2__) - if(visibility & PATH_RAY_SHADOW_OPAQUE) + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) return true; tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif #else - if(visibility & PATH_RAY_SHADOW_OPAQUE) + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) return true; #endif } @@ -274,14 +274,14 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, { /* shadow ray early termination */ # if defined(__KERNEL_SSE2__) - if(visibility & PATH_RAY_SHADOW_OPAQUE) + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) return true; tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif # else - if(visibility & PATH_RAY_SHADOW_OPAQUE) + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) return true; # endif } @@ -328,14 +328,14 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, if(hit) { /* shadow ray early termination */ # if defined(__KERNEL_SSE2__) - if(visibility & PATH_RAY_SHADOW_OPAQUE) + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) return true; tsplat = ssef(0.0f, 0.0f, -isect->t, -isect->t); # if BVH_FEATURE(BVH_HAIR) tfar = ssef(isect->t); # endif # else - if(visibility & PATH_RAY_SHADOW_OPAQUE) + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) return true; # endif } diff --git a/intern/cycles/kernel/bvh/qbvh_traversal.h b/intern/cycles/kernel/bvh/qbvh_traversal.h index 335a4afd47a..3ee3bf57899 100644 --- a/intern/cycles/kernel/bvh/qbvh_traversal.h +++ b/intern/cycles/kernel/bvh/qbvh_traversal.h @@ -340,7 +340,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, prim_addr)) { tfar = ssef(isect->t); /* Shadow ray early termination. */ - if(visibility & PATH_RAY_SHADOW_OPAQUE) { + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) { return true; } } @@ -362,7 +362,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, prim_addr)) { tfar = ssef(isect->t); /* Shadow ray early termination. */ - if(visibility & PATH_RAY_SHADOW_OPAQUE) { + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) { return true; } } @@ -409,7 +409,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, if(hit) { tfar = ssef(isect->t); /* Shadow ray early termination. */ - if(visibility & PATH_RAY_SHADOW_OPAQUE) { + if(!(visibility & (PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE))) { return true; } } |