|
|
@@ -800,8 +800,20 @@ inline void Texture::Read(Value& obj, Asset& r)
|
|
|
}
|
|
|
|
|
|
namespace {
|
|
|
- inline void SetTextureProperties(Asset& r, Value* prop, TextureInfo& out)
|
|
|
- {
|
|
|
+ inline void SetTextureProperties(Asset& r, Value* prop, TextureInfo& out) {
|
|
|
+ if (r.extensionsUsed.KHR_texture_transform) {
|
|
|
+ if (Value *extensions = FindObject(*prop, "extensions")) {
|
|
|
+ if (Value *pKHR_texture_transform = FindObject(*extensions, "KHR_texture_transform")) {
|
|
|
+ if (Value *array = FindArray(*pKHR_texture_transform, "offset")) {
|
|
|
+ out.offset[0] = (*array)[0].GetFloat();
|
|
|
+ out.offset[1] = (*array)[1].GetFloat();
|
|
|
+ }
|
|
|
+ ReadMember(*pKHR_texture_transform, "rotation", out.rotation);
|
|
|
+ ReadMember(*pKHR_texture_transform, "scale", *out.scale);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (Value* index = FindUInt(*prop, "index")) {
|
|
|
out.texture = r.textures.Retrieve(index->GetUint());
|
|
|
}
|
|
|
@@ -877,6 +889,9 @@ inline void Material::Read(Value& material, Asset& r)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (r.extensionsUsed.KHR_texture_transform) {
|
|
|
+ }
|
|
|
+
|
|
|
unlit = nullptr != FindObject(*extensions, "KHR_materials_unlit");
|
|
|
}
|
|
|
}
|
|
|
@@ -1463,12 +1478,10 @@ inline void Asset::ReadExtensionsUsed(Document& doc)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- #define CHECK_EXT(EXT) \
|
|
|
- if (exts.find(#EXT) != exts.end()) extensionsUsed.EXT = true;
|
|
|
-
|
|
|
CHECK_EXT(KHR_materials_pbrSpecularGlossiness);
|
|
|
CHECK_EXT(KHR_materials_unlit);
|
|
|
CHECK_EXT(KHR_lights_punctual);
|
|
|
+ CHECK_EXT(KHR_texture_transform);
|
|
|
|
|
|
#undef CHECK_EXT
|
|
|
}
|