Make heightmap res ratio right

This commit is contained in:
Nick 2022-07-14 14:03:02 -04:00
parent 96a08e4356
commit f4ee3d9b49
2 changed files with 6 additions and 7 deletions

View File

@ -1,4 +1,4 @@
using NewHorizons.Utility; using NewHorizons.Utility;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -33,15 +33,13 @@ namespace NewHorizons.External.Modules
/// </summary> /// </summary>
public string textureMap; public string textureMap;
// blame trifid if this ratio is wrong
public const float RESOLUTION_RATIO = 256 / 51f;
/// <summary> /// <summary>
/// Resolution of the heightmap. /// Resolution of the heightmap.
/// Higher values means more detail but also more memory/cpu/gpu usage. /// 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. /// This value will be 1:1 with the heightmap texture width, but only at the equator.
/// </summary> /// </summary>
[Range(0, int.MaxValue)] [DefaultValue((int)(51 * RESOLUTION_RATIO))] [Range(50, 2000)]
public int resolution = (int)(51 * RESOLUTION_RATIO); [DefaultValue(200)]
public int resolution = 200;
} }
} }

View File

@ -466,7 +466,8 @@ namespace NewHorizons.Handlers
if (body.Config.HeightMap != null) 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) if (body.Config.ProcGen != null)