Wednesday, March 19, 2008

Software Rendering

About a year ago, I took a class on software rasterization. It really helped me understand everything that DirectX/Opengl does underneath the hood. We started out by rasterizing 2D lines and images and then moved onto a full 3D renderer all done in software (i.e. on the cpu). It was a pretty cool class. The focus of the class was mainly on implementation rather than performance, so it isn't as fast as other software renderers.

I wrote the rasterizer using c#, and the Tao opengl framework (only for sending the pixel information to the graphics card with glDrawPixels()). I posted this on image of the day at gamedev:

Here's what I had accomplished by the end of the semester:
  • Gouraud shading
  • Phong shading
  • Blinn and Phong specular reflection
  • Directional and Point lights
  • Perspective correct texture mapping
  • Normal Mapping
  • Parallax Mapping
  • Projective Texturing
  • Shadow Mapping
  • Environment Mapping - for skybox and distant reflections
  • Distance Fog
  • Depth of Field
  • Bilinear Filtering
  • Camera Interpolation, for movie creation
environment mapped reflections:

perspective correct texture mapping:

depth of field:

distance based fog:

parallax mapping:

shadow mapping with percentage closer filtering:


RagingAvatar said...

Hey, have you got any recommended reading you can offer for someone looking to write their own software renderer?

Great looking stuff, good job!

Kyle Hayward said...

There is some good information on software rendering at


Under the Software Rendering section.

Tim said...

I've (mostly) read those tutorials at - they touch on the surface, but don't go into as much detail as it sounds like your demo does... which leads me to my question :)

Have you thought about releasing the source for your software renderer? I, and I'm sure others, would find it very useful as an educational resource.

Of course I understand if you'd rather not - just thought I might as well ask!

Sebastian said...

could you please post your source-code?

I'm building a silverlight-3d-engine and could use some help.