Submitted by , posted on 14 March 2003

Image Description, by

I wrote my Raytracer in MS Visual C++ 7.0. The only function used to draw something on the screen is SetPixel. There's no OpenGL or DirectX performing the calculations...all algorithms were coded into the program, which then would read in the scene description (sample in the upper-left picture). The program crunched on the scene description for a while (sometimes a very long while) and would finally spit out the image. The image is also converted into a DIB section in case the user wishes to export the graphic to a file.

This program was written to learn:
  • Antialiasing
  • Reflection
  • Shadowing
  • Ambient, diffuse, and Phong illumination with point light sources
  • String parsing (just on the side, for fun)
  • Included are three sample images the raytracer can produce (currently it can only draw spheres, cubes, and cylinders). The top image is 4 spheres inside a very large cube with reflections cranked up really high. This image, with 2x AA, 10-deep reflections, at 1600x1200 resolution took just a couple minutes over 2 hours to render. The middle image was just a fun one to demonstrate different material properties and the Phong (shininess) difference between then. The bottom picture was the first one I did to demonstrate all 3 types of objects interacting, as well as multiple light sources with shadowing and reflection.

    Coming up with the project, I will be adding:
  • 3D Texturing
  • Spotlights
  • And maybe a cel-shaded implementation
  • Let me know how you like it!

    Ryan Barnard

    Image of the Day Gallery



    Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
    Please read our Terms, Conditions, and Privacy information.