Bläddra i källkod

+ Only up to recognizing the KTX2 compressed image as a texture object is handled. (#6139)

copycd 2 månader sedan
förälder
incheckning
536cd59807
1 ändrade filer med 12 tillägg och 0 borttagningar
  1. 12 0
      code/AssetLib/glTF2/glTF2Asset.inl

+ 12 - 0
code/AssetLib/glTF2/glTF2Asset.inl

@@ -1220,6 +1220,17 @@ inline void Texture::Read(Value &obj, Asset &r) {
     if (Value *samplerVal = FindUInt(obj, "sampler")) {
     if (Value *samplerVal = FindUInt(obj, "sampler")) {
         sampler = r.samplers.Retrieve(samplerVal->GetUint());
         sampler = r.samplers.Retrieve(samplerVal->GetUint());
     }
     }
+
+    if (Value *extensions = FindObject(obj, "extensions")) {
+        if (r.extensionsUsed.KHR_texture_basisu) {
+            if (Value *curBasisU = FindObject(*extensions, "KHR_texture_basisu")) {
+
+                if (Value *sourceVal = FindUInt(*curBasisU, "source")) {
+                    source = r.images.Retrieve(sourceVal->GetUint());
+                }
+            }
+        }
+    }
 }
 }
 
 
 void Material::SetTextureProperties(Asset &r, Value *prop, TextureInfo &out) {
 void Material::SetTextureProperties(Asset &r, Value *prop, TextureInfo &out) {
@@ -2145,6 +2156,7 @@ inline void Asset::ReadExtensionsRequired(Document &doc) {
     }
     }
 
 
     CHECK_REQUIRED_EXT(KHR_draco_mesh_compression);
     CHECK_REQUIRED_EXT(KHR_draco_mesh_compression);
+    CHECK_REQUIRED_EXT(KHR_texture_basisu);
 
 
 #undef CHECK_REQUIRED_EXT
 #undef CHECK_REQUIRED_EXT
 }
 }