r/GraphicsProgramming • u/Batteryofenergy1 • Oct 18 '26
Progress on Software Rendered game in C
This is some progress of a free game i have been working. This is fully software rendered on the CPU and OpenGL is only used to render the image. I use multiple threads to render the game at full 1080p. Using SIMD instructions helps a lot to get a decent frame rate. But i am still kinda dissapointed by the performance, i think Michael Abrash's binning technique would improve it, but right now, it is decent. I am getting around 70-140 frames with I5-12400.
502
Upvotes
View all comments
Show parent comment
1
u/deftware Oct 21 '26
Nice. Are you using a z-max (or z-min, or both!) miptree for quickly comparing bounding boxes against the depth buffer? I did see a fun article about single-pass miptree building, where you're basically iterating over all LOD levels of the miptree simultaneously, by walking the image's pixels once and figuring what they contribute to each miplevel's pixels. So at LOD1 each pixel is contributing 25%, at LOD2 it's contributing 1/16th, etc... The trick to avoid precision issues was to sum everything up first, and then divide by number of contributors at the end. Granted, building a miptree is most expensive for the first few levels, and then the rest of the levels are really cheap, but it was a fun idea that I once used when building a high-precision scalar field codec, where it had to be fast. The trade-off is a bit of extra memory being used. :P
Cheers! :]