Hasty Briefsbeta

Bilingual

Building a Tiny 3D Renderer for a Tiny Handheld

11 hours ago
  • The author started with a raycaster benchmark to gauge Playdate's 3D performance, which initially seemed too slow.
  • The renderer loads Quake BSP map files, leveraging precomputed visibility and geometry to save runtime cost.
  • A 16-bit reciprocal z-buffer was added after the painter's algorithm proved insufficient.
  • Perspective-correct texture mapping is used with a per-pixel division approximation for performance.
  • Lighting is dithered using an 8x8 Bayer matrix to simulate shades on the 1-bit display.
  • The visual style uses strong outlines and cel-shading (inspired by Return of the Obra Dinn and Jet Set Radio) instead of textured dithering.
  • Key optimizations include using specific compiler flags, custom ARM assembly for math functions, half-resolution rendering, and hot/cold code separation.
  • The author emphasizes benchmarking and aiming for 'good enough' to progress to gameplay prototyping.