summaryrefslogtreecommitdiffstats
path: root/vertex_deformation.slang
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-11-01 12:07:18 -0700
committeryum <yum.food.vr@gmail.com>2025-11-01 12:07:18 -0700
commit74b584ac77384613226854fe368cdce2a5612939 (patch)
treea6e3bfdfc41b44b28e0897c1a10c50332f7bdca8 /vertex_deformation.slang
parent04c1976f17cb766961ed4dc0ad3ef26848188c00 (diff)
Adjust deform/undeform jacobian determinant factors
Diffstat (limited to 'vertex_deformation.slang')
-rw-r--r--vertex_deformation.slang4
1 files changed, 2 insertions, 2 deletions
diff --git a/vertex_deformation.slang b/vertex_deformation.slang
index 0791aa7..c683982 100644
--- a/vertex_deformation.slang
+++ b/vertex_deformation.slang
@@ -43,7 +43,7 @@
); \
float jac_det = determinant(jacobian); \
float3x3 itjac = inverse(transpose(jacobian), jac_det); \
- normal = mul(itjac, normal) * sign(jac_det); \
+ normal = mul(itjac, normal) * jac_det; \
tangent = mul(jacobian, tangent)
#define R3R3_UNDEFORM_NORMAL_AND_TANGENT(normal, tangent) \
@@ -55,7 +55,7 @@
float jac_det = determinant(jacobian); \
float3x3 inv_jac = inverse(jacobian, jac_det); \
float3x3 trans_jac = transpose(jacobian); \
- normal = mul(trans_jac, normal); \
+ normal = mul(trans_jac, normal) * jac_det; \
tangent = mul(inv_jac, tangent)
// Syntactic sugar - wraps the previous three macros.