diff --git a/samples/app/MeshAssimp.cpp b/samples/app/MeshAssimp.cpp index af4e8c9401..78b9b17d9a 100644 --- a/samples/app/MeshAssimp.cpp +++ b/samples/app/MeshAssimp.cpp @@ -648,8 +648,6 @@ bool MeshAssimp::setFromFile(Asset& asset, std::map::packTangentFrame({tangent, bitangent, normal}); diff --git a/third_party/libassimp/code/CalcTangentsProcess.cpp b/third_party/libassimp/code/CalcTangentsProcess.cpp index 54e55fc5a7..a25fbb27c8 100644 --- a/third_party/libassimp/code/CalcTangentsProcess.cpp +++ b/third_party/libassimp/code/CalcTangentsProcess.cpp @@ -196,14 +196,14 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) } // tangent points in the direction where to positive X axis of the texture coord's would point in model space - // bitangent's points along the positive Y axis of the texture coord's, respectively + // bitangent's points along the negative Y axis of the texture coord's, respectively aiVector3D tangent, bitangent; tangent.x = (w.x * sy - v.x * ty) * dirCorrection; tangent.y = (w.y * sy - v.y * ty) * dirCorrection; tangent.z = (w.z * sy - v.z * ty) * dirCorrection; - bitangent.x = (w.x * sx - v.x * tx) * dirCorrection; - bitangent.y = (w.y * sx - v.y * tx) * dirCorrection; - bitangent.z = (w.z * sx - v.z * tx) * dirCorrection; + bitangent.x = (v.x * tx - w.x * sx) * dirCorrection; + bitangent.y = (v.y * tx - w.y * sx) * dirCorrection; + bitangent.z = (v.z * tx - w.z * sx) * dirCorrection; // store for every vertex of that face for( unsigned int b = 0; b < face.mNumIndices; ++b ) { diff --git a/third_party/libassimp/tnt/README.md b/third_party/libassimp/tnt/README.md index 9eae75e58c..e14adb70e4 100644 --- a/third_party/libassimp/tnt/README.md +++ b/third_party/libassimp/tnt/README.md @@ -29,3 +29,7 @@ In glTF2Importer.cpp, change from: ai_anim->mNumChannels = r.skins[0].jointNames.size(); to: ai_anim->mNumChannels = r.skins.Size() > 0 ? r.skins[0].jointNames.size() : 0; + +(2) + +Negate the bitangent in CalcTangentsProcess.cpp