diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-08-01 17:07:10 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-08-02 15:17:10 +0300 |
commit | 25a0124bc890a3390ef7738707f218f50a8d8ac3 (patch) | |
tree | 10dc8762563b8741d055304174de50cdbaef329d /intern/cycles/util | |
parent | 588791df637a078aae20250022bc5fcd1fc07d1a (diff) |
Fix T100119: Light object's parametric vector distorted in blender 3.4
Caused by 38af5b050100.
Adjust barycentric coordinates used for intersection result in the
ray-to-rectangle intersection check.
Differential Revision: https://developer.blender.org/D15592
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/math_intersect.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/util/math_intersect.h b/intern/cycles/util/math_intersect.h index 37bdc5f1ccf..cc07cbe7745 100644 --- a/intern/cycles/util/math_intersect.h +++ b/intern/cycles/util/math_intersect.h @@ -209,10 +209,13 @@ ccl_device bool ray_quad_intersect(float3 ray_P, *isect_P = hit; if (isect_t != NULL) *isect_t = t; + + /* NOTE: Return barycentric coordinates in the same notation as Embree and OptiX. */ if (isect_u != NULL) - *isect_u = u + 0.5f; + *isect_u = v + 0.5f; if (isect_v != NULL) - *isect_v = v + 0.5f; + *isect_v = -u - v; + return true; } |