From fdddc7d2ef27e151b0da51aab38a7be0e4532bf9 Mon Sep 17 00:00:00 2001 From: Martin Felis Date: Sun, 11 Jun 2023 20:05:10 +0200 Subject: [PATCH] Making islands flat for now. --- scenes/TileWorld.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scenes/TileWorld.cs b/scenes/TileWorld.cs index c605902..43e4f02 100644 --- a/scenes/TileWorld.cs +++ b/scenes/TileWorld.cs @@ -199,13 +199,17 @@ public class TileWorld : Spatial Vector2 textureCoord = OffsetToTextureCoord(offsetCoord); - float heightmapHeight = Heightmap.GetPixel((int)textureCoord.x, (int)(textureCoord.y)).r * HeightScale; + float heightmapHeight = Heightmap.GetPixel((int)textureCoord.x, (int)(textureCoord.y)).r; + if (heightmapHeight > 0.5) + { + heightmapHeight = 0.6f; + } // heightmapHeight = Mathf.Floor(heightmapHeight); // heightmapHeight = heightmapHeight * 10) // heightmapHeight = Mathf.Clamp(heightmapHeight, -1f, 5); - return heightmapHeight; + return heightmapHeight * HeightScale; }