Canyon Mesa Tile

showcase/canyon-mesa-tile/

A procedural strategy-game desert map tile of Colorado Plateau character — a square 2.40 m on a side where two mesas, a butte and a slender spire are cut from one horizontal layer cake: scree aprons at the angle of repose up to the cliffs' foot, five sandstone beds each its own colour and weathered into partings, read as level strata, a crumbling shale slope, a flat overhanging caprock of weathered slickrock; the beds at one height on every formation and straight across the canyon between the mesas; a totem spire; a dry wash falling from the back edge to the front, a dune field, angular fallen blocks, low juniper bushes, sage and rabbitbrush, and cottonwoods — through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.

Rendered headless by the showcase piece itself. Select it to enlarge.

witnesses Recomputed: 127676 tris, eight materials with 51200 ground, 34932 sandstone, 10620 caprock, 4420 wash, 6480 block, 884 bark, 16704 foliage and 1280 plinth faces, UVs in 0..1 with zero AABB overlap, outer AABB 2.400×2.400×0.6221 m, zmin 0, hygiene 0 including zero coplanar cross-shell pairs, all four formations' feet 0.034 m in their aprons, all seven bedding planes at one height on every formation that carries them (spread 0.0000 m) with both canyon walls carrying every plane, the three caprock tops level to 0.0000 m, 7006 talus faces at 30.8–36.2° (repose band 30–37°), the wash never rising from row to row over 316 rows and a 0.0225 m fall, its ends 0.004 and 0.008 m in from the back and front edges and its edges 0.0033 m under the banks, all 60 blocks sealed in every sector (worst 0.0040 m) and none overlapping, all 46 trunks' feet 0.009–0.010 m in the ground and all 118 scrub cushions bedded, LOD ratios in band, five-hull collider 242 tris, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z 16; --perch-butte 17; --tilt-beds 18; --dome-cap 19; --steep-talus 20; --uphill-wash 21; --perch-rock 22; --pile-rocks 23; --float-plants 24.

category Terrain

tags mesh export showcase

blender --background --python showcase/canyon-mesa-tile/canyon_mesa_tile.py --

A showcase piece, not an example, and a terrain piece. It builds a procedural strategy-game map tile of Colorado Plateau character, at hero-diorama density (about 128k triangles at LOD0; the gated LOD2, about 28k, is the in-game asset): a square 2.40 m on a side with two mesas and a canyon between them at the back, a butte and a slender spire in front, and a dry wash crossing the tile from edge to edge.

The tile's colour reads the way a map does: red sand, darker hardpan and pale blown sheets and broad swings from deep terracotta to apricot on the floor, black desert pavement in patches, the aprons scree in the wall's colours, the cliffs banded and lightly varnished, the caps weathered grey slickrock under red sand.

Every seeded draw comes from random.Random(SEED) in plan_scene(), before anything is built: where each block and plant stands and its size, tone and turn. Each formation's joints and erosion come from its own seeded stream. The ground is closed-form in plan position. No flag draws from the stream, so a falsifier changes only what it names.

A formation is one closed loft: rings round its outline bottom to top, two rings at one height making a ledge, a flat top in concentric rings, a fan underneath. Its outline is a turned superellipse with a few harmonics; the apron is a closed-form function of the distance from that outline, so its slope is the profile's own. Blocks, trunks, crowns and scrub landing in another shell's plane turn 3° about their lowest point and sink 0.3 mm (one shell of each pair only: moving both alike would keep them coplanar); each scrub cushion also sinks up to 0.8 mm more than the last, so two on the level caprock never share their buried plane.

Ground is smooth-shaded with a 50° crease, the cliffs with 40° and the fallen blocks with 24°, so the ledges, the cap's overhang, the blocks' broken faces and the skirt stay crisp. Eight materials: desert ground (sand, hardpan, pavement, aprons), cliff sandstone (De Chelly and the Moenkopi slope), caprock, wash sand, fallen blocks, bark, foliage (juniper, sage and cottonwood), tile plinth.

It asserts budget conformance of the generated result. It does not witness an API contract. "It rendered without error" is not a check.

Composes skills mesh-editing-and-bmesh, bake-high-to-low, depsgraph-and-evaluated-data, engine-export-presets, and snippets bake_normal_high_to_low.py, setup_bake_target_image.py, lod_chain.py / decimate_to_budget.py, convex_hull_collider.py, export_preset_unity.py (helpers copied inline, not imported).

The collider is five convex hulls joined in one mesh, built from points only: the tile's slab up to the floor, and each formation from its apron's toe to its top. Units walk the floor and climb the aprons; the cliffs stop them.

Budgets#

Every budget is declared as a named constant. Every gate recomputes its value from the mesh, materials, UVs, evaluated LOD, collider, or export file.

