diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-02 01:14:54 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-02 01:14:54 +0300 |
commit | a6bbf05ba6268638f5e131fe8a7db5a90e5d7c60 (patch) | |
tree | 3ddf69635a4d6ac4ea780f8178d67b08b2eca8fa /intern/cycles/kernel/geom | |
parent | e82876589f81961f42ee7f858b15d3b662c1c6b0 (diff) |
Cycles: Fix wrong SSS intersection refinement when this option is disabled
The code is disabled by default, but we'd better keep it all correct.
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r-- | intern/cycles/kernel/geom/geom_triangle_intersect.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h b/intern/cycles/kernel/geom/geom_triangle_intersect.h index d37e593005c..5947945ccc6 100644 --- a/intern/cycles/kernel/geom/geom_triangle_intersect.h +++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h @@ -382,7 +382,6 @@ ccl_device_inline float3 triangle_refine_subsurface(KernelGlobals *kg, float3 D = ray->D; float t = isect->t; -#ifdef __INTERSECTION_REFINE__ if(isect->object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ Transform tfm = ccl_fetch(sd, ob_itfm); @@ -399,6 +398,7 @@ ccl_device_inline float3 triangle_refine_subsurface(KernelGlobals *kg, P = P + D*t; +#ifdef __INTERSECTION_REFINE__ const float4 tri_a = kernel_tex_fetch(__tri_woop, isect->prim*TRI_NODE_SIZE+0), tri_b = kernel_tex_fetch(__tri_woop, isect->prim*TRI_NODE_SIZE+1), tri_c = kernel_tex_fetch(__tri_woop, isect->prim*TRI_NODE_SIZE+2); @@ -410,6 +410,7 @@ ccl_device_inline float3 triangle_refine_subsurface(KernelGlobals *kg, float rt = dot(edge2, qvec) / dot(edge1, pvec); P = P + D*rt; +#endif /* __INTERSECTION_REFINE__ */ if(isect->object != OBJECT_NONE) { #ifdef __OBJECT_MOTION__ @@ -424,9 +425,6 @@ ccl_device_inline float3 triangle_refine_subsurface(KernelGlobals *kg, } return P; -#else - return P + D*t; -#endif } #undef IDX |