Early on, I learned a lot about computer graphics by writing ray tracers.
I wrote my first one in 1987 during my senior year of high school. I had to figure out a lot of the math by myself although I did have some help from my math teacher.
The first objects I rendered were based on polygons, because while visiting RPI's graphics lab as a prospective college student, I distinctly remember the tour guide saying that ray tracing curved surfaces was "really hard." Years later I realized that she was probably talking about superquadrics, which are a special kind of curved surface that nobody has ever really used in practice.
I remember that my slow PC would take all night to render the simple images below. I would wake up extremely excited at 6:00 AM as if it was Christmas morning and stumble over to the computer in a foggy haze to see the results.
The images are in 24 bit color but I was never able to see them that way at the time. The graphics card I had could only handle a palette of 256 colors and I didn't know how to deal with that restriction effectively. I think I displayed them using a simple color cube with a lot of ugly quantization artifacts.
It wasn't until the next year in college at CMU that I found out that ray tracing spheres and cylinders was significantly easier. I wrote another ray tracer as a quick hack during the few days I had free during final exam week.
The following summer, in 1989, I wrote a more sophisticated ray tracer that handled arbitrary transformations and had a complex scene definition file format.
I read a paper about color quantization techniques to compress everything down to 256 colors that I could display on a VGA card. It would have been nice if I had known about error diffusion dithering.The next summer, in 1990, I wrote a ray tracer that supported polygons, quadrics, CSG, and texture maps. In the computer graphics class I took that fall, I added Kay-Kajia bounding slab code to optimize intersection tests. I remember being inspired by a book describing Pixar's RenderMan, and created a similar C API for scene definitions.
The following semester I got access to the graphics lab at CMU, and they had copy of RenderMan, so there was no reason to write renderers any more.
I haven't written any renderers since that time. Sometimes it's more fun when you can't go buy something and you have to write it yourself. You learn more that way.
Return to Drew's Home Page