Help support this project by starring the repo on GitHub!
tiles0
max seen0
level0 / 0
buffer0 / 0
fill0.0%
fps
min
max

Overview

This example demonstrates the createInfiniteFlatTopology API, which extends the terrain infinitely in all directions by placing a grid of root tiles around the camera.

As the camera moves, the root grid re-centers so terrain is always present in every direction. Nearby roots are subdivided deeply by the LOD system while distant roots stay at level 0, keeping the node budget under control.

Key differences from bounded flat

  • No terrain boundaryneighborSameLevel always succeeds, so tiles at the edge of one root seamlessly connect to tiles in neighboring roots.
  • Camera-centered rootsrootTiles computes which level-0 tiles surround the camera each frame.
  • Signed tile coordinates — root tiles can have negative (x, y) positions (e.g. (-1, -1) when the camera is near the origin).

Controls

ControlDescription
root sizeWorld-space size of each root tile edge
root grid radiusHalf-width of the root grid (1 = 3x3, 2 = 5x5, etc.)
max levelMaximum quadtree subdivision depth
max nodesTotal node budget across all roots
elevation scaleVertical scale applied to the elevation function
skirt scaleSkirt drop distance to hide tile seams
wireframeToggle wireframe to visualize per-tile coloring