In docunent, terrain size determination is a little vague.
In heightmap importing section,
To calculate the best heightmap size use patches amount and chunk size to solve this equation:
HeightmapSize = NumberOfPatches * ChunkSize + 1
. So if you have square of 4x4 patches, each chunk has 127 size then the heightmap size should beHeightmapSize = 4x4 * 127 + 1 = 509x509
. This non-conventional size is a result of internal engine optimization that packs the patch heightmap into square textures power of two size).
Heightmap size calculation is described as Chunk_size * Number_of_patches+1.
Therefore from following creation
Terrain grid should have vertex of 127x127, size of 126x126.
But in tutorial page,
variable meaning vertex count inside a patch is :
var heightMapSize = chunkSize * FlaxEngine.Terrain.PatchEdgeChunksCount + 1;
And PatchEdgeChunksCount is constant variable fixed inside engine, value of 4.
Therefore according to tutorial source, heightmap grid size is multiplied by 4 (about) in contrast to other page of manual.
As I understand, This code means that -
Configuration is [Chunk] < [Patch] < [Terrain]
and a [Patch] must be configured with 4x4 [Chunk]s (constant PatchEdgeChunksCount)
and a [Terrain] has variable 2D array of [Patch]es (configurable in editor).
i.e. I created Chunk size 63, Patch Number 2x2:
Creates 63(Chunk size) x 4(PatchEdgeChunksCount) x 2(Number of Patches) = 504 blocks each side.
And after creation, Property window shows following:
But isn’t this need 505x505 heightmap data? This conflicts to manual,
and a little hard to figure how large the resulted size of ‘Create Terrain’ dialog, when user input data…