Re-enable glTF support (#505)

* 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 commit is contained in:
Romain Guy
2018-11-26 13:14:28 -08:00
committed by GitHub
parent cf4410f656
commit 20ffb52dc2
5 changed files with 585 additions and 51 deletions

View File

@@ -32,7 +32,7 @@ using Backend = Engine::Backend;
struct App {
utils::Entity light;
std::map<std::string, MaterialInstance*> materials;
MeshAssimp* meshes;
MeshAssimp* meshes = nullptr;
mat4f transform;
};
@@ -65,7 +65,9 @@ int main(int argc, char** argv) {
// Enable the metallic surface property to observe reflections.
for (auto& pair : app.materials) {
pair.second->setParameter("metallic", 1.0f);
if (pair.second->getMaterial()->hasParameter("metallic")) {
pair.second->setParameter("metallic", 1.0f);
}
}
// Add light sources into the scene.