Merge pull request #48 from davilovick/fix_normal_issues

This commit is contained in:
Pär Winzell 2017-12-03 11:58:09 -08:00 committed by GitHub
commit cc0a6e5b89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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, meshScaling);
const FbxMatrix inverseTransposeTransform = normalTransform.Inverse().Transpose();
raw.AddVertexAttribute(RAW_VERTEX_ATTRIBUTE_POSITION);
if (normalLayer.LayerPresent()) { raw.AddVertexAttribute(RAW_VERTEX_ATTRIBUTE_NORMAL); }