diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-08-01 17:07:10 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-09 16:56:03 +0300 |
commit | cefd6140f322250d630f4d845fe5bdb013c00ddc (patch) | |
tree | 39893b1cf796ed590b40abf6dc4c8bdea14ffb89 /intern/cycles | |
parent | 7b0bc1573b02198ec71f808fa1f6d1a2c6b79524 (diff) |
Fix T100119: Cycles light object's parametric vector distorted
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')
-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; } |