AxisDeclaredMeasured (5.2.1)
Base triangles127100–128300127676
LOD1 ratio0.32–0.62 of base0.5000
LOD2 ratio0.10–0.35 of base0.2200
Materialsexactly 8 distinct; face floors ground ≥49660, sandstone ≥33880, caprock ≥10300, wash ≥4280, blocks ≥6280, bark ≥850, foliage ≥16200, plinth ≥12408 slots; 51200 / 34932 / 10620 / 4420 / 6480 / 884 / 16704 / 1280
UVsin 0..1, AABB overlap ≤ 1e-5in range, overlap 0
Outer AABB(2.4000, 2.4000, 0.6221) m ± 0.01(2.4000, 2.4000, 0.6221), zmin 0
Collider tris (five hulls)≤ 280242
Exportwritten, size > 0, removed after measuring13487784 bytes

The triangle band, the sandstone, block and foliage floors and the height were re-fitted when the formations and scatter were remodelled for legibility, not widened to pass: each bed gained a ring on every formation (its face now rounds into a parting top and bottom), the fallen blocks went from 34 to 60, the floor's scrub from 56 to 84 cushions and each juniper's crown from four clumps to five; the junipers became low bushes, which dropped the tile's top (set by the mesa-top junipers) from 0.6416 to 0.6221 m. The band keeps its old width round the new count, the floors their old 97% of it.

DECIMATE COLLAPSE triangle counts are not identical across Blender series, so the LOD gate is a ratio band, not an exact count. Bake pixels are stochastic, so the bake gate is has_data plus operator FINISHED, not byte-identity. The plan is seeded and nothing else is random; two default runs print identical measurements.

Hygiene#

Recomputed from the generated mesh, not asserted about the script.

AxisDeclaredMeasured
Non-manifold edges00
Loose verts / edges0 / 00 / 0
Doubles merged at 1e-500
Zero-area faces00
N-gons00
Coplanar cross-shell face pairs (KD range 0.05 m, plane ε 1e-4)00
Grounded: zminwithin 1e-4 of 00.0000

The tile's flat base is the only geometry at Z = 0.

Terrain invariants#

A map tile has no joinery. What makes this read as a plateau country is that every formation is cut from one horizontal layer cake, that the caprocks lie level, that the aprons stand at the angle loose rock rests at, that the wash runs downhill all the way across, and that the blocks and plants stand in the ground. Each face carries Part, Ident, Cap and Zone tags, each vertex Bed, Talus, Ring and Lane, so a bedding plane, an apron's straight run, a wash row and a trunk's foot can be named; every measurement is then made on the shell's geometry.

AxisDeclaredMeasured
Formations sealed: every formation's foot (its bottom fan's rim) under the tile straight above it≥ 0.010 m, 4 formations0.0336–0.0340
Strata: per bedding plane, the heights of every formation's rings on it, spread across all formations; both canyon walls (the two mesas) carry every plane≤ 0.0005 m; 7 planes0.0000 m; planes at 0.172, 0.236, 0.290, 0.346, 0.400 (on all four), 0.455, 0.483 (on the three capped)
Caprock flat: each cap's top, the spread of its heights and its faces' tilt≤ 0.0005 m, ≤ 0.2°; 3 tops0.0000 m, 0.000°
Talus: every tile face whose corners lie in an apron's straight run, its slope30–37° (angle of repose); ≥ 1500 faces30.78–36.19°, median 32.86° (7006 faces)
Wash: along its centre lane, the largest rise from one row to the next; its whole fall; its ends in from the back and front edges; the banks over its side lanesrise ≤ 1e-6 m, falls; ends ≤ 0.010 m; banks ≥ 0.003 mrise 0.0000, fall 0.0225 m over 316 rows; ends 0.0040 / 0.0078 m; banks 0.0033 m
Blocks sealed: per block, in each sector holding a vertex, its most-buried vertex under the ground≥ 0.003 m, 60 blocksworst 0.0040
Blocks apart: pairs of blocks whose BVH trees overlap00
Plants rooted: every trunk's foot (its bottom cap) under the ground or the cap straight above each corner; every scrub cushion, per sector, its most-buried vertextrunks 0.004–0.050 m, 46 trunks; scrub ≥ 0.003 m, 118 cushions0.0090–0.0101; worst 0.0040

The talus check excludes where one apron's straight run is not alone: where two aprons meet in the canyon, where the floor or the dunes rise to meet the toe, and beside the wash's channel. The spire's apron is the tightest cone on the tile and sets its maximum: a flat lattice triangle chords a cone a little steeper than the cone itself.

Falsifiers#

Each falsifier violates one named budget. Every one was run on 5.2.1 and exited its declared code. The envelope's size was unchanged in every run but --dome-cap (0.6312 m tall, its domed caps now above the mesa-top junipers; inside the 0.01 m tolerance, so exit 8 never fires first), and the triangle count in every run but --perch-butte (127420: the butte loses a ring).

