Overview
How far can one CPU go as a real-time 3D renderer with no GPU rasterisation at all? I treated it as an optimisation problem. The starting point was a working but slow baseline renderer: one thread, a per-pixel barycentric test, 5.7 ms for 49 simple objects at 1024×768. I profiled it, then rewrote it around an edge-function rasteriser, lock-free band threading, SIMD and a data-oriented ECS. Then I built a real scene on top: a 391k-triangle lava island with animated characters, rain, bloom and other effects, plus a runtime editor to place and tweak everything live. I measured every step with Tracy and a benchmark harness, and the profiler shows where the next win is. DirectX 11 is only used to show the finished image.
What I built
- Software rasteriser Every transform, clip, depth test, texture lookup and lighting calculation runs on the CPU. An edge-function rasteriser with incremental stepping, perspective-correct texturing and flat per-triangle lighting.
- Lock-free threading A persistent worker pool woken per pass. The screen is split into bands, one per thread, so threads never share pixels and need no locks or atomics. The same pool runs the raster pass and every post effect.
- SIMD and memory SSE whole-triangle frustum rejection, SIMD normal sums, non-temporal framebuffer clears, AVX2 builds and 64-byte aligned buffers.
- Data-oriented scene My own archetype ECS (fecs): meshes, transforms and materials live in packed arrays the renderer walks in order.
- CPU animation and effects Skeletal skinning per character, plus exposure, contrast, saturation, vignette, rain, bloom, screen-space reflections, fog, depth of field and god rays.
- Editor and profiling A Dear ImGui editor with picking, gizmos and scene.json save/load. Tracy zones on every stage and every worker band, and a harness that times each stage across thread counts and resolutions.
Results
Hard parts
- Measuring before optimising: repeated runs, per-stage timers and a Tracy capture, with the numbers reported honestly. On a two-chiplet CPU, where Windows places the threads moves 1080p frame time between 38 and 55 ms.
- The raster pass scales only 3.8× at 32 threads. The profiler found the reasons (band imbalance and repeated vertex work) and the fix (bin triangles into tiles once, then hand tiles out dynamically).
- Benchmarking found a latent bug: the band splitter can round past the last row at thread counts the app never shipped with. A one-line clamp fixes it.
Limits
- The heavy scene runs at 18–26 fps live, not 60. The default scene runs at about 110 fps.
- The looping clip of the heavy scene was rendered frame by frame for smooth playback.
- Directional light only, simple screen-space reflections, and Windows only.










