diff options
| author | yum <yum.food.vr@gmail.com> | 2025-11-01 12:07:18 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-11-01 12:07:18 -0700 |
| commit | 74b584ac77384613226854fe368cdce2a5612939 (patch) | |
| tree | a6e3bfdfc41b44b28e0897c1a10c50332f7bdca8 /vertex_deformation.slang | |
| parent | 04c1976f17cb766961ed4dc0ad3ef26848188c00 (diff) | |
Adjust deform/undeform jacobian determinant factors
Diffstat (limited to 'vertex_deformation.slang')
| -rw-r--r-- | vertex_deformation.slang | 4 |
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. |
