Skip to content

Commit

Permalink
Reverted bitangent calculation to ASSIMP's good old code in model.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesugb committed Apr 23, 2024
1 parent 16f3320 commit 7acd96c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions auto_vk_toolkit/src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,17 +1489,17 @@ namespace avk
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 = (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;

// store for every vertex of that face
for (unsigned int b = 0; b < face.mNumIndices; ++b) {
unsigned int p = face.mIndices[b];

// project tangent and bitangent into the plane formed by the vertex' normal
aiVector3D localTangent = tangent - meshNorm[p] * (tangent * meshNorm[p]);
aiVector3D localBitangent = bitangent - meshNorm[p] * (bitangent * meshNorm[p]) - localTangent * (bitangent * localTangent);
aiVector3D localBitangent = bitangent - meshNorm[p] * (bitangent * meshNorm[p]);
localTangent.NormalizeSafe();
localBitangent.NormalizeSafe();

Expand Down

0 comments on commit 7acd96c

Please sign in to comment.