Skip to main content

Function: createTerrainMesh()

createTerrainMesh(renderContext, options): TerrainMesh

Defined in: rendering/terrain/create-terrain-mesh.ts:199

Builds a single triangulated mesh visualizing a TerrainShape's heightmap, textured with a tileable "border" layer near the surface blending into a tileable "fill" layer below it (see CreateTerrainMeshOptions). Since the mesh has an arbitrary vertex count

  • not the fixed six-vertices-per-quad the sprite pipeline batches - draw it with createTerrainRenderEcsSystem rather than through createRenderEcsSystem.

Parameters

renderContext

RenderContext

The render context used to build the mesh's geometry and material.

options

CreateTerrainMeshOptions

Sizing and texturing options for the mesh.

Returns

TerrainMesh

The built TerrainMesh.