We started to write our own implementation of mikktspace, but it
required an unindexed mesh for input. This was awkward because assimp is
already applying a pipeline of operations that includes tangent
generation and indexing. It felt reduandant to add our own pipeline on
top of that (unindexing => tangentgen => reindexing).
Since assimp's CalcTangentsProcess method is already producing
tangents that follow the orientation implied by texture coordinates,
this simply needs to be tweaked to match glTF. (flip the bitangent)
Also fixed a bug for the case where models have neither UV's nor
tangents, where we were calling norm instead of normalize. :)
* Revert "Rollback MeshAssimp enhancements."
This reverts commit b3dce967eb.
* Re-enable glTF support
* Start looking for texture ids at 1, not 0
* Detect if the importer is glTF
* glTF and regular materials both work
This caused regressions with some of our samples like vk_hellopbr:
- For the new 1x1 textures, RGB isn't accepted by Vulkan and Metal.
Currently these platforms require RGBA, although we plan on adding
reshaping functionality for the future.
- Too many texture samplers in a single shader, this causes a run time
error. This could be alleviated by creating an atlas.
- vk_hellopbr assumes that all materials have a "metallic" param.
Going forward, we plan on creating a new library that avoids MeshAssimp,
so for now let's just disable gltf_viewer.