Skip to content

Commit d1410ff

Browse files
committed
Fix heightmap size docs
1 parent fe8f7ff commit d1410ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

manual/terrain/importing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To learn more about importing terrain please see the related tutorial [here](tut
1010

1111
When importing `.RAW` files importer will hint to use *HdrRGBA* format without compression which gives better quality to terrain (also, RAW files needs to have the square size). If you import grayscale heightmap please ensure to use HDR format as well and disable compression to reduce artifacts in the generated terrain. You heightmap after importing won't be used by the engine so don't lock yourself to a certain resolution.
1212

13-
Flax supports **any texture size** as a heightmap but in general, it's better to provide high-quality images (although engine performs linear sampling during terrain generation to provide solid looking results). 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 be `HeightmapSize = 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). Internal format for the terrain heightmap is `R8G8B8A8_UNorm` and uses `RG` channels for 16-bit height packing and `BA` channels for the per-vertex normal vector.
13+
Flax supports **any texture size** as a heightmap but in general, it's better to provide high-quality images (although engine performs linear sampling during terrain generation to provide solid looking results). To calculate the best heightmap size use patches amount and chunk size to solve this equation: `HeightmapSize = NumberOfPatches * 4x4 * ChunkSize + 1`. So if you have square of 2x2 patches, each chunk has 127 size then the heightmap size should be `HeightmapSize = 2x2 * 4x4 * 127 + 1 = 1018x1018`. This non-conventional size is a result of internal engine optimization that packs the patch heightmap into square textures power of two size. Internal format for the terrain heightmap is `R8G8B8A8_UNorm` and uses `RG` channels for 16-bit height packing and `BA` channels for the per-vertex normal vector.
1414

1515
Terrain generator uses only Red channel for the heightmap and applies the custom **Heightmap Scale** to convert samples from the range [0-1] into the world units. The default scale **20,000** provides solid looking result however you can adjust it as you need. It's better to scale terrain height using this slider rather than applying non-uniform scale on Y-axis (this method reduces normals quality and may introduce lighting issues).
1616

0 commit comments

Comments
 (0)