diff --git a/indra/llprimitive/llgltfmaterial.cpp b/indra/llprimitive/llgltfmaterial.cpp
index 12af568b7e..94bc5ef74c 100644
--- a/indra/llprimitive/llgltfmaterial.cpp
+++ b/indra/llprimitive/llgltfmaterial.cpp
@@ -81,7 +81,7 @@ LLGLTFMaterial::LLGLTFMaterial()
#endif
}
-void LLGLTFMaterial::TextureTransform::getPacked(F32 (&packed)[8]) const
+void LLGLTFMaterial::TextureTransform::getPacked(Pack& packed) const
{
packed[0] = mScale.mV[VX];
packed[1] = mScale.mV[VY];
@@ -92,6 +92,15 @@ void LLGLTFMaterial::TextureTransform::getPacked(F32 (&packed)[8]) const
packed[3] = packed[6] = packed[7] = 0.f;
}
+void LLGLTFMaterial::TextureTransform::getPackedTight(PackTight& packed) const
+{
+ packed[0] = mScale.mV[VX];
+ packed[1] = mScale.mV[VY];
+ packed[2] = mRotation;
+ packed[3] = mOffset.mV[VX];
+ packed[4] = mOffset.mV[VY];
+}
+
bool LLGLTFMaterial::TextureTransform::operator==(const TextureTransform& other) const
{
return mOffset == other.mOffset && mScale == other.mScale && mRotation == other.mRotation;
diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h
index 90f1ecfa8f..7888ba3b05 100644
--- a/indra/llprimitive/llgltfmaterial.h
+++ b/indra/llprimitive/llgltfmaterial.h
@@ -68,7 +68,12 @@ public:
LLVector2 mScale = { 1.f, 1.f };
F32 mRotation = 0.f;
- void getPacked(F32 (&packed)[8]) const;
+ static const size_t PACK_SIZE = 8;
+ static const size_t PACK_TIGHT_SIZE = 5;
+ using Pack = F32[PACK_SIZE];
+ using PackTight = F32[PACK_TIGHT_SIZE];
+ void getPacked(Pack& packed) const;
+ void getPackedTight(PackTight& packed) const;
bool operator==(const TextureTransform& other) const;
bool operator!=(const TextureTransform& other) const { return !(*this == other); }
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 4e03882b7a..21541c8bc8 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1179,7 +1179,9 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("texture_metallic_roughness_transform"); // (GLTF)
mReservedUniforms.push_back("texture_emissive_transform"); // (GLTF)
- llassert(mReservedUniforms.size() == LLShaderMgr::TEXTURE_EMISSIVE_TRANSFORM+1);
+ mReservedUniforms.push_back("terrain_texture_transforms"); // (GLTF)
+
+ llassert(mReservedUniforms.size() == LLShaderMgr::TERRAIN_TEXTURE_TRANSFORMS +1);
mReservedUniforms.push_back("viewport");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 2f344c8105..3dfac3cf0a 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -58,6 +58,8 @@ public:
TEXTURE_METALLIC_ROUGHNESS_TRANSFORM, // "texture_metallic_roughness_transform" (GLTF)
TEXTURE_EMISSIVE_TRANSFORM, // "texture_emissive_transform" (GLTF)
+ TERRAIN_TEXTURE_TRANSFORMS, // "terrain_texture_transforms" (GLTF)
+
VIEWPORT, // "viewport"
LIGHT_POSITION, // "light_position"
LIGHT_DIRECTION, // "light_direction"
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index af63d6ff87..c3f9a64fd6 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -16828,6 +16828,226 @@
String
Value
00000000-0000-0000-0000-000000000000
+
+ LocalTerrainTransform1ScaleU
+
+ LocalTerrainTransform1ScaleV
+
+ LocalTerrainTransform1Rotation
+
+ LocalTerrainTransform1OffsetU
+
+ LocalTerrainTransform1OffsetV
+
+ LocalTerrainTransform2ScaleU
+
+ LocalTerrainTransform2ScaleV
+
+ LocalTerrainTransform2Rotation
+
+ LocalTerrainTransform2OffsetU
+
+ LocalTerrainTransform2OffsetV
+
+ LocalTerrainTransform3ScaleU
+
+ LocalTerrainTransform3ScaleV
+
+ LocalTerrainTransform3Rotation
+
+ LocalTerrainTransform3OffsetU
+
+ LocalTerrainTransform3OffsetV
+
+ LocalTerrainTransform4ScaleU
+
+ LocalTerrainTransform4ScaleV
+
+ LocalTerrainTransform4Rotation
+
+ LocalTerrainTransform4OffsetU
+
+ LocalTerrainTransform4OffsetV
+
PathfindingRetrieveNeighboringRegion