- Raytracer
- Raytracer: The Beginning
-
This site is far behind my code. It takes effort to update!
2009 - Present
What:
I'm building a raytracer! What is that, you ask? At its heart, a raytracer traces a series of rays through a scene to form a 2D image. Each ray contributes to a portion of the color in the scene, depending on what types of objects it intersects, where it hits them, its relative position to lights, and many other factors.
Although the end goal of rendering a raytraced scene is to create something photorealistic, the workings of our raytracer will not mimic the real world exactly. As a human, our vision works by receiving energy emitted from light sources, either directly or reflected/refracted from objects in the environment. We actually interact with only a fraction of the total photons emitted by any given light source. Because of this inefficiency, we redesign our algorithm to shoot rays from an eye through objects in the scene to the lights. In this way we receive some information from every ray.
Why:
Having written raytracers before, this is not an entirely new experience for me. However, my past raytracers have been rushed affairs, typically written for a very specific purpose (a class, to learn a language). I'd like to have to a well-written and -planned codebase on which to base future explorations in the field.
Also, I've been writing mainly in Java, Actionscript, or worse at work. This gives me an excuse to brush up on my knowledge of a real programming language.
How:
The plan is to write the base code in C++ (or my version of C++, which really emphasizes the C). Visualization will initially be done via mapping a texture to a quad in OpenGL. Once I'm comfortable with the base code, I'd like to start exploring GPU acceleration with CUDA or OpenCL -- preferably the latter, if it's actually available.
This is an "in my free time" project, so I'd like the code to be available for short bursts of working at lunch, on public transportation, or elsewhere. My laptop is running the 64-bit version of Ubuntu 9.04 with gcc 4.3.3. It has a Core 2 Duo @ 1.8Ghz, 1GB of RAM, and a Nvidia 8400GS.










