summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/asset.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/gltf/asset.h')
-rw-r--r--indra/newview/gltf/asset.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/gltf/asset.h b/indra/newview/gltf/asset.h
index 8f28e5905f..ea3f7d480a 100644
--- a/indra/newview/gltf/asset.h
+++ b/indra/newview/gltf/asset.h
@@ -57,6 +57,21 @@ namespace LL
bool mPresent = false;
};
+ class TextureTransform : public Extension // KHR_texture_transform implementation
+ {
+ public:
+ vec2 mOffset = vec2(0.f, 0.f);
+ F32 mRotation = 0.f;
+ vec2 mScale = vec2(1.f, 1.f);
+ S32 mTexCoord = INVALID_INDEX;
+
+ // get the texture transform as a packed array of floats
+ // dst MUST point to at least 8 floats
+ void getPacked(F32* dst) const;
+
+ const TextureTransform& operator=(const Value& src);
+ void serialize(boost::json::object& dst) const;
+ };
class Material
{
@@ -82,9 +97,15 @@ namespace LL
S32 mIndex = INVALID_INDEX;
S32 mTexCoord = 0;
+ TextureTransform mTextureTransform;
+
bool operator==(const TextureInfo& rhs) const;
bool operator!=(const TextureInfo& rhs) const;
+ // get the UV channel that should be used for sampling this texture
+ // returns mTextureTransform.mTexCoord if present and valid, otherwise mTexCoord
+ S32 getTexCoord() const;
+
const TextureInfo& operator=(const Value& src);
void serialize(boost::json::object& dst) const;
};
@@ -135,6 +156,8 @@ namespace LL
bool mDoubleSided = false;
Unlit mUnlit;
+ bool isMultiUV() const;
+
const Material& operator=(const Value& src);
void serialize(boost::json::object& dst) const;
};