Game dev
Saved & recent

Procedural mesh

Related terms: procedural geometry, runtime mesh, mesh generation

A mesh built by code instead of in a modeling tool. The code works out each vertex position, lists which vertices form triangles, and fills in normals and UVs.

Terrain from a height map, roads along a spline, buildings from rules, voxel worlds and sword trails are made this way. The mesh can be rebuilt while the game runs.

Further reading
Unity Manual: Using Meshes with C# Scripts
sampled vertex indexed flat mesh generated terrain
A grid of 81 vertices uses the same 128 triangles in both views. A seeded height field changes the vertex heights.

View in the full Game dev collection