r/GraphicsProgramming • u/yetmania • Sep 07 '25
CPU Software Rasterization Experiment in C++
Inspired by Tsoding's post about Software Rasterization on the CPU, I gave it a try in C++. Here are the results. The experiment includes depth testing, back-face culling, blending, MSAA, trilinear filtering, gamma correction and per-pixel lighting.
I am impressed that a CPU can draw 3206 triangles at 1280x720 with 4x MSAA at ~20FPS. I wouldn't try to build a game with this renderer, but it was a fun experiment.
216
Upvotes
10
u/yetmania Sep 07 '25
Thank you.
The lights aren't shadow casting. I was thinking of implementing shadow mapping, but I feel my CPU is starting to hate me. I am already using multithreading to get the barely-serviceable framerate in the video, so I would need to optimize the code before adding anymore workload.