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/style.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/style.cpp')
-rw-r--r-- | assetFactory/style.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/assetFactory/style.cpp b/assetFactory/style.cpp index 12346a6..ea67fc2 100644 --- a/assetFactory/style.cpp +++ b/assetFactory/style.cpp @@ -30,7 +30,14 @@ Style::applyStyle( else { mesh.set_color(face, {}); if (auto mf = Persistence::ParseBase::getShared<const AssetFactory>("assetFactory")) { - auto coords = mf->getTextureCoords(texture); + const auto material = mf->getMaterialIndex(texture); + mesh.property(mesh.materialFaceProperty, face) = material; + static constexpr std::array<ModelFactoryTraits::TexCoord2D, 4> coords {{ + {0.f, 0.f}, + {1.f, 0.f}, + {1.f, 1.f}, + {0.f, 1.f}, + }}; auto coord = coords.begin(); // Wild assumption that face is a quad and the texture should apply linearly for (const auto & heh : mesh.fh_range(face)) { |