Fixed cloth tangent generation (from 'stabilization/2106' @26c9853f)

- The output vectors were not properly filled with zeros when they already had the expected size.
- The tolerance was too large and was causing patches while computing tangents and bitangents.
- The handedness was inverted to what is expected in the shader (which always inverts tangent's w).

Signed-off-by: moraaar <moraaar@amazon.com>
This commit is contained in:
moraaar
2021-07-28 13:14:56 +01:00
committed by GitHub
parent 5662cb551e
commit d38f17131e
3 changed files with 23 additions and 11 deletions
@@ -578,7 +578,7 @@ namespace NvCloth
const AZ::Vector3& renderTangent = renderTangents[renderVertexIndex];
destTangentsBuffer[index].Set(
renderTangent,
1.0f);
-1.0f); // Shader function ConstructTBN inverts w to change bitangent sign, but the bitangents passed are already corrected, so passing -1.0 to counteract.
}
if (destBitangentsBuffer)