diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-13 23:06:39 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-13 23:06:39 +0100 |
commit | 1c8e84d9503237e7a308107a0a44fbc7f188c700 (patch) | |
tree | 60e80d7f4e91621bc62cb5fb2f6c61aae631b4d9 /assetFactory/factoryMesh.cpp | |
parent | Load assimp textures in parallel (diff) | |
parent | Fix typo in name SceneCPtr (diff) | |
download | ilt-1c8e84d9503237e7a308107a0a44fbc7f188c700.tar.bz2 ilt-1c8e84d9503237e7a308107a0a44fbc7f188c700.tar.xz ilt-1c8e84d9503237e7a308107a0a44fbc7f188c700.zip |
Merge branch 'materials' into assimp
Diffstat (limited to 'assetFactory/factoryMesh.cpp')
-rw-r--r-- | assetFactory/factoryMesh.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/assetFactory/factoryMesh.cpp b/assetFactory/factoryMesh.cpp index 4922936..f7bc7c8 100644 --- a/assetFactory/factoryMesh.cpp +++ b/assetFactory/factoryMesh.cpp @@ -18,6 +18,7 @@ FactoryMesh::createMesh() const for (const auto & face : mesh.faces()) { const auto & smooth = mesh.property(mesh.smoothFaceProperty, face); const auto & colour = mesh.color(face); + const auto & material = mesh.property(mesh.materialFaceProperty, face); std::vector<unsigned int> faceIndices; for (const auto & heh : mesh.fh_range(face)) { @@ -26,7 +27,7 @@ FactoryMesh::createMesh() const const auto & point = mesh.point(vertex); const auto & normal = smooth ? mesh.property(mesh.vertex_normals_pph(), vertex) : mesh.property(mesh.face_normals_pph(), face); - Vertex outVertex {point, textureUV, normal, colour}; + Vertex outVertex {point, textureUV, normal, colour, material}; if (const auto existingItr = std::find(vertices.rbegin(), vertices.rend(), outVertex); existingItr != vertices.rend()) { faceIndices.push_back(static_cast<unsigned int>(std::distance(existingItr, vertices.rend()) - 1)); |