
I'm a Software Engineer currently working on the SE Core program under Westech Interational. I have also worked for AAA, Raytheon, Kamel Software, and others.
My Resume
Since a lot of my recent work has been in Java, so has my hobby programming. If you have Java applets enabled in your browser you should see a progression of spinning shapes below. The following is a journey through some of the required features of a software rendering engine.
You may see a small amount of jumpiness in the animation. This is one interesing thing about Java. It seems to me to be too difficult to reduce the impact of garbage collection on rendering. I did a bit of work to cache objects where appropriate, but there is good reason that C/C++ are considered better suited for these sorts of things.
I suppose software rendering for 3d (without help from the hardware) is a dinosaur's artform these days, but I enjoy the low level coding. Call me a dinosaur I guess.
|
Wireframe. The idea here is that you calculate the location of the eight points in 3d based on the appropriate scaling/rotation/translation matrix. Then just draw the lines from one point to the other. Much of the 3d math is in this step. If you get this far, technically you've conquered the 3d part of 3d graphics programming. Everything else is just prettying up the rendering. This step though requires matrix math for translation, rotation and scaling.
|
Flat shading / rasterization To come up with a good small set of polygons to render a sphere with, I took an Icosahedron and subdivided the triangles a couple times. We have to rasterize on the polygons to fill them in with color. But filling in the area isn't enough. In order for it to look 'real' you must shade accordingly. One easy way to approximate the amount of light to be used is to take the dot product of the light source direction vector and the normal vector of the polygon.
|
Texture Mapping Each face, having three points also can have a corresponding 'texture point'. The texture point represents a spot on a bitmap that we should consider the color source for each pixel. You interpolate over the face by pulling in the bitmap pixel and then applying the shading from the above step.
|
Gouraud shading The hard edges of the above example are undesirable for a surface that is supposed to be smooth. There are other methods that produce more photo-realistic shading such as phong shading, but in order to do realtime animation you need it to be faster. Gouraud does a pretty good job of providing a compromise.
|
Z-buffering The easiest way to determine if a point on one object is in front of a point on another object is the Z-buffer. You keep a buffer with one z value for each pixel. In this buffer you write out the z value of the pixel you've drawn. If an incoming pixel has a bigger z value than the one that's already there, you don't draw it. So we have two spheres passing by (and through) each other.
|
|