Skip to content

Commit 5ac237e

Browse files
GLTF Model: added GetTextureDesc method
1 parent 504d967 commit 5ac237e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

AssetLoader/interface/GLTFLoader.hpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,25 @@ struct Model
897897
return nullptr;
898898
}
899899

900+
const TextureDesc& GetTextureDesc(Uint32 Index) const
901+
{
902+
if (Index < Textures.size())
903+
{
904+
const auto& TexInfo = Textures[Index];
905+
if (TexInfo.pTexture)
906+
{
907+
return TexInfo.pTexture->GetDesc();
908+
}
909+
else if (auto* pAtlas = (TexInfo.pAtlasSuballocation ? TexInfo.pAtlasSuballocation->GetAtlas() : nullptr))
910+
{
911+
return pAtlas->GetAtlasDesc();
912+
}
913+
}
914+
915+
static const TextureDesc NullDesc{};
916+
return NullDesc;
917+
}
918+
900919
Uint32 GetFirstIndexLocation() const
901920
{
902921
VERIFY(IndexData.IndexSize != 0, "Index size is not initialized");

0 commit comments

Comments
 (0)