Kike's Software Renderer

I created this multiplatform (Windows and Mac) C++ software renderer during my spare time as a way of putting into practice the 3D rendering math and concepts that I've learnt by reading books and tutorials (like this one)

The main goal of this software renderer/rasterizer is to imitate the basic functionality of 3D APIs like OpenGL or Direct3D but doing all the processing in the CPU (instead of the GPU), the same way old games did before 3D acceleration was a standard. Ironically, the demo app uses OpenGL to display the final image on screen :)

I also gave a presentation talking about how I made it. Slides available here.

Disclaimer: Most of the code has been written from scratch without following any rasterization specific tutorial, papers, etc.. Because of this, there's probably (100% sure!) better ways of doing this. Please also keep in mind that despite I've done some optimizations to the code, it wasn't created with performance as a main objective and it is not intended to be used in "real world" applications.

The SoftwareRenderer class is capable of:

Rasterize colored or textured triangles.

Rasterize points.

Rasterize triangles in a wireframe mode.

Perform perspective correct texture mapping.

Perform back-face culling.

Clip triangles that are partially out of the frustum.

Take care of multiplying all the primitives by a view-projection matrix (set by the setViewProjectionMatrix() function)

Use two different approaches to rasterize triangles (set by the setRenderMode() function)