Files
EVEngine/examples/linear-structures/README.md
T
西风逍遥游 9dfb3d655c feat(examples): linear-structures rendering test
Demo all six tileable prop recipes side by side with CC0 textures from
Wikimedia Commons (loaded with repeat sampling, procedural fallback). UI
cycles structures and tunes segments/unit length; Tab and +/- also work.
2026-08-15 17:58:19 +08:00

1.8 KiB

Linear Structures — tileable procedural 3D props

A rendering test for the procgen mesh recipes that build linear, tileable structures from a single unit segment repeated along the X axis. Six recipes are demonstrated side by side:

Recipe Structure
mesh.fence wooden fence (posts + 3 rails)
mesh.stonewall stone wall (rubble body + cap)
mesh.bridge bridge (deck + handrails + cross beams)
mesh.greatwall Great Wall (body + walkway + outer merlons + inner guard)
mesh.hedge hedgerow (leafy base + bush blobs)
mesh.chevaldefrise cheval de frise (top rail + crossed X legs + feet)

The textures are CC0 images downloaded from Wikimedia Commons (see ATTRIBUTION.md), loaded with wrap sampling so the grain/brick tiling stays continuous across unit seams. If an asset file is missing the example falls back to a procedural texture, so it still runs.

Run

make run/win32-debug GAME=examples/linear-structures

Controls

  • Tab — cycle through the six structures.
  • + / - — grow / shrink the number of repeated units.
  • Segments / Unit length sliders rebuild the active structure live.
  • Pause rotation button (or toggle in code) orbits the camera.

Reusable API

local p = procgen.newParams();
p.setInt("segments", 8);      // repeat count along X
p.setFloat("segLength", 2.0); // length of one tileable unit
p.setFloat("height", 1.5);    // per-kind override
p.setFloat("uvRepeat", 2.0);  // texture repeats per world unit
local mesh = procgen.generateMesh("mesh.stonewall", p, gfx);

Shared params: segments, segLength, height, depth, thickness, scale, uvRepeat. Each unit is designed so its cross-section at x=0 matches x=segLength, so tiling is seamless.