summaryrefslogtreecommitdiff
path: root/assetFactory/assimp.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-13 02:20:50 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-13 02:20:50 +0100
commit1b97b7b4cb126c8b60ac1acbd7e72274f0ddf21f (patch)
tree5271470d667c2d1b3372848d60bbcb04a011f2fe /assetFactory/assimp.cpp
parentAdd missing forward declaration (diff)
downloadilt-1b97b7b4cb126c8b60ac1acbd7e72274f0ddf21f.tar.bz2
ilt-1b97b7b4cb126c8b60ac1acbd7e72274f0ddf21f.tar.xz
ilt-1b97b7b4cb126c8b60ac1acbd7e72274f0ddf21f.zip
Use texture atlas for asset factory
Diffstat (limited to 'assetFactory/assimp.cpp')
-rw-r--r--assetFactory/assimp.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/assetFactory/assimp.cpp b/assetFactory/assimp.cpp
index 0c6cb86..dd82105 100644
--- a/assetFactory/assimp.cpp
+++ b/assetFactory/assimp.cpp
@@ -64,11 +64,11 @@ public:
};
const auto & m = *scene->mMaterials[amesh->mMaterialIndex];
- AssetFactory::TextureFragmentCoords tfc;
+ GLuint material {};
if (auto mf = Persistence::ParseBase::getShared<AssetFactory>("assetFactory")) {
aiString path;
m.Get(AI_MATKEY_TEXTURE_DIFFUSE(0), path);
- tfc = mf->getTextureCoords(path.C_Str());
+ material = mf->getMaterialIndex(path.C_Str());
}
for (const auto & f : AIRANGE(amesh, Faces)) {
@@ -79,8 +79,8 @@ public:
if (amesh->HasTextureCoords(0)) {
for (auto idx = f.mIndices; const auto fheh : mesh.fh_range(fh)) {
const auto ouv = !amesh->mTextureCoords[0][*idx++];
- const auto uv = glm::mix(tfc[0], tfc[2], ouv);
- mesh.set_texcoord2D(fheh, uv);
+ mesh.set_texcoord2D(fheh, ouv);
+ mesh.property(mesh.materialFaceProperty, fh) = material;
}
}
}