FlagBudget violatedExit
--skip-decimateLOD1 ratio band (measured 1.0000)9
--stray-vertloose vertex count is 0 (measured 1)15
--lift-zbounding box zmin is 0 (measured 0.05000)16
--perch-butteformations sealed (the butte's foot stood 8 mm over its bench instead of run into it: −0.0092 m)17
--tilt-bedsstrata (the east mesa dipped 0.04 m per metre: plane 1 spread 0.02596 m across the formations)18
--dome-capcaprock flat (the caps' middles raised 12 mm: spread 0.01200 m, tilt 10.007°)19
--steep-talustalus (the aprons piled at 46°–42°: 42.09–47.29°)20
--uphill-washwash (a 20 mm swell raised mid-course: rises 0.00171 m between rows, its edges out of the banks)21
--perch-rockblocks sealed (each block seated against the ground at its centre alone: −0.0245 m)22
--pile-rocksblocks apart (two blocks dropped against the one lying furthest out: 5 pairs overlap)23
--float-plantsplants rooted (the floor's plants raised 30 mm: feet −0.0210 m, scrub −0.0260 m)24

--perch-butte replaces the butte's two lowest rings with one standing on the bench, so the cliff and everything over it stay where they were. --float-plants lifts the plants on the floor only: the mesa tops' plants set the tile's height, and lifting them would steal the exit at the envelope.

Run#

blender --background --python canyon_mesa_tile.py --
blender --background --python canyon_mesa_tile.py -- --skip-decimate
blender --background --python canyon_mesa_tile.py -- --stray-vert
blender --background --python canyon_mesa_tile.py -- --lift-z
blender --background --python canyon_mesa_tile.py -- --perch-butte
blender --background --python canyon_mesa_tile.py -- --tilt-beds
blender --background --python canyon_mesa_tile.py -- --dome-cap
blender --background --python canyon_mesa_tile.py -- --steep-talus
blender --background --python canyon_mesa_tile.py -- --uphill-wash
blender --background --python canyon_mesa_tile.py -- --perch-rock
blender --background --python canyon_mesa_tile.py -- --pile-rocks
blender --background --python canyon_mesa_tile.py -- --float-plants
blender --background --python canyon_mesa_tile.py -- --output canyon.png

Smoke passes no flags.

The hero does not turn the piece (HERO_YAW_DEG 0) and looks down on the tile from the front, 12° to the left and 33° over it, the way a map tile is seen on a game board: the wash runs at the camera, the mesas stand behind it with the canyon between them, their strata reading level and unbroken across it, the butte and the banded totem spire in front on their scree aprons. A low, warm key from the left, late in the day, lights the cliffs on that side and throws each formation's shadow across the floor; the warm wedge drops its pool on the floor off to the left. Framing measures fill x 0.700, y 0.817, margins left 0.194, right 0.106, bottom 0.033, top 0.150; the asset-quality floors pass. The tile is a red desert filling most of the frame, so its saturation (0.36) runs above the calibration set's (0.15–0.24); its stage (0.234) sits inside theirs.

Exit codes#

File-local. 9 is a valid check code. 10 is reserved for gallery_framing.check_framing and 11 for gallery_asset_quality.check_asset_quality, both on the --output path. 15–16 are the hygiene and grounded family; 17–26 are file-local.

CodeMeaning
0Success
1Uncaught exception (FATAL wrapper)
2argparse / usage
3Mesh did not build, no UV layer, or not one tile, four formations and one wash
4Base triangle count outside range
5Material count ≠ 8 distinct slots, or a face-count floor missed
6UVs outside 0..1
7UV AABB overlap above tolerance
8World AABB off declared outer size
9LOD ratio band (--skip-decimate lands here)
10Framing gate (render path only)
11Asset-quality floor (render path only)
12Bake did not finish or image has no data
13Export file missing or empty
14--output produced no file
15Mesh hygiene: loose, non-manifold, zero-area, doubles, n-gons, coplanar cross-shell pairs
16Not grounded: bounding box zmin off 0
17Formations: a foot not under its apron (--perch-butte)
18Strata: a bedding plane at different heights on different formations, or a canyon wall missing one (--tilt-beds)
19Caprock: a top not level (--dome-cap)
20Talus: too few apron faces, or one outside the angle-of-repose band (--steep-talus)
21Wash: rising anywhere along it, not falling, not crossing edge to edge, or its edges out of the banks (--uphill-wash)
22Blocks: a sector of a block not bedded in the ground (--perch-rock)
23Blocks: two overlap (--pile-rocks)
24Plants: a trunk's foot out of its band or a scrub cushion not bedded (--float-plants)
26Collider triangle count above ceiling

Source

showcase/canyon-mesa-tile/canyon_mesa_tile.py View the script on GitHub →
A square desert map tile: two mesas and a butte banded in level red and cream strata under dark caprock, a banded spire on scree aprons, and a pale dry wash lined with gold cottonwoods.