Apply the correct transform on normals (remove transform & scaling components)
This commit is contained in:
parent
a9c4fb1bd0
commit
9c2e485cfc
|
@ -739,7 +739,10 @@ static void ReadMesh(RawModel &raw, FbxScene *pScene, FbxNode *pNode, const std:
|
|||
const FbxVector4 meshScaling = pNode->GetGeometricScaling(FbxNode::eSourcePivot);
|
||||
const FbxAMatrix meshTransform(meshTranslation, meshRotation, meshScaling);
|
||||
const FbxMatrix transform = meshTransform;
|
||||
const FbxMatrix inverseTransposeTransform = transform.Inverse().Transpose();
|
||||
|
||||
// Remove translation & scaling from transforms that will bi applied to normals, tangents & binormals
|
||||
const FbxMatrix normalTransform(FbxVector4(), meshRotation, FbxVector4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
const FbxMatrix inverseTransposeTransform = normalTransform.Inverse().Transpose();
|
||||
|
||||
raw.AddVertexAttribute(RAW_VERTEX_ATTRIBUTE_POSITION);
|
||||
if (normalLayer.LayerPresent()) { raw.AddVertexAttribute(RAW_VERTEX_ATTRIBUTE_NORMAL); }
|
||||
|
|
Loading…
Reference in New Issue