From 32a2da41e0946c1d6d364b7763d1829bfa8b74db Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 14 Apr 2023 16:36:22 +0100 Subject: Configure texture fragment mapmode from material --- assetFactory/assimp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'assetFactory/assimp.cpp') diff --git a/assetFactory/assimp.cpp b/assetFactory/assimp.cpp index 9a49717..840c5a9 100644 --- a/assetFactory/assimp.cpp +++ b/assetFactory/assimp.cpp @@ -85,6 +85,11 @@ public: } }; +static_assert(TextureOptions::MapMode::Repeat == static_cast(aiTextureMapMode_Wrap)); +static_assert(TextureOptions::MapMode::Clamp == static_cast(aiTextureMapMode_Clamp)); +static_assert(TextureOptions::MapMode::Decal == static_cast(aiTextureMapMode_Decal)); +static_assert(TextureOptions::MapMode::Mirror == static_cast(aiTextureMapMode_Mirror)); + void AssImp::postLoad() { @@ -107,6 +112,8 @@ AssImp::postLoad() auto texture = std::make_shared(); texture->id = m->GetName().C_Str(); texture->path = path.C_Str(); + m->Get(AI_MATKEY_MAPPINGMODE_U_DIFFUSE(0), texture->mapmodeU); + m->Get(AI_MATKEY_MAPPINGMODE_V_DIFFUSE(0), texture->mapmodeV); texture->image = Worker::addWork([t = scene->GetEmbeddedTexture(path.C_Str())]() { return std::make_unique( std::span {reinterpret_cast(t->pcData), t->mWidth}, STBI_rgb_alpha); -- cgit v1.2.3