From f4ee3d9b49f1cac4f9ea86ef0e9abca57524b5eb Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 Jul 2022 14:03:02 -0400 Subject: [PATCH] Make heightmap res ratio right --- NewHorizons/External/Modules/HeightMapModule.cs | 10 ++++------ NewHorizons/Handlers/PlanetCreationHandler.cs | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/NewHorizons/External/Modules/HeightMapModule.cs b/NewHorizons/External/Modules/HeightMapModule.cs index 35aabffe..5d2a1c5d 100644 --- a/NewHorizons/External/Modules/HeightMapModule.cs +++ b/NewHorizons/External/Modules/HeightMapModule.cs @@ -1,4 +1,4 @@ -using NewHorizons.Utility; +using NewHorizons.Utility; using Newtonsoft.Json; using System.ComponentModel; using System.ComponentModel.DataAnnotations; @@ -33,15 +33,13 @@ namespace NewHorizons.External.Modules /// public string textureMap; - // blame trifid if this ratio is wrong - public const float RESOLUTION_RATIO = 256 / 51f; - /// /// Resolution of the heightmap. /// Higher values means more detail but also more memory/cpu/gpu usage. /// This value will be 1:1 with the heightmap texture width, but only at the equator. /// - [Range(0, int.MaxValue)] [DefaultValue((int)(51 * RESOLUTION_RATIO))] - public int resolution = (int)(51 * RESOLUTION_RATIO); + [Range(50, 2000)] + [DefaultValue(200)] + public int resolution = 200; } } \ No newline at end of file diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 69e88d03..47ee251b 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -466,7 +466,8 @@ namespace NewHorizons.Handlers if (body.Config.HeightMap != null) { - HeightMapBuilder.Make(go, sector, body.Config.HeightMap, body.Mod, (int)(body.Config.HeightMap.resolution / HeightMapModule.RESOLUTION_RATIO)); + var res = (int)(body.Config.HeightMap.resolution / 4); + HeightMapBuilder.Make(go, sector, body.Config.HeightMap, body.Mod, res); } if (body.Config.ProcGen != null)