mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Fix an error in sculpt LOD calculation
This commit is contained in:
@@ -56,8 +56,8 @@ namespace PrimMesher
|
||||
|
||||
int destX = 0;
|
||||
int destY = 0;
|
||||
int destWidth = (int)(sourceWidth * scale);
|
||||
int destHeight = (int)(sourceHeight * scale);
|
||||
int destWidth = (int)(srcImage.Width * scale);
|
||||
int destHeight = (int)(srcImage.Height * scale);
|
||||
|
||||
Bitmap scaledImage = new Bitmap(destWidth, destHeight,
|
||||
PixelFormat.Format24bppRgb);
|
||||
@@ -214,7 +214,7 @@ namespace PrimMesher
|
||||
uvs = new List<UVCoord>();
|
||||
|
||||
//float sourceScaleFactor = (float)lod / (float)Math.Max(sculptBitmap.Width, sculptBitmap.Height);
|
||||
float sourceScaleFactor = (float)(lod * lod) / (float)(sculptBitmap.Width * sculptBitmap.Height);
|
||||
float sourceScaleFactor = (float)(lod) / (float)Math.Sqrt(sculptBitmap.Width * sculptBitmap.Height);
|
||||
bool scaleSourceImage = sourceScaleFactor < 1.0f ? true : false;
|
||||
|
||||
Bitmap bitmap;
|
||||
|
||||
Reference in New Issue
Block a user