daffodil

heightfield terrain engine · real-world landscape at 1:1

v0.1.0-dev PolyForm Noncommercial C99 + sokol

A C99 heightfield terrain engine by magmacrunch media. daffodil draws real ground: it reads a heightfield built offline from LiDAR elevation data, reprojected, tiled and written as raw float32 meters, then renders it faithfully and lets you walk on it. The landscape is surveyed, not sculpted.

There's no procedural generation and no terrain sculpting: the shape of the ground comes from the survey, and the engine's job is to reproduce it rather than reshape it. It was built for Block Island Simulator, which is the island below.

daffodil has two C99 siblings. magnolia runs the Wii games. hologram makes the opposite trade: it traces light exactly, dispersion and polarization included, across a few dozen analytic surfaces, where daffodil rasterizes millions of triangles of ground and gets the light approximately right.



what's in it

terrain Chunked heightfield at 2 m posts, LOD by distance, seams provably invisible rather than approximately so
solar & lunar Real sun and moon positions for a date, time and place; the night is as dark as it actually is
stars 8,404 stars from a real catalog, drawn where they actually are for the hour on the clock
shadows Cascaded shadow maps, with an atlas that defaults smaller on GLES3 than the floor allows
structures Buildings with interiors you can enter, walls that stop you, doors that are openings
vegetation Trees, shrub clumps and grass tufts from measured positions, instanced and impostored by range
water Sea and ponds, tide, current, shoreline and the swim transition at its edge
walker Walks, swims and rides; a bicycle and a moped, each with its own handling
environment Sky, weather, rain, birds, boats and the ferry working its real crossing
audio Mixer, sample bank, WAV loading and a small synth, in-engine rather than bolted on
capture Reads a frame back on every backend, which is what makes a visual claim checkable at all
gles_budget Audits the whole scene against GLES3's guaranteed minimums, with no GPU and no display

the terrain contract

daffodil does not produce heightfield data; it reads it. The producing pipeline lives in the consuming game's repository, in Python, and the two halves agree through a manifest file rather than through shared code. A tile is raw little-endian float32, row-major, and its sample values are meters above local mean sea level.

DAFFODIL_TILE_SAMPLES   257     // 512/2 + 1
DAFFODIL_TILE_METRES    512.0f
DAFFODIL_POST_METRES    2.0f

There's no height scale constant and no decode step: reading a tile is one fread into a float*. A scale constant is a thing two languages can disagree about, and this way they cannot. The +1 in the sample count is load-bearing too, because it makes adjacent tiles share their edge row exactly.

measured against the specification, not against a box

The engine's demands are checked against OpenGL ES 3.0's guaranteed minimums rather than against whatever GPU is to hand. Fitting inside the floor means fitting on any conformant device, so a failure on real hardware is a driver problem rather than a design one. The audit runs with no GPU and no display, which means it runs over ssh.

It says nothing about speed. Not one of those limits is a rate, and the island reported ok on every line while drawing at three frames a second on the one GLES3 GPU it has met. Fits is not plays, and the two are worth keeping apart.

targets

Windows / D3D11 · Linux / OpenGL · macOS / Metal · Raspberry Pi 4 and 5 / GLES3. One rasterizer, four backends, and a frame can be read back on all of them.

the name

After the Daffodil cabin at Twin Maples on Block Island, which is the first ground it renders, and after Juanito Thompson's “Daffodil & Sweet Pea”.

PolyForm Noncommercial 1.0.0 · Copyright 2026 magmacrunch media. Any noncommercial purpose is permitted, and commercial use is reserved to magmacrunch media. Vendored sokol headers, by Andre Weissflog, keep their zlib license.

// source access //

daffodil is developed in-house and is not publicly distributed.

For source access, licensing, or anything else, email info@magmacrunch.com.