Dr. Ivan's Blog Medicine Art and Design Programming Music




About

A ray tracer is a program which takes a scene usually described by the artist/programmer and renders it into an image, with more or less physically correct calculations (see image below for an example). DIrt (Dr. Ivan's Ray Tracer) was first and foremost a learning project for me - one which I have been craving to complete for some years now. However when it comes to it, it was far from the complexity I had imagined. This code was basically written over a couple of evenings and has the following features:
  • Spheres are the primary
  • Configurable antialiasing
  • Reflection with configurable maximum depth
  • One light and user-definable camera position
  • Diffuse shading model
  • Antialiased shadows
This is where I decided that the excersize had served its purpose. Therefore there are a number of aspects to be improved upon (perhaps for the next time):
  • kd-trees or octrees to speed up rendering
  • Refraction and transparency
  • Other primitives
  • Other shaders
  • Area lights, spot light etc
  • Global illumination




Example

Here is an example of what DIrt is capable of:






Downloads

Current version: 0.3.0


Soource code (tested on Linux only): dirt-0.3.0.tar.gz





Version History

  • v.0.3.0 - reflections implemented
  • v.0.2.3 - implemented a cornell box-like example scene instead of the old one
  • v.0.2.2 - fixed sphere intersection bug
  • v.0.2.1 - shadows implemented; all renderer parameters are now configurable
  • v.0.1.2 - three algorithms for AA, now also configurable
  • v.0.1.1 - antialiasing implemented
  • v.0.1.0 - first functional build; implemented diffuse lightning, spheres
  • v.0.0.2 - re-implemented materials, common object class
  • v.0.0.1 - first ray test




Contact

If you have any questions or suggestions, feel free to contact me.




Links

smallpt - a global illumination ray tracer in just 99 lines of C++ code. Definately check this one out!