Software rendering in fixed point - prototype demo

Опубликовано: 15 Май 2026
на канале: Martin Cejp
4,652
168

This is a demonstration of a basic software rendering engine targeting 32-bit CPUs which lack any floating-point hardware and even integer division (such as ARM7 and embedded RISC-V).

The renderer can efficiently process single-textured triangles and parallelograms (quadliterals defined by 3 vertices). Depth ordering is achieved using Span buffers, requiring non-trivial processing during scene set-up, but ensuring zero overdraw. Exteriors and interiors can be connected seamlessly and efficiently using portals which are evaluated in screen space, considering their orientation and occlusion by other objects. Map data is streamed in, allowing for very large virtual worlds; however, only static geometry is supported in this manner. All runtime code is written in C++17, with many debug features toggled at compile time. A PC build can be produced (using SDL), streaming performance metrics in real time to InfluxDB. Content authoring tools, such as a Blender export plug-in and a texture converter, are based on Python.

The project codebase traces back to early 2019, but the bulk of the work leading to this demonstration has been carried out in the past months.

Some textures and models have been stolen from whenever they were found (e.g. TES Daggerfall) -- sorry about that! Others were custom-made for this demo.