No description
  • Zig 48.6%
  • C 36.7%
  • C++ 12.6%
  • GLSL 2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Zeptogon bd33706e79 Prepare the repository to be published
Ten passes of housekeeping, folded together because they are one activity:
making a working tree fit for somebody else to clone.

**Terms.** MIT, and a README written against a verified clean-room build —
the seven system libraries, the build and test commands, the eight `-D`
options, and where every bundled component's licence lives. Two of those were
being redistributed without their notices: the Dear ImGui FreeType backend,
copied verbatim with no licence beside it, and the Iosevka subsets, whose OFL
text was missing while the subsetter was also silently stripping the licence
record out of every face it built. `fontTools` keeps name IDs 0-6 by default;
13 and 14 are the licence and its URL, and a subset is the last thing free to
drop them.

**Weight.** `assets/` held ten typeface families at 244 MB, of which the build
read none and the generator read two. They are 176 KB subsets now, cut to a
range wider than the build bakes so the next glyph anybody wants needs no
download. Verified lossless: identical outlines, glyph order, cmap, metrics
and hinting against a build from the full families.

**Instructions.** `CLAUDE.md` becomes `AGENTS.md`, the name every coding agent
looks for, since nothing in it was ever specific to one.

**Documents.** What survives is what a reader needs now: the values the code is
written to, the naming rules, how the streaming works, and how to test cheaply
and honestly. Plans for work that has shipped are deleted rather than filed —
the code is the answer, and a plan is a record of getting there. Session
handoffs go with them. What is left of `tools/` is the one script that builds
something the program ships.

**Ignore rules that mean something.** Entries naming files that no longer
exist are fossils, and four of them were. Each surviving rule now says why it
is there, because the one that looked most like a fossil — a survey two tests
open relative to the repository root — was the one that mattered.
2026-09-03 19:52:00 -07:00
assets Prepare the repository to be published 2026-09-03 19:52:00 -07:00
docs Prepare the repository to be published 2026-09-03 19:52:00 -07:00
lib Prepare the repository to be published 2026-09-03 19:52:00 -07:00
patches/sokol Vulkan blits are real: staging uploads over sokol's handles 2026-08-13 08:42:28 -07:00
src Prepare the repository to be published 2026-09-03 19:52:00 -07:00
tools Prepare the repository to be published 2026-09-03 19:52:00 -07:00
.gitignore Prepare the repository to be published 2026-09-03 19:52:00 -07:00
AGENTS.md Prepare the repository to be published 2026-09-03 19:52:00 -07:00
build.zig The loading screen is the log, and two things nobody was reading 2026-09-03 19:52:00 -07:00
build.zig.zon The Mac build carries its own font and assets, reads the machine it is on, and is called TerraViz 2026-08-23 11:13:18 -07:00
LICENSE Prepare the repository to be published 2026-09-03 19:52:00 -07:00
README.md Prepare the repository to be published 2026-09-03 19:52:00 -07:00

TeraViz

A 3D viewer for large terrain surveys. It streams GeoTIFF elevation models, orthophotos and LAS/LAZ point clouds off disk and raymarches them, so a survey is flown rather than tiled through — including surveys far larger than memory. GeoJSON layers drape over the result, and markers can be placed on the ground.

Building

Zig 0.15.1 or newer, and these system libraries:

library Debian/Ubuntu package
libtiff libtiff-dev
libgeotiff libgeotiff-dev
PROJ libproj-dev
zstd libzstd-dev
FreeType libfreetype-dev
OpenGL libgl-dev
X11 (via sokol) libx11-dev libxi-dev libxcursor-dev libasound2-dev
zig build              # build
zig build run          # build and run
zig build test         # run the tests

zig build fetches zmath and cimgui; sokol is vendored under lib/.

If libgeotiff's headers are somewhere unusual, -Dgeotiff_include_path=/path/to/include.

Running

Point it at data:

zig-out/bin/terraviz dem.tif ortho.tif cloud.laz
zig-out/bin/terraviz survey/            # a directory is walked

Files can also be dropped onto the window. Elevation and imagery are told apart by what the file declares, not by its name. Sources are remembered per project under ~/terraviz/, along with baked tiles, markers and vector layers, so reopening a survey is warm.

Tests

zig build fixture -- data/synth   # synthetic DEM + point cloud, deterministic
zig build test

The suite runs without fixtures — the tests that need them skip and say so. Generating them turns roughly six more on. A handful of tests want a property only a real encoder produces (LAZ compression, LAS 1.4 with a WKT CRS); those resolve through $TERAVIZ_TEST_CORPUS and skip when it is unset. See docs/testing-data.md.

docs/fast-testing.md is the guide to asking a behavioural question in seconds rather than minutes.

Build options

option meaning
-Dui-font=inter|iosevka UI typeface, Inter by default
-Dfont-hinting=none|native|light UI font grid-fitting
-Dvulkan Vulkan backend instead of GL
-Dbare-display Compositor without markers, vectors, labels or depth export
-Dtsan ThreadSanitizer
-Dfuzz Randomized stress tests
-Dself-hosted Self-hosted backend for Debug: faster builds, much slower runtime

Third-party components

TeraViz itself is MIT licensed — see LICENSE. Bundled under lib/ and assets/:

component licence
sokol (lib/sokol-zig) zlib/libpng — lib/sokol-zig/LICENSE
LASzip (lib/laszip) Apache-2.0 — lib/laszip/COPYING.txt
Dear ImGui FreeType backend (lib/imgui_freetype) MIT — lib/imgui_freetype/LICENSE.txt
tinyfiledialogs (lib/tinyfiledialogs) zlib — stated in the source header
stb (lib/stb) public domain / MIT — stated in each header
glad (lib/glad) generated loader; Khronos headers are MIT
Inter (assets/Inter-*.ttf) SIL OFL 1.1 — assets/Inter-LICENSE.txt
Iosevka Aile (assets/IosevkaAile-*-subset.ttf) SIL OFL 1.1 — assets/IosevkaAile-LICENSE.txt

The font files in assets/ are subsets, cut by tools/make-ui-font.py from the upstream releases named there. Neither typeface declares a Reserved Font Name, so the subsets keep their original names.

zmath and cimgui are fetched by the build and carry their own licences.