finds.dev← search

// the find

skywind3000/mini3d

★ 2,336 · C · MIT · updated Sep 2024

3D Software Renderer in 700 Lines !!

A single 700-line C file implementing a fixed-function software 3D rasterizer from scratch: matrix transforms, clipping, z-buffer, and perspective-correct texturing. It's a teaching project, not a renderer you'd ship — aimed at people who want to understand how GPUs turn vertices into pixels rather than people who need a renderer.

Everything lives in one file with zero dependencies, so you can read it top to bottom in an afternoon and actually trace a vertex through the whole pipeline to a pixel. It covers the real fundamentals — CVV clipping, perspective-correct interpolation, scanline edge coverage, z-buffering — rather than skipping the hard parts like a lot of 'build your own renderer' writeups do. The source is heavily commented per the README, and it ships a list of concrete follow-up exercises (backface culling, bilinear filtering, BSP loading) that turn it into an actual self-study curriculum instead of a one-off demo.

There's no real build system — just raw gcc/cl invocations and a Visual Studio solution, and it links -lgdi32, so out of the box it's Windows-only despite being 'no dependencies.' There are no tests, and the author states outright there's no performance optimization, so this is unusable as a base for anything beyond learning. The code itself hasn't functionally changed in years (last push Sept 2024 was likely just housekeeping) and still lacks basics like backface culling or lighting in mainline, those are left as unsolved homework. The deeper explanations (the linked blog posts on the actual math) are Chinese-only, so a non-Chinese-reading developer gets the translated README but misses the material that explains why the code works.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →