KEK — C99 software 3D engine
Pure C99 software rasteriser and engine with zero dynamic allocations: a 320×200 frame of 256-color palette indices, built to run on a Pentium or 486DX under DOS and compiled here to WebAssembly via Emscripten and SDL3.
What is in this demo
- Three-room level with portal culling — only rooms visible through doorways are rasterised, scissored to their portal rectangles.
- Baked vertex lighting, fog & sky — point lights and shadows baked per vertex, indoor colour fog in the hall and corridor, dissolving fog into a 6-face skybox in the open courtyard.
- 32×32 mirror behind the spawn — turn around at the start to see a live render-to-texture reflection on the south wall (rendered only while you are in the hall looking at it).
- Animated models & world sprites — vertex-animated grunts with attached clubs, depth-tested dithered dust puffs and glinting potion pickups, plus AABB collision, stairs and jumping.
- Software audio mixer & tracker music — pure-C99 integer mixer driving procedural
sfxr-style sound effects (.ksb) and a 4-channel ProTracker module (.kmu).
Controls
- W A S D
- Walk / strafe
- Shift / Space
- Run / jump
- ← → ↑ ↓
- Look around
- Mouse
- Look around (click the canvas to capture it; Esc releases it)
- F / left button
- Strike a grunt in front of you
- Esc
- Settings menu (graphics, audio & mouse); click or use the wheel on a row to change it
- Tab
- Cycle portal visibility debug overlay (rooms seen / all rooms)
- F1–F4
- Toggle lighting, fog, sky, and entities
Credits
- Music: “May is 4 Her” by Drozerix (2022), samples by Estrayk — Public Domain, from The Mod Archive (#197296).
- Bitmap font: Spleen 5×8 by Frederic Cambus — BSD-2-Clause (fcambus/spleen).
- Source: github.com/t1meshift/kek.