← Selected work

Personal engine · DirectX 12 · Day —

RetroEngine

A DirectX 12 engine I'm writing solo, from scratch. Its display is a CRT simulated from first principles: beam, phosphors, mask, glass. It isn't a filter laid over the image. It started as a renderer and has grown into a game engine, with an editor, streaming terrain, and a first-person game being built inside it.

Day 315: the game being built inside the engine, through the CRT.
Solorenderer, editor, and tools, written by one person
DX12no engine layer underneath; Dear ImGui is the only dependency
60 FPSon a potato (a Radeon 660M integrated GPU)
80.lvfeatured, along with GenerationAmiga
// 01 · How the CRT works

Inside the engine

These are the engine's own debug views for a single frame, captured with the snapshot tool I built into the editor. Step through them in the order the engine runs them.

RetroEngine debug view

Play with it

A hands-on version that runs live in your browser, fed with the raw scene from above. Step through the stages, slow the beam down to watch it scan, swap the mask, and zoom in on the phosphors.

or drop one on the screen. It stays on your computer; nothing is uploaded.

A simplified WebGL version written for this page, using textbook models of each stage. The engine does this in HLSL on DirectX 12, with more stages and its own tuning.

Your browser doesn't support WebGL2, so the live demo can't run here.

// 02 · Performance

60 FPS on the bottom 10–15%

The AMD Radeon 660M is an integrated GPU with six RDNA2 compute units, in the bottom 10–15% of gaming hardware.

RetroEngine holds a stable 60 FPS on it with all of this running at once:

  • The full CRT pipeline
  • Terrain streaming and procedural generation
  • HDR rendering
  • The editor

That's before GPU instancing, frustum culling, or LODs, which are still ahead.

A blossoming tree in a ruined courtyard, rendered through the CRT simulation
// 03 · The engine around the CRT

Everything else, also from scratch

Shared-ownership texture cache

Textures used to belong to the terrain chunk that loaded them, so one 4096×4096 terrain texture was duplicated in every chunk. A global cache with deterministic keys means each texture is loaded once and shared. Memory stays flat no matter how many chunks are loaded.

ECS

A component-based entity system with strict GPU resource ownership, deterministic lifetimes, multi-scene loading, safe deletion, and scenes saved as parameters only.

Terrain streaming

Chunks stream in around the camera. Whole worlds regenerate deterministically from a seed and a handful of parameters.

Deterministic time

Engine-level pause, rewind, and replay. Inputs and scene state scrub along a timeline, which makes debugging much easier.

Editor

A dockable ImGui editor: object picking, snapping gizmos, a chunk palette, live material authoring, and a GPU memory panel showing texture memory, SRVs, and instance counts.

Lighting

Directional shadow maps, point lights, volumetric light shafts, and fog in a single fullscreen pass, with separate directional and ambient color for predictable art direction.

Lighting, layer by layer

The same frame, split into its lighting layers.

RetroEngine lighting debug view

Distance gradient debug view
Distance gradient
Saturation debug view
Saturation amount
Draw batch debug view
Batch colors
The castle grounds.
// 04 · Dev logs

Built in public

Every step is written up on retrogameengine.com.

  1. 01 Getting Started
  2. 02 Solid Ground
  3. 03 A New Dimension for 2D
  4. 04 Foundations of the Editor
  5. 05 Getting Real About This Update
  6. 06 Dragging RetroEngine Out of the Void
  7. 07 From Rendering Objects to Building Worlds
  8. 08 After Scenes, Something Still Felt Off
  9. 09 Merry Christmas!
  10. 10 Time to Clean Up the CRT Pipeline
  11. 11 The Can of Worms I Wasn't Expecting
  12. 12 A Walkthrough of the Engine Today
  13. 13 I Need Better Tools
  14. 14 The Point of Lighting
  15. 15 Iteration Speed Is the Real Feature
  16. 16 From Concept to Contact
  17. 17 Indoor Tools Exposed an Outdoor Problem
  18. 18 Terrain Grew Up
  19. 19 Seeing Through the Mist
  20. 20 A Short Break From Deep Dives
  21. 21 The Moment It Broke
  22. 22 Quick Update
  23. 23 The Big One
  24. 24 Waking Up

← Back to selected work