[Bf-blender-cvs] [25a0124bc89] master: Fix T100119: Light object's parametric vector distorted in blender 3.4

Sergey Sharybin noreply at git.blender.org
Tue Aug 2 14:17:21 CEST 2022


Commit: 25a0124bc890a3390ef7738707f218f50a8d8ac3
Author: Sergey Sharybin
Date:   Mon Aug 1 16:07:10 2022 +0200
Branches: master
https://developer.blender.org/rB25a0124bc890a3390ef7738707f218f50a8d8ac3

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

===================================================================

M	intern/cycles/util/math_intersect.h

===================================================================

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;
 }



More information about the Bf-blender-cvs mailing list