Files
filament/third_party/libassimp/tnt
Philip Rideout 84eb9547f5 Tangent-related fixups in MeshAssimp.
Assimp's CalcTangentSpace deviates from de facto glTF 2.0 so we were
compensating for this with an unconditional fixup in MeshAssimp. However
the fixup should apply only when CalcTangentSpace is active, i.e. when
the model is missing tangents.

This makes it so that NormalTangentMirrorTest (has tangents) and
NormalTangentTest (needs tangents) both look reasonable.

I also noticed that MeshAssimp was inexplicably applying
aiProcess_CalcTangentSpace twice: once as a flag, and once as a
post-process. I removed the latter.

This will be fixed in the upcoming cgltf-based loader, which will
use our officially-sanctioned utility method in VertexBuffer.

See #528
2019-02-20 13:29:44 -08:00
..
2018-12-04 13:46:32 -08:00

To update assimp use the following steps:

  • Download or checkout Assimp's source code assimp.org or from GitHub
  • In the Assimp directory, create an out/ directory and from there run cmake .. -DCMAKE_BUILD_TYPE=Release, then make -j
  • From out/ copy revision.h to the root of the assimp source tree
  • From out/ copy include/assimp/config.h to include/assimp/config.h in the root of the assimp source tree
  • Open tnt/CMakeLists.txt and update the lists of public headers, private headers and source files. All files present on disk can be listed but to speed up build times you should remove source files related to importers/exporters we do not use
  • Make sure to update the list of definitions that start with -DASSIMP_BUILD_NO_ to skip all the importers we do not want to use
  • Make sure the definition -DASSIMP_BUILD_NO_EXPORTER is still there to remove all exporters

In addition we recommend to remove the following directories:

  • samples/
  • test/
  • tools/

We do not use these directories and they take up unnecessary space on disk.

Other Changes

(1)

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