OSDN Git Service

Inelegant workaround for Slop-shading issue
[automap/automap.git] / Automap / Renderers / StandardRenderer.cs
index a47897e..3dd9578 100644 (file)
@@ -103,7 +103,7 @@ namespace Automap
                //continue;
                //}
 
-               float slopeBoost = 1;
+               float slopeBoost = 1f;
                int leftTop, rightTop, leftBot;
 
                ColumnMeta leftTopMapChunk = targetColMeta;
@@ -142,8 +142,12 @@ namespace Automap
 
                if (slopeness > 0) slopeBoost = 1.2f;
                if (slopeness < 0) slopeBoost = 0.8f;
+               if (Math.Abs(slopeness) <= float.Epsilon) slopeBoost = 1.0f;//Same height
+               //slopeBoost -= 0.15f; //Slope boost value 
 
-               slopeBoost -= 0.15f; //Slope boost value 
+               //FIXME: disable slopes on edges...for now
+               if (localX == 0 || localX == 31) slopeBoost= 1.0f;
+               if (localZ == 0 || localZ == 31) slopeBoost= 1.0f;
 
                int blockId = chunksColumn[localChunkY].MaybeBlocks[MapUtil.Index3d(localX, (localY % chunkSize), localZ, chunkSize, chunkSize)];