configurable heightmap resolution

This commit is contained in:
JohnCorby 2022-07-13 21:14:57 -07:00
parent 93fc16aede
commit 8143b6188a
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations; using NewHorizons.Utility;
using NewHorizons.Utility;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace NewHorizons.External.Modules namespace NewHorizons.External.Modules
{ {
@ -31,5 +32,12 @@ namespace NewHorizons.External.Modules
/// Relative filepath to the texture used for the terrain. /// Relative filepath to the texture used for the terrain.
/// </summary> /// </summary>
public string textureMap; public string textureMap;
/// <summary>
/// Resolution of the heightmap.
/// Higher values means more detail but also more memory/cpu/gpu usage.
/// </summary>
[Range(0, int.MaxValue)] [DefaultValue(51)]
public int resolution = 51;
} }
} }

View File

@ -466,7 +466,7 @@ namespace NewHorizons.Handlers
if (body.Config.HeightMap != null) if (body.Config.HeightMap != null)
{ {
HeightMapBuilder.Make(go, sector, body.Config.HeightMap, body.Mod, 51); HeightMapBuilder.Make(go, sector, body.Config.HeightMap, body.Mod, body.Config.HeightMap.resolution);
} }
if (body.Config.ProcGen != null) if (body.Config.ProcGen != null)