[Bf-blender-cvs] [1c2c468abc9] blender-v3.3-release: Fix T100134: Cycles faceted triangle normals with motion blur

Brecht Van Lommel noreply at git.blender.org
Thu Aug 4 19:15:43 CEST 2022


Commit: 1c2c468abc9ecbc09eb87eff4da2023ea506d606
Author: Brecht Van Lommel
Date:   Thu Aug 4 19:08:45 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB1c2c468abc9ecbc09eb87eff4da2023ea506d606

Fix T100134: Cycles faceted triangle normals with motion blur

After recent changes to change barycentric coordinate convention.

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

M	intern/cycles/kernel/geom/motion_triangle_shader.h

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

diff --git a/intern/cycles/kernel/geom/motion_triangle_shader.h b/intern/cycles/kernel/geom/motion_triangle_shader.h
index 236e737b785..413a61b380a 100644
--- a/intern/cycles/kernel/geom/motion_triangle_shader.h
+++ b/intern/cycles/kernel/geom/motion_triangle_shader.h
@@ -68,8 +68,8 @@ ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals kg,
   sd->N = Ng;
   /* Compute derivatives of P w.r.t. uv. */
 #ifdef __DPDU__
-  sd->dPdu = (verts[0] - verts[2]);
-  sd->dPdv = (verts[1] - verts[2]);
+  sd->dPdu = (verts[1] - verts[0]);
+  sd->dPdv = (verts[2] - verts[0]);
 #endif
   /* Compute smooth normal. */
   if (sd->shader & SHADER_SMOOTH_NORMAL) {
@@ -89,7 +89,7 @@ ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals kg,
     float u = sd->u;
     float v = sd->v;
     float w = 1.0f - u - v;
-    sd->N = (u * normals[0] + v * normals[1] + w * normals[2]);
+    sd->N = (w * normals[0] + u * normals[1] + v * normals[2]);
   }
 }



More information about the Bf-blender-cvs mailing list