# FART (FART Ain't A RayTracer)

Project Description Code Design Document Screenshots Final Report

## Project Description

FART is my semester project for the Computer Science 658 class at Grand Valley State University. My goal is for FART to be a distributed, object-oriented raytracer. The name is a recursive acronym similar to GNU or LAME.

FART will take in a scene-description file in some sort of ASCII-based input file format. After the scene file is parsed, it will be raytraced (rendered) according to the render options. Some of these options can be specified on the command line and others can be specified in the scene description file. When a given option can be specified both places, the command-line options will override what is in the scene file.

Rendering can be done using the built-in distributed algorithm. Command-line options will be utilized to specify a "host file" which can contain a list of hosts to use while rendering the scene. The algorithm will be fault-tolerant so that if one of the worker nodes goes down the work can be reorganized to complete that section of the image.

## Code

You can retrieve a copy of FART from my Subversion repository using the command `svn co svn://holtrop.homelinux.com/fart/trunk fart` Build using `make` and run with something like `./fart scenes/infinity.fart`

## Screenshots

Revision 25 - I can write .bmp files but I'm not doing anything with scene data yet.

Revision 43 - FART can intersect a ray with a sphere but doesn't have lighting/shading/material colors yet...

Revision 45 - cheap lighting based on implicit light source at the viewpoint

Revision 46 - multisampling is working (back to a flatly-shaded sphere to show the anti-aliasing effect on the edges)

Revision 62 - added a Plane shape type, I really need to get some better lighting working

Revision 76 - Phong shading model working with ambient, diffuse, and specular light components

Revision 121 - Added a Box object. No, it didn't take 45 revisions just for that. I've been working on the parser for the scene input files a lot as well.

Revision 134 - Added a Cyl object. Cyl objects can be cones or cylinders - they have a bottom radius, a top radius, and a height.

Revision 155 - Boolean intersections working. I had to rework the way I was returning intersections to also return a reference to the actual shape that was intersected with so that Intersect shapes would really return the child shape that produced the point.

Revision 162 - a few bug fixes, and added Union and Subtract shape types.

Revision 176 - More bug fixes, and reading the scene description from a file is finally working!

Revision 180 - Material definitions working

Revision 187 - Recursion working for transparent objects. Rays sent from surface point to each light source now intersect with other objects to produce shadows depending on the transparency of the objects between the surface point and the light source.

Revision 196 - Added scenes/csg.fart as an example of doing CSG. Also fixed a bug in the loading of boolean objects.

Revision 202 - Changed intersection method to also return surface normals (instead of accessing them through a separate function, getNormalAt()). This allowed Subtract objects to invert the normals obtained by the sub-object being subtracted out. This, in turn, allowed subtractions of subtractions to re-invert them, and so on and so forth...

Infinity
Created from scenes/infinity.fart