From 63c5da539f6b0aa30f32626c063bc8798b7b3318 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 15 Mar 2020 17:47:27 +0000 Subject: [PATCH] minor change to legacy mesh stream cost estimation, so small lowest lod does not give excessive contribution --- .../Linden/Caps/BunchOfCaps/MeshCost.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs index 9b8f11a52b..b9621a46fc 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs @@ -718,11 +718,10 @@ namespace OpenSim.Region.ClientStack.Linden ma = mlst + ml + mm + mh; // get LODs compressed sizes - // giving 384 bytes bonus - int lst = curCost.lowestLODSize - 384; - int l = curCost.lowLODSize - 384; - int m = curCost.medLODSize - 384; - int h = curCost.highLODSize - 384; + int lst = curCost.lowestLODSize; + int l = curCost.lowLODSize; + int m = curCost.medLODSize; + int h = curCost.highLODSize; // use previous higher LOD size on missing ones if (m <= 0) @@ -732,6 +731,12 @@ namespace OpenSim.Region.ClientStack.Linden if (lst <= 0) lst = l; + // giving 384 bytes bonus + lst -= 384; + l -= 384; + m -= 384; + h -= 384; + // force minumum sizes if (lst < 16) lst = 16; @@ -743,7 +748,7 @@ namespace OpenSim.Region.ClientStack.Linden h = 16; // compute cost weighted by relative effective areas - float cost = (float)lst * mlst + (float)l * ml + (float)m * mm + (float)h * mh; + float cost = lst * mlst + l * ml + m * mm + h * mh; cost /= ma; cost *= 0.004f; // overall tunning parameter