minor change to legacy mesh stream cost estimation, so small lowest lod does not give excessive contribution

master
UbitUmarov 2020-03-15 17:47:27 +00:00
parent 5f76a62d29
commit 63c5da539f
1 changed files with 11 additions and 6 deletions

View File

@ -718,11 +718,10 @@ namespace OpenSim.Region.ClientStack.Linden
ma = mlst + ml + mm + mh; ma = mlst + ml + mm + mh;
// get LODs compressed sizes // get LODs compressed sizes
// giving 384 bytes bonus int lst = curCost.lowestLODSize;
int lst = curCost.lowestLODSize - 384; int l = curCost.lowLODSize;
int l = curCost.lowLODSize - 384; int m = curCost.medLODSize;
int m = curCost.medLODSize - 384; int h = curCost.highLODSize;
int h = curCost.highLODSize - 384;
// use previous higher LOD size on missing ones // use previous higher LOD size on missing ones
if (m <= 0) if (m <= 0)
@ -732,6 +731,12 @@ namespace OpenSim.Region.ClientStack.Linden
if (lst <= 0) if (lst <= 0)
lst = l; lst = l;
// giving 384 bytes bonus
lst -= 384;
l -= 384;
m -= 384;
h -= 384;
// force minumum sizes // force minumum sizes
if (lst < 16) if (lst < 16)
lst = 16; lst = 16;
@ -743,7 +748,7 @@ namespace OpenSim.Region.ClientStack.Linden
h = 16; h = 16;
// compute cost weighted by relative effective areas // 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 /= ma;
cost *= 0.004f; // overall tunning parameter cost *= 0.004f; // overall tunning parameter