From f84064396b5d1731cef591be997b68e05b8fd1a3 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:15:18 +0100
Subject: [PATCH 01/29] feat(g1 mesh land impact): add
OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactMath.cs
---
.../World/Land/OglMeshLandImpactMath.cs | 72 +++++++++++++++++++
1 file changed, 72 insertions(+)
create mode 100644 OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactMath.cs
diff --git a/OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactMath.cs b/OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactMath.cs
new file mode 100644
index 00000000..c07606ea
--- /dev/null
+++ b/OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactMath.cs
@@ -0,0 +1,72 @@
+// SPDX-License-Identifier: BSD-3-Clause
+using System;
+
+namespace OpenSim.Region.CoreModules.World.Land
+{
+ ///
+ /// Pure, deterministic land-impact arithmetic. The inputs are costs for
+ /// the ENTIRE linked object, not rounded per-part costs.
+ ///
+ public static class OglMeshLandImpactMath
+ {
+ public static double ServerWeight(int partCount, int scriptCount, bool physical)
+ {
+ if (partCount <= 0)
+ return 0;
+ if (physical)
+ return partCount;
+ double weight = 0.5 * partCount;
+ if (scriptCount > 1)
+ weight += 0.25 * (scriptCount - 1);
+ return Math.Min(partCount, weight);
+ }
+
+ public static int LandImpact(int partCount, bool containsMesh,
+ double streaming, double physics, double server)
+ {
+ if (partCount <= 0)
+ return 0;
+ if (!containsMesh)
+ return partCount;
+ // Missing / malformed cost inputs cannot grant a discount.
+ if (!double.IsFinite(streaming) || !double.IsFinite(physics) ||
+ !double.IsFinite(server) || streaming < 0 || physics < 0 || server < 0)
+ return partCount;
+ double highest = Math.Max(streaming, Math.Max(physics, server));
+ if (highest >= int.MaxValue)
+ return int.MaxValue;
+ return Math.Max(1, (int)Math.Ceiling(highest));
+ }
+
+ ///
+ /// Mirrors the four-LOD weighted download model used by the built-in
+ /// model uploader (MeshCost.cs), from compressed per-LOD byte lengths.
+ ///
+ public static double StreamingWeight(int high, int medium, int low,
+ int lowest, double squaredDiameter)
+ {
+ if (high <= 0 || !double.IsFinite(squaredDiameter) || squaredDiameter <= 0)
+ return double.NaN;
+ medium = medium > 0 ? medium : high;
+ low = low > 0 ? low : medium;
+ lowest = lowest > 0 ? lowest : low;
+
+ double ah = Math.Min(262144.0, squaredDiameter * 17.36);
+ double am = Math.Min(262144.0, squaredDiameter * 277.78);
+ double al = Math.Min(262144.0, squaredDiameter * 1111.11);
+ double ae = 262144.0;
+
+ double wh = Math.Max(1.0, ah);
+ double wm = Math.Max(1.0, am - ah);
+ double wl = Math.Max(1.0, al - am);
+ double we = Math.Max(1.0, ae - al);
+ double totalArea = wh + wm + wl + we;
+
+ double h = Math.Max(16, high - 384);
+ double m = Math.Max(16, medium - 384);
+ double l = Math.Max(16, low - 384);
+ double e = Math.Max(16, lowest - 384);
+ return 0.004 * (h * wh + m * wm + l * wl + e * we) / totalArea;
+ }
+ }
+}
From 907a08af11a0594d46fa549e0deeae170cc7902b Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:15:21 +0100
Subject: [PATCH 02/29] feat(g1 mesh land impact): add
tools/ci/OglMeshLandImpactRegression/OglMeshLandImpactRegression.csproj
---
.../OglMeshLandImpactRegression.csproj | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 tools/ci/OglMeshLandImpactRegression/OglMeshLandImpactRegression.csproj
diff --git a/tools/ci/OglMeshLandImpactRegression/OglMeshLandImpactRegression.csproj b/tools/ci/OglMeshLandImpactRegression/OglMeshLandImpactRegression.csproj
new file mode 100644
index 00000000..e4bc7919
--- /dev/null
+++ b/tools/ci/OglMeshLandImpactRegression/OglMeshLandImpactRegression.csproj
@@ -0,0 +1,11 @@
+
+
+ net10.0
+ Exe
+ enable
+ enable
+
+
+
+
+
From 79d5e71fe384299029b9150b5b26e3589e3338aa Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:15:23 +0100
Subject: [PATCH 03/29] feat(g1 mesh land impact): add
tools/ci/OglMeshLandImpactRegression/Program.cs
---
.../ci/OglMeshLandImpactRegression/Program.cs | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 tools/ci/OglMeshLandImpactRegression/Program.cs
diff --git a/tools/ci/OglMeshLandImpactRegression/Program.cs b/tools/ci/OglMeshLandImpactRegression/Program.cs
new file mode 100644
index 00000000..50efa97b
--- /dev/null
+++ b/tools/ci/OglMeshLandImpactRegression/Program.cs
@@ -0,0 +1,24 @@
+using OpenSim.Region.CoreModules.World.Land;
+
+static void Check(bool success, string what)
+{
+ if (!success) throw new InvalidOperationException("Mesh LI regression failed: " + what);
+}
+Check(OglMeshLandImpactMath.LandImpact(10, false, 0, 0, 5) == 10, "classic 10-prims count 10");
+Check(OglMeshLandImpactMath.ServerWeight(10, 0, false) == 5, "10 static mesh parts have server weight 5");
+Check(OglMeshLandImpactMath.LandImpact(10, true, 2, 3, 5) == 5, "10 optimized mesh parts have 5 LI");
+Check(OglMeshLandImpactMath.LandImpact(1, true, 0.05, 0.10, 0.5) == 1, "single mesh at least one LI");
+Check(OglMeshLandImpactMath.LandImpact(3, true, 0.3, 0.6, 1.5) == 2, "round linked object only once");
+Check(OglMeshLandImpactMath.LandImpact(10, true, 15.1, 1, 5) == 16, "high download cost raises impact");
+Check(OglMeshLandImpactMath.LandImpact(10, true, 0.1, 20, 5) == 20, "complex physics raises impact");
+Check(OglMeshLandImpactMath.ServerWeight(10, 0, true) == 10, "physical no static discount");
+Check(OglMeshLandImpactMath.ServerWeight(10, 5, false) == 6, "script cost contributes");
+Check(OglMeshLandImpactMath.ServerWeight(10, 300, false) == 10, "script weight bounded at parts");
+Check(OglMeshLandImpactMath.LandImpact(10, true, double.NaN, 0, 5) == 10, "invalid weights fail closed");
+Check(OglMeshLandImpactMath.LandImpact(10, true, -1, 0, 5) == 10, "negative weights fail closed");
+Check(OglMeshLandImpactMath.LandImpact(0, true, 1, 1, 1) == 0, "empty object");
+Check(OglMeshLandImpactMath.StreamingWeight(400, 300, 200, 100, 3) > 0, "valid mesh LOD streaming");
+Check(OglMeshLandImpactMath.StreamingWeight(80000, 50000, 20000, 10000, 12) >
+ OglMeshLandImpactMath.StreamingWeight(800, 500, 200, 100, 12), "large LOD costs more");
+Check(double.IsNaN(OglMeshLandImpactMath.StreamingWeight(0, 0, 0, 0, 1)), "invalid LOD fails closed");
+Console.WriteLine("OpenGenesisLINK G1 mesh land impact arithmetic: PASS");
From 233f896236558a6598d52aaddb53d8176cdeeac8 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:16:36 +0100
Subject: [PATCH 04/29] feat(g1): compute bounded mesh LOD, convex physics and
static/server land impact per linkset
---
.../World/Land/OglMeshLandImpactCalculator.cs | 264 ++++++++++++++++++
1 file changed, 264 insertions(+)
create mode 100644 OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactCalculator.cs
diff --git a/OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactCalculator.cs b/OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactCalculator.cs
new file mode 100644
index 00000000..6a284858
--- /dev/null
+++ b/OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactCalculator.cs
@@ -0,0 +1,264 @@
+// SPDX-License-Identifier: BSD-3-Clause
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.Compression;
+using OpenMetaverse;
+using OpenMetaverse.StructuredData;
+using OpenSim.Framework;
+using OpenSim.Region.Framework.Scenes;
+
+namespace OpenSim.Region.CoreModules.World.Land
+{
+ ///
+ /// Optional, region-scoped mesh land-impact estimator. Reads the same
+ /// compressed LOD lengths as the model upload cost calculator. Does not
+ /// alter linkset part counts, script link numbers, or persisted assets.
+ ///
+ internal sealed class OglMeshLandImpactCalculator
+ {
+ private const int MaxCachedMeshAssets = 8192;
+ private const int MaxMeshBytesToInspect = 64 * 1024 * 1024;
+ private const int MaxConvexBytesToDecode = 128 * 1024;
+ private const int MaxDecodedConvexBytes = 256 * 1024;
+ private readonly Scene m_scene;
+ private readonly Dictionary m_cache = new();
+ private readonly object m_cacheLock = new();
+
+ internal OglMeshLandImpactCalculator(Scene scene)
+ {
+ m_scene = scene ?? throw new ArgumentNullException(nameof(scene));
+ }
+
+ internal int GetLandImpact(SceneObjectGroup group)
+ {
+ GetWeights(group, out bool containsMesh, out double streaming,
+ out double physics, out double server);
+ return OglMeshLandImpactMath.LandImpact(
+ group?.PrimCount ?? 0, containsMesh, streaming, physics, server);
+ }
+
+ internal void GetWeights(SceneObjectGroup group, out bool containsMesh,
+ out double streaming, out double physics, out double server)
+ {
+ containsMesh = false;
+ streaming = physics = server = 0;
+ if (group is null || group.IsDeleted || group.IsAttachment)
+ return;
+
+ SceneObjectPart[] parts = group.Parts;
+ if (parts is null || parts.Length == 0)
+ return;
+
+ // The legacy primitive accounting remains unchanged when no mesh
+ // is present in a linkset.
+ foreach (SceneObjectPart part in parts)
+ {
+ if (IsMesh(part))
+ {
+ containsMesh = true;
+ break;
+ }
+ }
+ if (!containsMesh)
+ {
+ streaming = physics = server = parts.Length;
+ return;
+ }
+
+ server = OglMeshLandImpactMath.ServerWeight(
+ parts.Length, group.ScriptCount(), group.UsesPhysics);
+ foreach (SceneObjectPart part in parts)
+ {
+ if (part is null || !IsMesh(part))
+ {
+ // Classic prims in a mixed linkset retain conservative cost.
+ streaming += 1.0;
+ physics += 1.0;
+ continue;
+ }
+
+ MeshMetrics metrics = GetMeshMetrics(part.Shape.SculptTexture);
+ if (!metrics.Valid)
+ {
+ // Unknown, unavailable, oversize, or malformed mesh assets
+ // never gain an automatic land quota discount.
+ streaming += 1.0;
+ physics += 1.0;
+ continue;
+ }
+
+ double streamingWeight = OglMeshLandImpactMath.StreamingWeight(
+ metrics.High, metrics.Medium, metrics.Low, metrics.Lowest,
+ part.Scale.LengthSquared());
+ streaming += double.IsFinite(streamingWeight)
+ ? Math.Max(0.01, streamingWeight) : 1.0;
+
+ if (part.PhysicsShapeType == (byte)PhysShapeType.none)
+ continue;
+
+ if (part.PhysicsShapeType == (byte)PhysShapeType.convex)
+ {
+ // Same per-vertex convex weighting as the existing mesh
+ // uploader, with actual physics actor weight as a floor.
+ double hull = metrics.ConvexVertices > 0
+ ? 0.04 * (metrics.ConvexVertices + 1) : 1.0;
+ physics += Math.Max(hull, SafePhysicsCost(part));
+ }
+ else
+ {
+ // Prim physics can use a detailed triangle collision
+ // shape. Never give it the low convex-hull discount.
+ physics += Math.Max(1.0, SafePhysicsCost(part));
+ }
+ }
+ }
+
+ internal static bool IsMesh(SceneObjectPart part)
+ {
+ return part?.Shape is not null &&
+ part.Shape.SculptType == (byte)SculptType.Mesh &&
+ part.Shape.SculptTexture.IsNotZero();
+ }
+
+ private static double SafePhysicsCost(SceneObjectPart part)
+ {
+ float cost = part.PhysicsCost;
+ return float.IsFinite(cost) && cost >= 0 ? cost : 1.0;
+ }
+
+ private MeshMetrics GetMeshMetrics(UUID assetId)
+ {
+ if (assetId.IsZero())
+ return default;
+
+ lock (m_cacheLock)
+ {
+ if (m_cache.TryGetValue(assetId, out MeshMetrics cached))
+ return cached;
+ }
+
+ MeshMetrics metrics = default;
+ try
+ {
+ AssetBase asset = m_scene.AssetService?.Get(assetId.ToString());
+ if (asset?.Data is byte[] data &&
+ data.Length > 0 && data.Length <= MaxMeshBytesToInspect)
+ metrics = ParseMesh(data);
+ }
+ catch (Exception) // Unavailable asset or malformed LLSD: fail closed.
+ {
+ metrics = default;
+ }
+
+ lock (m_cacheLock)
+ {
+ if (m_cache.Count >= MaxCachedMeshAssets)
+ m_cache.Clear();
+ m_cache[assetId] = metrics;
+ }
+ return metrics;
+ }
+
+ private static MeshMetrics ParseMesh(byte[] data)
+ {
+ using MemoryStream stream = new(data, writable: false);
+ if (OSDParser.DeserializeLLSDBinary(stream) is not OSDMap root)
+ return default;
+ long payloadOffset = stream.Position;
+ if (!TryReadSection(root, "high_lod", payloadOffset, data.Length,
+ out int high, out _, out _))
+ return default;
+
+ int medium = ReadOptionalSection(root, "medium_lod", payloadOffset, data.Length);
+ int low = ReadOptionalSection(root, "low_lod", payloadOffset, data.Length);
+ int lowest = ReadOptionalSection(root, "lowest_lod", payloadOffset, data.Length);
+ int vertices = ReadConvexVertices(root, payloadOffset, data);
+ return new MeshMetrics(true, high, medium, low, lowest, vertices);
+ }
+
+ private static int ReadOptionalSection(OSDMap root, string name,
+ long baseOffset, int dataLength)
+ {
+ return TryReadSection(root, name, baseOffset, dataLength,
+ out int size, out _, out _) ? size : 0;
+ }
+
+ private static bool TryReadSection(OSDMap root, string name,
+ long baseOffset, int dataLength, out int size,
+ out int offset, out int absoluteOffset)
+ {
+ size = offset = absoluteOffset = 0;
+ if (!root.TryGetValue(name, out OSD section) || section is not OSDMap map ||
+ !map.TryGetValue("offset", out OSD offsetValue) ||
+ !map.TryGetValue("size", out OSD sizeValue))
+ return false;
+ offset = offsetValue.AsInteger();
+ size = sizeValue.AsInteger();
+ long absolute = baseOffset + offset;
+ if (offset < 0 || size <= 0 || absolute < 0 ||
+ absolute + size > dataLength)
+ return false;
+ absoluteOffset = (int)absolute;
+ return true;
+ }
+
+ private static int ReadConvexVertices(OSDMap root, long baseOffset, byte[] data)
+ {
+ if (!TryReadSection(root, "physics_convex", baseOffset, data.Length,
+ out int size, out _, out int absoluteOffset) ||
+ size > MaxConvexBytesToDecode)
+ return 0;
+ try
+ {
+ using MemoryStream compressed = new(data, absoluteOffset, size, writable: false);
+ using ZLibStream zlib = new(compressed, CompressionMode.Decompress);
+ using MemoryStream decompressed = new();
+ byte[] buffer = new byte[4096];
+ int read;
+ while ((read = zlib.Read(buffer, 0, buffer.Length)) > 0)
+ {
+ if (decompressed.Length + read > MaxDecodedConvexBytes)
+ return 0;
+ decompressed.Write(buffer, 0, read);
+ }
+ decompressed.Position = 0;
+ if (OSDParser.DeserializeLLSDBinary(decompressed) is OSDMap convex &&
+ convex.TryGetValue("BoundingVerts", out OSD verts))
+ {
+ byte[] dataVerts = verts.AsBinary();
+ if (dataVerts is not null && dataVerts.Length >= 6 &&
+ dataVerts.Length % 6 == 0)
+ return dataVerts.Length / 6;
+ }
+ }
+ catch (Exception)
+ {
+ // Missing/invalid convex hull means a conservative physics
+ // cost, not a truncated or unvalidated cheap collision shape.
+ }
+ return 0;
+ }
+
+ private readonly struct MeshMetrics
+ {
+ internal readonly bool Valid;
+ internal readonly int High;
+ internal readonly int Medium;
+ internal readonly int Low;
+ internal readonly int Lowest;
+ internal readonly int ConvexVertices;
+
+ internal MeshMetrics(bool valid, int high, int medium,
+ int low, int lowest, int convexVertices)
+ {
+ Valid = valid;
+ High = high;
+ Medium = medium;
+ Low = low;
+ Lowest = lowest;
+ ConvexVertices = convexVertices;
+ }
+ }
+ }
+}
From cfb70a611445e8efea5f057a1c75aadbb1a9e2df Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:16:52 +0100
Subject: [PATCH 05/29] feat(g1 mesh LI): wire project/interface in
OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
---
OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs b/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
index d63da2e2..f82be690 100644
--- a/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
@@ -37,5 +37,14 @@ namespace OpenSim.Region.Framework.Interfaces
void TaintPrimCount();
IPrimCounts GetPrimCounts(UUID parcelID);
+
+ // Quota cost for a full linked object (does not alter PrimCount or LSL).
+ int GetObjectLandImpact(OpenSim.Region.Framework.Scenes.SceneObjectGroup group);
+
+ // Accurate aggregate costs for viewer GetObjectCost/selected weights.
+ bool MeshLandImpactEnabled { get; }
+ void GetObjectLandImpactWeights(
+ OpenSim.Region.Framework.Scenes.SceneObjectGroup group,
+ out float streaming, out float physics, out float server);
}
}
\ No newline at end of file
From c81612c0b9124792a5fc50e975cc0db18067066a Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:16:58 +0100
Subject: [PATCH 06/29] feat(g1 mesh LI): wire project/interface in
OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj
---
OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj | 2 ++
1 file changed, 2 insertions(+)
diff --git a/OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj b/OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj
index 2e60d1f5..6adcdb0c 100644
--- a/OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj
+++ b/OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj
@@ -413,6 +413,8 @@
Code
+
+
Code
From 191865bb0c10eb406a2096af8e2d1f06fecc5430 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:17:45 +0100
Subject: [PATCH 07/29] feat(g1 land): use optional mesh weights for parcel,
simwide and per-user quotas
---
.../CoreModules/World/Land/PrimCountModule.cs | 44 ++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
index 50d4123c..9b633553 100644
--- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs
@@ -56,6 +56,8 @@ namespace OpenSim.Region.CoreModules.World.Land
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_Scene;
+ private bool m_meshLandImpactEnabled;
+ private OglMeshLandImpactCalculator m_meshLandImpact;
private Dictionary m_PrimCounts =
new Dictionary();
private Dictionary m_OwnerMap =
@@ -83,11 +85,17 @@ namespace OpenSim.Region.CoreModules.World.Land
public void Initialise(IConfigSource source)
{
+ // Off by default in OpenSimDefaults.ini; opt in per simulator
+ // after confirming production parcel quotas and viewer behavior.
+ m_meshLandImpactEnabled =
+ source?.Configs["OGLMeshLandImpact"]?.GetBoolean("Enabled", false) ?? false;
}
public void AddRegion(Scene scene)
{
m_Scene = scene;
+ m_meshLandImpact = m_meshLandImpactEnabled
+ ? new OglMeshLandImpactCalculator(scene) : null;
m_Scene.RegisterModuleInterface(this);
@@ -114,6 +122,38 @@ namespace OpenSim.Region.CoreModules.World.Land
get { return "PrimCountModule"; }
}
+ public bool MeshLandImpactEnabled => m_meshLandImpactEnabled;
+
+ public int GetObjectLandImpact(SceneObjectGroup group)
+ {
+ if (group is null)
+ return 0;
+ if (!m_meshLandImpactEnabled || m_meshLandImpact is null)
+ return group.PrimCount;
+ return m_meshLandImpact.GetLandImpact(group);
+ }
+
+ public void GetObjectLandImpactWeights(SceneObjectGroup group,
+ out float streaming, out float physics, out float server)
+ {
+ if (group is null)
+ {
+ streaming = physics = server = 0;
+ return;
+ }
+ if (!m_meshLandImpactEnabled || m_meshLandImpact is null)
+ {
+ streaming = physics = server = group.PrimCount;
+ return;
+ }
+
+ m_meshLandImpact.GetWeights(group, out _, out double sw,
+ out double pw, out double vw);
+ streaming = (float)Math.Min(float.MaxValue, sw);
+ physics = (float)Math.Min(float.MaxValue, pw);
+ server = (float)Math.Min(float.MaxValue, vw);
+ }
+
private void OnParcelPrimCountAdd(SceneObjectGroup obj)
{
// If we're tainted already, don't bother to add. The next
@@ -205,7 +245,9 @@ namespace OpenSim.Region.CoreModules.World.Land
if (m_ParcelCounts.TryGetValue(landData.GlobalID, out parcelCounts))
{
UUID landOwner = landData.OwnerID;
- int partCount = obj.GetPartCount();
+ // Land/parcel limits use linkset LI, not raw mesh part count.
+ // LSL and the editable linkset structure still use PrimCount.
+ int partCount = GetObjectLandImpact(obj);
m_SimwideCounts[landOwner] += partCount;
if (parcelCounts.Users.ContainsKey(obj.OwnerID))
From 08e24ea53bbe4afc8c4b02d6f563c3c2280f7827 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:18:19 +0100
Subject: [PATCH 08/29] feat(g1 mesh LI): enforce impact in
OpenSim/Region/CoreModules/World/Land/LandObject.cs
---
OpenSim/Region/CoreModules/World/Land/LandObject.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 7d88d3e9..65adffba 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -1751,7 +1751,9 @@ namespace OpenSim.Region.CoreModules.World.Land
}
try
{
- primCount[obj.OwnerID] += obj.PrimCount;
+ primCount[obj.OwnerID] +=
+ m_scene.RequestModuleInterface()?.GetObjectLandImpact(obj)
+ ?? obj.PrimCount;
}
catch (KeyNotFoundException)
{
@@ -1786,7 +1788,9 @@ namespace OpenSim.Region.CoreModules.World.Land
{
ownersAndCount.Add(obj.OwnerID, 0);
}
- ownersAndCount[obj.OwnerID] += obj.PrimCount;
+ ownersAndCount[obj.OwnerID] +=
+ m_scene.RequestModuleInterface()?.GetObjectLandImpact(obj)
+ ?? obj.PrimCount;
}
}
catch (InvalidOperationException)
From 50cc84354cc613d3b954bd8a9ce407e5efd17269 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:18:22 +0100
Subject: [PATCH 09/29] feat(g1 mesh LI): enforce impact in
OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
---
.../PrimLimitsModule/PrimLimitsModule.cs | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
index 58ed16b2..7fe569a6 100644
--- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
+++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
@@ -125,7 +125,7 @@ namespace OpenSim.Region.OptionalModules
Vector3 objectPosition = sog.AbsolutePosition;
ILandObject lo = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y);
- string response = DoCommonChecks(sog.PrimCount, sp.UUID, lo);
+ string response = DoCommonChecks(GetLandImpact(sog), sp.UUID, lo);
if (response != null)
{
@@ -159,7 +159,7 @@ namespace OpenSim.Region.OptionalModules
return true;
}
- int objectCount = sog.PrimCount;
+ int objectCount = GetLandImpact(sog);
// TODO: Add Special Case here for temporary prims
@@ -182,7 +182,7 @@ namespace OpenSim.Region.OptionalModules
if (newParcel == null)
return true;
- int objectCount = sog.PrimCount;
+ int objectCount = GetLandImpact(sog);
// TODO: Add Special Case here for temporary prims
@@ -194,6 +194,12 @@ namespace OpenSim.Region.OptionalModules
return true;
}
+ private int GetLandImpact(SceneObjectGroup objectGroup)
+ {
+ return m_scene.RequestModuleInterface()
+ ?.GetObjectLandImpact(objectGroup) ?? objectGroup.PrimCount;
+ }
+
private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo)
{
string response = null;
From 6250a43dc31902390181eee04a917defa9e112c6 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:18:26 +0100
Subject: [PATCH 10/29] feat(g1 mesh LI): enforce impact in
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 572aaa37..d4981506 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2696,10 +2696,15 @@ namespace OpenSim.Region.Framework.Scenes
return null;
int totalPrims = 0;
+ long totalLandImpact = 0;
+ IPrimCountModule primCountModule = RequestModuleInterface();
foreach (SceneObjectGroup group in objlist)
- totalPrims += group.PrimCount;
+ {
+ totalPrims += group.PrimCount; // Actual linkset/rez placement geometry.
+ totalLandImpact += primCountModule?.GetObjectLandImpact(group) ?? group.PrimCount;
+ }
- if (!Permissions.CanRezObject(totalPrims, newowner, pos))
+ if (!Permissions.CanRezObject((int)Math.Min(int.MaxValue, totalLandImpact), newowner, pos))
return null;
if (!Permissions.BypassPermissions())
From d41b75b20f0d7d86a67b1d121a608ac70bfdc1e8 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:19:30 +0100
Subject: [PATCH 11/29] feat(g1 mesh LI): align viewer object costs and mark
changed mesh linksets for recount
---
.../Framework/Scenes/SceneObjectGroup.cs | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7ecae8fd..2d25e32f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -253,6 +253,12 @@ namespace OpenSim.Region.Framework.Scenes
}
m_hasGroupChanged = value;
+ // Resizes, physics changes and script changes can change mesh
+ // costs. Recalculate lazily on the next land quota query.
+ if (value && m_scene is not null &&
+ m_scene.RequestModuleInterface()?.MeshLandImpactEnabled == true)
+ m_scene.EventManager.TriggerParcelPrimCountTainted();
+
//m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: HasGroupChanged set to {0} for {1} {2}", m_hasGroupChanged, Name, LocalId);
}
@@ -1826,6 +1832,22 @@ namespace OpenSim.Region.Framework.Scenes
public void GetResourcesCosts(SceneObjectPart apart,
out float linksetResCost, out float linksetPhysCost, out float partCost, out float partPhysCost)
{
+ // Mesh LI is calculated for the complete linked object. Report
+ // the exact rounded quota cost through the viewer ObjectCost CAPS.
+ IPrimCountModule landImpactModule =
+ m_scene?.RequestModuleInterface();
+ if (landImpactModule?.MeshLandImpactEnabled == true)
+ {
+ landImpactModule.GetObjectLandImpactWeights(this,
+ out _, out float physicsWeight, out _);
+ linksetResCost = landImpactModule.GetObjectLandImpact(this);
+ linksetPhysCost = physicsWeight;
+ int count = Math.Max(1, PrimCount);
+ partCost = apart is null ? 0 : linksetResCost / count;
+ partPhysCost = apart is null ? 0 : physicsWeight / count;
+ return;
+ }
+
// this information may need to be cached
float cost;
@@ -1883,6 +1905,15 @@ namespace OpenSim.Region.Framework.Scenes
public void GetSelectedCosts(out float PhysCost, out float StreamCost, out float SimulCost)
{
+ IPrimCountModule landImpactModule =
+ m_scene?.RequestModuleInterface();
+ if (landImpactModule?.MeshLandImpactEnabled == true)
+ {
+ landImpactModule.GetObjectLandImpactWeights(this,
+ out StreamCost, out PhysCost, out SimulCost);
+ return;
+ }
+
SceneObjectPart p;
SceneObjectPart[] parts = m_parts.GetArray();
From 2284b12f65d5fae04bf10b9a47dd731ba1aeb218 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:20:13 +0100
Subject: [PATCH 12/29] config(g1): declare opt-in mesh land-impact in
bin/OpenSimDefaults.ini
---
bin/OpenSimDefaults.ini | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 5e41c5fd..47f345b3 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -59,6 +59,15 @@
MaximumArchiveMiB = 20480
MigrationStorageId = ""
+; OpenGenesisLINK G1 Mesh Land Impact (per-simulator).
+; Classic prim linksets keep their original counts. Mesh linksets use
+; the maximum of LOD streaming, convex physics and server weights.
+; The number of editable linked parts and LSL link numbers never change.
+; This is an OGL approximation of Second Life LI, not the proprietary
+; Linden Lab implementation. Staging validation is recommended.
+[OGLMeshLandImpact]
+ Enabled = false
+
[Startup]
; Console prompt
; Certain special characters can be used to customize the prompt
From 801aa866935ac9b4ac83a7770305bc07c2a1146c Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:20:16 +0100
Subject: [PATCH 13/29] config(g1): declare opt-in mesh land-impact in
bin/OpenSim.ini.example
---
bin/OpenSim.ini.example | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 32a6ce70..4a1a354b 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -52,6 +52,15 @@
PrivURL = ${Const|BaseURL}
PrivatePort = "8003"
+; OpenGenesisLINK G1 Mesh Land Impact (per-simulator).
+; Classic prim linksets keep their original counts. Mesh linksets use
+; the maximum of LOD streaming, convex physics and server weights.
+; The number of editable linked parts and LSL link numbers never change.
+; This is an OGL approximation of Second Life LI, not the proprietary
+; Linden Lab implementation. Staging validation is recommended.
+[OGLMeshLandImpact]
+ Enabled = false
+
[Startup]
; OGL 0.9.3.13: erweiterte Sicht auf mehr als das bisherige 3x3-Raster.
; Opt-in: angepasste Defaults MaxDrawDistance=1024 und
From 78ecda827c9b6ebc3d33e231e7d12c2f4ac5326f Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:20:20 +0100
Subject: [PATCH 14/29] config(g1): enable Stadt NexVerse mesh land-impact in
bin/OpenSim.ini
---
bin/OpenSim.ini | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/bin/OpenSim.ini b/bin/OpenSim.ini
index b2507244..95a722e4 100644
--- a/bin/OpenSim.ini
+++ b/bin/OpenSim.ini
@@ -64,6 +64,15 @@
PrivURL = ${Const|BaseURL}
PrivatePort = "8003"
+; OpenGenesisLINK G1 Mesh Land Impact (per-simulator).
+; Classic prim linksets keep their original counts. Mesh linksets use
+; the maximum of LOD streaming, convex physics and server weights.
+; The number of editable linked parts and LSL link numbers never change.
+; This is an OGL approximation of Second Life LI, not the proprietary
+; Linden Lab implementation. Staging validation is recommended.
+[OGLMeshLandImpact]
+ Enabled = true
+
[Startup]
; OGL 0.9.3.13: Live-Profil, Opt-in fuer erweiterte Regionssicht.
; 1024 m MaxDrawDistance / 768 m MaxRegionsViewDistance als Preset;
From beec5339f849e69a372daaf54511bb5c0d0f1917 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:21:48 +0100
Subject: [PATCH 15/29] feat(g1 mesh LI): enforce mesh quota in inventory and
script rez operations
---
.../Framework/InventoryAccess/InventoryAccessModule.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index a389f548..5df4a13c 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -1010,8 +1010,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
else
{
+ IPrimCountModule landImpactModule =
+ m_Scene.RequestModuleInterface();
foreach (SceneObjectGroup g in objlist)
- primcount += g.PrimCount;
+ primcount += landImpactModule?.GetObjectLandImpact(g) ?? g.PrimCount;
}
if (!m_Scene.Permissions.CanRezObject(primcount, remoteClient.AgentId, pos) && !attachment)
@@ -1172,7 +1174,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
SceneObjectGroup g = objlist[i];
if (!m_Scene.Permissions.CanRezObject(
- g.PrimCount, remoteClient.AgentId, pos + veclist[i])
+ m_Scene.RequestModuleInterface()
+ ?.GetObjectLandImpact(g) ?? g.PrimCount,
+ remoteClient.AgentId, pos + veclist[i])
&& !isAttachment)
{
// The client operates in no fail mode. It will
From e35563093ae8fd981966de6f51ea0d2c9085d613 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:21:52 +0100
Subject: [PATCH 16/29] feat(g1 mesh LI): enforce mesh quota in inventory and
script rez operations
---
.../Scripting/JsonStore/JsonStoreScriptModule.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
index 4c5dd02e..e1ca3188 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
@@ -761,11 +761,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
return;
}
- int totalPrims = 0;
+ int totalImpact = 0;
+ IPrimCountModule landImpactModule = m_scene.RequestModuleInterface();
foreach (SceneObjectGroup group in objlist)
- totalPrims += group.PrimCount;
+ totalImpact += landImpactModule?.GetObjectLandImpact(group) ?? group.PrimCount;
- if (! m_scene.Permissions.CanRezObject(totalPrims, item.OwnerID, pos))
+ if (! m_scene.Permissions.CanRezObject(totalImpact, item.OwnerID, pos))
{
GenerateRuntimeError("Not allowed to create the object");
return;
From fce09a992ae4c806e39dba2c7f2f9c1693ff4d4a Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:23:31 +0100
Subject: [PATCH 17/29] feat(g1 mesh LI): add regression gate and operator
rollout documentation
---
tools/ci/verify_ogl_mesh_land_impact.py | 50 +++++++++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100644 tools/ci/verify_ogl_mesh_land_impact.py
diff --git a/tools/ci/verify_ogl_mesh_land_impact.py b/tools/ci/verify_ogl_mesh_land_impact.py
new file mode 100644
index 00000000..bc338e1c
--- /dev/null
+++ b/tools/ci/verify_ogl_mesh_land_impact.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+"""Guard linked object land impact wiring without changing LSL link part counts."""
+from pathlib import Path
+
+root = Path(__file__).resolve().parents[2]
+def read(p): return (root / p).read_text(encoding="utf-8")
+
+core = read("OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs")
+engine = read("OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactCalculator.cs")
+math = read("OpenSim/Region/CoreModules/World/Land/OglMeshLandImpactMath.cs")
+interface = read("OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs")
+group = read("OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs")
+land = read("OpenSim/Region/CoreModules/World/Land/LandObject.cs")
+limits = read("OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs")
+coreproj = read("OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj")
+
+assert 'GetBoolean("Enabled", false)' in core
+assert "int partCount = GetObjectLandImpact(obj);" in core
+assert "GetObjectLandImpact(SceneObjectGroup group)" in core
+assert "GetObjectLandImpactWeights" in core and "GetObjectLandImpactWeights" in interface
+assert "MeshLandImpactEnabled" in core and "MeshLandImpactEnabled" in interface
+assert "OglMeshLandImpactCalculator.cs" in coreproj
+assert "OglMeshLandImpactMath.cs" in coreproj
+assert "MaxCachedMeshAssets = 8192" in engine
+assert "MaxMeshBytesToInspect = 64 * 1024 * 1024" in engine
+assert "physics_convex" in engine and "BoundingVerts" in engine
+assert "streaming += 1.0" in engine and "physics += 1.0" in engine
+assert "OglMeshLandImpactMath.StreamingWeight" in engine
+assert "OglMeshLandImpactMath.ServerWeight" in engine
+assert "Math.Ceiling(highest)" in math
+assert "GetObjectLandImpact(obj)" in land
+assert "GetLandImpact(sog)" in limits
+assert "m_scene?.RequestModuleInterface()" in group
+assert "TriggerParcelPrimCountTainted" in group
+assert "GetObjectLandImpact(group)" in read("OpenSim/Region/Framework/Scenes/Scene.Inventory.cs")
+assert "GetObjectLandImpact(g)" in read("OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs")
+assert "GetObjectLandImpact(group)" in read("OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs")
+
+for file, enabled in [
+ ("bin/OpenSimDefaults.ini", "false"),
+ ("bin/OpenSim.ini.example", "false"),
+ ("bin/OpenSim.ini", "true"),
+]:
+ cfg = read(file)
+ section = cfg.split("[OGLMeshLandImpact]", 1)[1].split("[", 1)[0]
+ assert f"Enabled = {enabled}" in section, f"{file}: unexpected mesh LI switch"
+
+assert "get { return m_parts.Count; }" in group, "LSL/linkset part counting changed"
+assert "GetPartCount()" in group, "Actual edit/physics linkset part count changed"
+print("OpenGenesisLINK G1 Mesh Land Impact core configuration and integration: PASS")
From 984c7a2a5a5ee48f638df13fcb9b02bd5a8f88db Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:23:34 +0100
Subject: [PATCH 18/29] feat(g1 mesh LI): add regression gate and operator
rollout documentation
---
.github/workflows/ogl-mesh-land-impact.yml | 46 ++++++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 .github/workflows/ogl-mesh-land-impact.yml
diff --git a/.github/workflows/ogl-mesh-land-impact.yml b/.github/workflows/ogl-mesh-land-impact.yml
new file mode 100644
index 00000000..2d32e1b1
--- /dev/null
+++ b/.github/workflows/ogl-mesh-land-impact.yml
@@ -0,0 +1,46 @@
+name: OGL G1 Mesh Land Impact
+on:
+ pull_request:
+ paths:
+ - 'OpenSim/Region/CoreModules/World/Land/**'
+ - 'OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj'
+ - 'OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs'
+ - 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs'
+ - 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs'
+ - 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs'
+ - 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs'
+ - 'OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs'
+ - 'bin/OpenSim*.ini*'
+ - 'tools/ci/OglMeshLandImpactRegression/**'
+ - 'tools/ci/verify_ogl_mesh_land_impact.py'
+ - '.github/workflows/ogl-mesh-land-impact.yml'
+ push:
+ branches: [main]
+ paths:
+ - 'OpenSim/Region/CoreModules/World/Land/**'
+ - 'OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj'
+ - 'OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs'
+ - 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs'
+ - 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs'
+ - 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs'
+ - 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs'
+ - 'OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs'
+ - 'bin/OpenSim*.ini*'
+ - 'tools/ci/OglMeshLandImpactRegression/**'
+ - 'tools/ci/verify_ogl_mesh_land_impact.py'
+ - '.github/workflows/ogl-mesh-land-impact.yml'
+permissions:
+ contents: read
+jobs:
+ land-impact-gate:
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: '10.0.x'
+ - name: Validate mesh land impact module wiring
+ run: python3 tools/ci/verify_ogl_mesh_land_impact.py
+ - name: Regression test linked mesh land-impact arithmetic
+ run: dotnet run --configuration Release --project tools/ci/OglMeshLandImpactRegression/OglMeshLandImpactRegression.csproj
From 87074e2919e35fe2559156547066bd184376339c Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:23:36 +0100
Subject: [PATCH 19/29] feat(g1 mesh LI): add regression gate and operator
rollout documentation
---
.../OGL_MESH_LAND_IMPACT_G1.md | 83 +++++++++++++++++++
1 file changed, 83 insertions(+)
create mode 100644 doc/OpenGenesisLINK/OGL_MESH_LAND_IMPACT_G1.md
diff --git a/doc/OpenGenesisLINK/OGL_MESH_LAND_IMPACT_G1.md b/doc/OpenGenesisLINK/OGL_MESH_LAND_IMPACT_G1.md
new file mode 100644
index 00000000..4944bfbe
--- /dev/null
+++ b/doc/OpenGenesisLINK/OGL_MESH_LAND_IMPACT_G1.md
@@ -0,0 +1,83 @@
+# OpenGenesisLINK G1 – Mesh Land Impact (opt-in)
+
+## Zweck
+
+OpenSimulator zaehlt bei Landlimits standardmaessig jedes verlinkte Objektteil
+als ein Prim. In Second Life ist die **Land Impact (LI)**-Quota fuer Mesh-Objekte
+separat von der Anzahl der editierbaren Teile. Dieses Feature fuehrt eine
+**eigene, abschaltbare OGL-Annaeherung** ein; es ist kein identischer
+Linden-Lab-Land-Impact-Algorithmus.
+
+## Verhalten
+
+- Ohne Mesh im Linkset: klassischer PrimCount unveraendert.
+- Bei Mesh im Linkset: **max(download/streaming, physics, server)** wird
+ berechnet und fuer das gesamte Linkset **einmal aufgerundet**, mindestens 1.
+- Download-Kosten: dieselbe gewichtete LOD-Kompressionsgroessen-Formel wie
+ der vorhandene Mesh-Upload-Kostenrechner (`MeshCost.cs`), inkl. Objektgroesse.
+- Physik: vorhandener Convex-Hull-Vertex-Faktor (0,04 pro Vertex) und
+ die groesseren vorhandenen PhysicsActor-Kosten; `PhysicsShapeType = Prim`
+ hat konservativ mindestens 1 pro Teil.
+- Servergewicht: statische nichtphysische Linksets mit 0 Skripten
+ **0,5 pro Teil**, Skriptzuschlaege, physische Linksets mindestens 1 pro Teil.
+- Komplexe Meshes, groessere Objekte, aufwendige Physik oder Skripte
+ koennen **mehr** LI kosten als vorher.
+- Beispielsweise koennen 10 kleine, optimierte und ungeskriptete Mesh-Teile
+ 5 LI kosten; das ist **kein garantierter 50-%-Rabatt**.
+- Fehlende, unlesbare, uebergrosse oder ungueltige Mesh-Assets erhalten
+ keinen Rabatt. Die Asset-Header werden begrenzt und pro Region gecacht.
+- Die physische Anzahl der Teile (`SceneObjectGroup.PrimCount`),
+ `llGetNumberOfPrims`, `llGetLinkNumber`, die Linkset-Bearbeitung und
+ alle gespeicherten Objekte bleiben unveraendert.
+
+## Konfiguration
+
+```ini
+[OGLMeshLandImpact]
+ Enabled = true
+```
+
+- `bin/OpenSimDefaults.ini`: **false** (sicherer genereller Default).
+- `bin/OpenSim.ini.example`: **false** fuer neue/nicht getestete Grids.
+- `bin/OpenSim.ini`: **true** fuer die Stadt-NexVerse-Quellkonfiguration.
+- Aktive Betreiber-INI wird beim Deployment nicht ohne Weiteres
+ automatisch ersetzt: Einstellung der produktiven `OpenSim.ini`
+ kontrollieren und Simulator neu starten.
+
+## Abrechnungs-Integration
+
+`PrimCountModule` verwendet LI fuer Parzellen, Eigentuer-/Benutzer-Kontingente
+und simweite Kapazitaeten. `LandObject` meldet den passenden LI in der
+Eigentuemeranzeige. `PrimLimitsModule` prueft beim Duplizieren und
+Parzellenwechsel dieselbe Belastung. Normale Inventar- und
+JsonStore-Rezpfade verwenden die neue Zahl fuer die Berechtigungspruefung.
+GetObjectCost- und ResourceCostSelected-CAPS liefern die berechneten
+Linkset-Kosten, ohne die echten Linknummern zu veraendern.
+
+## Grenzen und Rollout
+
+1. **Nicht identisch mit Second Life**: Die Download- und
+ Convex-Physik-Faktoren basieren auf den bestehenden OpenGenesisLINK-
+ Uploader-Daten, nicht auf einem exakten proprietaeren SL-Modell.
+2. Ein ueber mehrere Mesh-Teile direkt aus dem Viewer angelegtes Objekt
+ wird in manchen alten UploadObject-CAPS-Pfaden schon pro einzelnem
+ Teil geprueft; ein Folgeaudit dieser Legacy-Verkettung ist sinnvoll.
+3. Tests vor Aktivierung: Inventar-Rez, Hochladen, Drag-Drop, Copy,
+ Script-Rez, Link/Delink, Skalierung, Skript hinzufuegen/entfernen,
+ physisch/nichtphysisch, Objekt mit fehlendem Mesh-Asset, Parzellen-
+ und Regionslimit sowie Viewer-Mehr-Info-Dialog.
+4. Vor Aktivierung Primbudget und Landnutzung sichern. Die Umstellung
+ kann bestehende Mesh-Bauten neu bewerten.
+5. Im Fehlerfall `Enabled = false` setzen und Simulator neu starten:
+ danach gilt die bisherige Primzahl pro Linkset.
+6. Kein Aendern von OAR/IAR-Archiven, persistenten Regionobjekten oder
+ LSL-/Viewer-Protokollen.
+
+## Tests
+
+`dotnet run --configuration Release --project tools/ci/OglMeshLandImpactRegression/OglMeshLandImpactRegression.csproj`
+und `python3 tools/ci/verify_ogl_mesh_land_impact.py`, plus G1 .NET10
+Linux/Windows/ARM64 sowie NexVerse-Integrations-CI.
+
+Bei hohen echten Mesh-Asset-Komplexitaeten werden abschliessende
+Inworld-Vergleiche gegen Second Life separat benoetigt.
From 24679e911615d67fbc685a840b7189c69206c4a7 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:26:27 +0100
Subject: [PATCH 20/29] ci(g1): preserve compact simulator INI size while
enabling mesh LI
---
bin/OpenSim.ini | 8 --------
1 file changed, 8 deletions(-)
diff --git a/bin/OpenSim.ini b/bin/OpenSim.ini
index 95a722e4..7dc5b21c 100644
--- a/bin/OpenSim.ini
+++ b/bin/OpenSim.ini
@@ -63,16 +63,8 @@
PublicPort = "80"
PrivURL = ${Const|BaseURL}
PrivatePort = "8003"
-
-; OpenGenesisLINK G1 Mesh Land Impact (per-simulator).
-; Classic prim linksets keep their original counts. Mesh linksets use
-; the maximum of LOD streaming, convex physics and server weights.
-; The number of editable linked parts and LSL link numbers never change.
-; This is an OGL approximation of Second Life LI, not the proprietary
-; Linden Lab implementation. Staging validation is recommended.
[OGLMeshLandImpact]
Enabled = true
-
[Startup]
; OGL 0.9.3.13: Live-Profil, Opt-in fuer erweiterte Regionssicht.
; 1024 m MaxDrawDistance / 768 m MaxRegionsViewDistance als Preset;
From 41705a9bb21f33b6e01a1a7f1f617e631a338567 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:26:30 +0100
Subject: [PATCH 21/29] ci(g1): preserve compact simulator INI size while
enabling mesh LI
---
bin/OpenSim.ini.example | 7 -------
1 file changed, 7 deletions(-)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 4a1a354b..63edb19e 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -52,15 +52,8 @@
PrivURL = ${Const|BaseURL}
PrivatePort = "8003"
-; OpenGenesisLINK G1 Mesh Land Impact (per-simulator).
-; Classic prim linksets keep their original counts. Mesh linksets use
-; the maximum of LOD streaming, convex physics and server weights.
-; The number of editable linked parts and LSL link numbers never change.
-; This is an OGL approximation of Second Life LI, not the proprietary
-; Linden Lab implementation. Staging validation is recommended.
[OGLMeshLandImpact]
Enabled = false
-
[Startup]
; OGL 0.9.3.13: erweiterte Sicht auf mehr als das bisherige 3x3-Raster.
; Opt-in: angepasste Defaults MaxDrawDistance=1024 und
From 829b784fcb19c96971a9fa94df8aff53aadf8766 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:28:30 +0100
Subject: [PATCH 22/29] fix(g1 mesh LI): enforce actual cost for direct legacy
UploadObject mesh rez
---
.../Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
index a0ebeadf..de7a545f 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
@@ -276,7 +276,12 @@ namespace OpenSim.Region.ClientStack.Linden
// Required for linking
grp.RootPart.ClearUpdateSchedule();
- if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos))
+ // Legacy UploadObject CAPS creates mesh instances one at
+ // a time. At minimum, never undercharge a costly instance
+ // as a flat single prim while the LI policy is enabled.
+ int landImpact = m_scene.RequestModuleInterface()
+ ?.GetObjectLandImpact(grp) ?? 1;
+ if (m_scene.Permissions.CanRezObject(landImpact, avatar.UUID, pos))
{
m_scene.AddSceneObject(grp);
grp.AbsolutePosition = obj.Position;
From 4709d28122ad1a082409aa1902161bc7c3640bf2 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:29:13 +0100
Subject: [PATCH 23/29] ci(g1 mesh LI): guard legacy UploadObject land-impact
check
---
.github/workflows/ogl-mesh-land-impact.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/ogl-mesh-land-impact.yml b/.github/workflows/ogl-mesh-land-impact.yml
index 2d32e1b1..d2653cca 100644
--- a/.github/workflows/ogl-mesh-land-impact.yml
+++ b/.github/workflows/ogl-mesh-land-impact.yml
@@ -10,6 +10,7 @@ on:
- 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs'
- 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs'
- 'OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs'
+ - 'OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs'
- 'bin/OpenSim*.ini*'
- 'tools/ci/OglMeshLandImpactRegression/**'
- 'tools/ci/verify_ogl_mesh_land_impact.py'
@@ -25,6 +26,7 @@ on:
- 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs'
- 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs'
- 'OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs'
+ - 'OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs'
- 'bin/OpenSim*.ini*'
- 'tools/ci/OglMeshLandImpactRegression/**'
- 'tools/ci/verify_ogl_mesh_land_impact.py'
From eb461a905048183df16ea1fafb39092ae8d3845d Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:29:18 +0100
Subject: [PATCH 24/29] ci(g1 mesh LI): guard legacy UploadObject land-impact
check
---
tools/ci/verify_ogl_mesh_land_impact.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/ci/verify_ogl_mesh_land_impact.py b/tools/ci/verify_ogl_mesh_land_impact.py
index bc338e1c..2cac5f36 100644
--- a/tools/ci/verify_ogl_mesh_land_impact.py
+++ b/tools/ci/verify_ogl_mesh_land_impact.py
@@ -34,6 +34,7 @@ assert "m_scene?.RequestModuleInterface()" in group
assert "TriggerParcelPrimCountTainted" in group
assert "GetObjectLandImpact(group)" in read("OpenSim/Region/Framework/Scenes/Scene.Inventory.cs")
assert "GetObjectLandImpact(g)" in read("OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs")
+assert "GetObjectLandImpact(grp)" in read("OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs")
assert "GetObjectLandImpact(group)" in read("OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs")
for file, enabled in [
From a8c90918abe94c93feddbee7c3915e066632a7ea Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:32:16 +0100
Subject: [PATCH 25/29] ci(config): align OfflineIM SMTP example and regression
with web01.nexvortex.de
---
bin/OpenSim.ini.example | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 63edb19e..02b77963 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -154,7 +154,7 @@
SubjectTemplate = "Offline-IM Nachricht von {SENDER}"
RelaySigningKey = "${Environment|NEXVERSE_IM_RELAY_SIGNING_KEY}"
ReplyLifetimeDays = 5
- SMTPHost = "mail.nexvortex.de"
+ SMTPHost = "web01.nexvortex.de"
SMTPPort = 587
UseStartTls = true
UseSslOnConnect = false
From 2b838fcd72c5d4111de0b41da06c87111ca09b4b Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:32:20 +0100
Subject: [PATCH 26/29] ci(config): align OfflineIM SMTP example and regression
with web01.nexvortex.de
---
tools/ci/verify_offline_im_email.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/ci/verify_offline_im_email.py b/tools/ci/verify_offline_im_email.py
index dcf1fb4b..3136a9e5 100644
--- a/tools/ci/verify_offline_im_email.py
+++ b/tools/ci/verify_offline_im_email.py
@@ -33,7 +33,7 @@ for path in ("bin/OpenSim.ini", "bin/OpenSim.ini.example"):
"Enabled = true",
'RelayDomain = "im.stadt-nexverse.de"',
'SubjectTemplate = "Offline-IM Nachricht von {SENDER}"',
- 'SMTPHost = "mail.nexvortex.de"',
+ 'SMTPHost = "web01.nexvortex.de"',
"SMTPPort = 587",
"UseStartTls = true",
'SMTPUsername = "relay@im.stadt-nexverse.de"',
From 8f6e5f2796b197f08b348ae363756c12420135f7 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:33:36 +0100
Subject: [PATCH 27/29] fix(g1 mesh LI): invalidate parcel cost on mesh shape
or scale changes
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 52517006..0ab17802 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1092,6 +1092,11 @@ namespace OpenSim.Region.Framework.Scenes
set
{
m_shape = value;
+ // A mesh/sculpt/prim shape switch can change LI even when
+ // the number of linked parts remains constant.
+ if (ParentGroup?.Scene is Scene scene &&
+ scene.RequestModuleInterface()?.MeshLandImpactEnabled == true)
+ scene.EventManager.TriggerParcelPrimCountTainted();
}
}
@@ -1107,6 +1112,12 @@ namespace OpenSim.Region.Framework.Scenes
{
Vector3 oldscale = m_shape.Scale;
m_shape.Scale = value;
+ // Streaming LI depends on the physical size. The old
+ // PrimCount-only path did not need a recount on scaling.
+ if ((value - oldscale).LengthSquared() > 0.000001f &&
+ ParentGroup?.Scene is Scene scene &&
+ scene.RequestModuleInterface()?.MeshLandImpactEnabled == true)
+ scene.EventManager.TriggerParcelPrimCountTainted();
if (ParentGroup is not null && ((value - oldscale).LengthSquared() >1.0f))
ParentGroup.InvalidBoundsRadius();
PhysicsActor actor = PhysActor;
From 90e90f82b400c67d17fe7f8cf4eaed70958b0de3 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:33:52 +0100
Subject: [PATCH 28/29] test(g1 mesh LI): check shape and scale quota
invalidation
---
.github/workflows/ogl-mesh-land-impact.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/ogl-mesh-land-impact.yml b/.github/workflows/ogl-mesh-land-impact.yml
index d2653cca..ce8cc092 100644
--- a/.github/workflows/ogl-mesh-land-impact.yml
+++ b/.github/workflows/ogl-mesh-land-impact.yml
@@ -6,6 +6,7 @@ on:
- 'OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj'
- 'OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs'
- 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs'
+ - 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs'
- 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs'
- 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs'
- 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs'
@@ -22,6 +23,7 @@ on:
- 'OpenSim/Region/CoreModules/OpenSim.Region.CoreModules.csproj'
- 'OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs'
- 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs'
+ - 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs'
- 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs'
- 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs'
- 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs'
From 6933c3be823dc3425eb01857af75c43a24876063 Mon Sep 17 00:00:00 2001
From: "OpenGenesis (MPL 2.0)"
<153564363+opengenesislink@users.noreply.github.com>
Date: Sun, 8 Nov 2026 17:33:55 +0100
Subject: [PATCH 29/29] test(g1 mesh LI): check shape and scale quota
invalidation
---
tools/ci/verify_ogl_mesh_land_impact.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/ci/verify_ogl_mesh_land_impact.py b/tools/ci/verify_ogl_mesh_land_impact.py
index 2cac5f36..aa179f78 100644
--- a/tools/ci/verify_ogl_mesh_land_impact.py
+++ b/tools/ci/verify_ogl_mesh_land_impact.py
@@ -32,6 +32,7 @@ assert "GetObjectLandImpact(obj)" in land
assert "GetLandImpact(sog)" in limits
assert "m_scene?.RequestModuleInterface()" in group
assert "TriggerParcelPrimCountTainted" in group
+assert "TriggerParcelPrimCountTainted" in read("OpenSim/Region/Framework/Scenes/SceneObjectPart.cs")
assert "GetObjectLandImpact(group)" in read("OpenSim/Region/Framework/Scenes/Scene.Inventory.cs")
assert "GetObjectLandImpact(g)" in read("OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs")
assert "GetObjectLandImpact(grp)" in read("OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs")