5881a7dafc787c7c670585cd960fc9a836892992
Cartograph
A browser-based world map creation tool inspired by Wonderdraft and Inkarnate. Uses shape-based terrain generation with procedural detail.
Features (planned)
- Shapes — the fundamental building block. Each shape has:
- Height — additive (raise terrain) or subtractive (lower terrain)
- Biome — determines the sampled texture applied to the shape
- Intensity — blending weight of the biome texture
- Roughness — edge noise amount (voronoi-like jagged edges at maximum)
- Shape editing — select, move, rotate, scale individual shapes
- Groups — combine shapes into groups for batch operations
- Shake landmass — procedurally decompose a shape into a more complex set of shapes
- Viewport — zoom and pan across the map canvas
Tech stack
| Layer | Library |
|---|---|
| Language | C (C99) |
| Compiler | Emscripten (emcc) → WebAssembly |
| Graphics | Sokol with WebGPU backend |
| UI | Dear ImGui via cimgui |
| Math | cglm |
| Shaders | WGSL (compiled to C headers via xxd) |
Build
# Install dependencies
./fetch_libs.sh
# Release build
make
# Debug build
make debug
Output is app.html, served by Emscripten's built-in web server or any static server.
Project structure
src/
main.c Entry point, sokol init, render loop, input handling
api.h Central include — all library headers and project-wide defines
sprite.h Sprite batching, texture management, file import
util.h Vector (dynamic array) and memory pool data structures
rand.h Xorshift32 PRNG utilities
shaders/ WGSL shader sources
generated/ xxd-generated C headers from shaders
lib/
sokol/ Sokol single-file headers (gfx, app, glue, log)
imgui/ Dear ImGui + cimgui
cglm/ C linear math library
util/ Sokol utility headers (memtrack, imgui integration)
License
MIT
Description
Languages
C
96.1%
WGSL
1.4%
Makefile
1%
Shell
0.9%
HTML
0.6%