Tuesday, September 30, 2008

Outputing Images

today I've been trying to get the PNGwriter library working. I haven't worked with the commandline of g++ much and make is being a pain, but I think I'm getting close. Eventually I'll be able to output to a PNG file, and it's platform independent.

Monday, September 29, 2008

Class structure

For my first attempt I followed the book Raytracing from the Ground Up by Kevin Suffern, and I followed his structure as he laid it out. This time I'm going to try my own way, first up: Have a single parent 3D math construct class from which things like vectors, points and such are derived.

The Proposal

(this is incomplete, I forgot the antialiasing details)


This project centers around a raytracer, an application which renders a visual representation of a geometric shape in 3 dimensions. The implementation will be in C++ for the purpose of learning both the C++ language and the fundamentals of computer graphics. This study could be considered a merger of the classes Computer Science 4 and Computer
Graphics II. 

The final application will be a cross-platform application which can render an arbitrary 'scene' to an image file. The coding involved covers many aspects of C++ and general programming. The application is a large and complex project spanning over a hundred files of code. The architecture and implementation of the application is based upon the raytracer detailed in the textbook 'Ray Tracing from the Ground Up' by Kevin Suffern.
A scene is made up of one or more geometric objects, either in perfect mathematical form or tesselated triangle form defined directly in the scene file or as a .PLY file. 
A scene also includes the type, location, and direction of the virtual camera from which the scene is rendered. The type of camera will define how rendering rays originate within the scene. The three camera types are: orthographic, pinhole-perspective, and simulated lens. The simulated lens will alter the path of rays to simulate focus or 'depth of field'
Scenes also contain lights which illuminate objects within the scene. A light can be of the following types: point, directional, area, environment, ambient, or be an emmissive material on an object. Lights can have different colors and intensities. Lights can also cast shadows, emmisive objects cast soft shadows. The ambient light can illuminate all objects equally or variably as per ambient occlusion. 
Each object has a material which is made up of two bidirectional reflectance distribution functions, BRDFs, which define how light interacts with a surface. A material has a color, and may be be glossy reflective; mirror reflective; phong reflective; or perfectly diffuse.

Evaluation and expectations:
The project is considered correct and complete if it successfully does what has been outlined above, follows a consistent coding style, and is appropriately documented. The application will be able to to closely approximate the 'cornell box' render target, less diffuse-diffuse light transport.   graphics.cornell.edu/online/box/compare.html
The student will meet with the faculty sponsor every two weeks to discuss the progress that has been made and to focus continued progress. The project will involve a minimum of 100 man-hours of work on the part of the student.


I will be using the following tools:
Editor: gVim
Version Control: Mercurial
Documentation: Doxygen

It Starts...

I've created this blog mainly for the purpose of publicly documenting my progress of an independent study project in Computer Science. The project is a raytracer written in C++, more information will be forthcoming. I hope to routinely update this blog.