From 4fce9c8f1eb274aa216ed550efd232c768af260e Mon Sep 17 00:00:00 2001 From: Promit Roy Date: Fri, 3 Nov 2023 18:44:10 -0400 Subject: [PATCH] Added support for basisu extension to GLTF2 importer --- code/AssetLib/glTF2/glTF2Asset.inl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 53ffdaf31..0f989615a 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -1181,6 +1181,14 @@ inline void Texture::Read(Value &obj, Asset &r) { if (Value *samplerVal = FindUInt(obj, "sampler")) { sampler = r.samplers.Retrieve(samplerVal->GetUint()); } + + if (r.extensionsUsed.KHR_texture_basisu) { + if (Value *pKHR_texture_basisu = FindExtension(obj, "KHR_texture_basisu")) { + if (Value *sourceVal = FindUInt(*pKHR_texture_basisu, "source")) { + source = r.images.Retrieve(sourceVal->GetUint()); + } + } + } } void Material::SetTextureProperties(Asset &r, Value *prop, TextureInfo &out) {