Graphics Projects

I’m taking a graphics class at UCF, and we’ve been working on a set of projects for hardware rendering and ray tracing. The professor was very flexible about the language and graphics libraries we employed, so I chose C# and XNA. I’m actually writing a set of posts on this and will publish them under the Ray Tracing page. But for starters, here are some screenshots from the first few iterations.

(Click on the images for a larger version.)

Project 1 (Hardware rendering)

 Project 1 (image 1) Project 1 (image 2)

This project used the hardware renderer to draw the car, a reference grid, and the surrounding skybox (just a set of quads with a garage-looking texture on it).

Project 2 (First iteration of the ray tracer)

 Project 2 (image 1) Project 2 (image 2) Project 2 (image 3)

The first image is a simple triangle and sphere set against a crimson plane with diffuse lighting and a single light in the scene. The second image is a white plane with three colored lights set directly in front of the it. The third image is a box made of six colored planes and a model of a wooden fork (with a single light in the scene). All images are at 640×480.

Project 3 (Ray tracer with shadows, reflection, and refraction)

 Project 3 (image 1) Project 3 (image 2) Project 3 (image 3)

This version demonstrates hard shadows, reflection, refraction, and Phong shading.

The first image is a set of 4 spheres and a refractive face (2 triangles with a refractive index of 1.3) within a box of 6 planes and 2 lights in the scene. The second image kinda represents a mini-solar system (with a very small sun) on an olive drab plane with 3 lights in the scene. The third image traces 2 spheres and a refractive rectangular face (refractive index of 1.1) near the intersection of 2 planes with single light in the scene.

Comparing a scene with different color methods

I thought it’d be interesting to flip through a single scene and compare the output of each color method. The methods are WithoutLighting, WithLighting, WithHardShadows, WithReflection, and WithRefraction (where each subsequent method incorporates the previous methods). Here goes:

Without Lighting With Lighting With Shadows

With Relection With Refraction

I’m going to publish a set of write ups about all of this, so keep an eye out.


4 Comments so far

  1. Joel Martinez on February 16th, 2007

    nice! I’m curious though to find out what API you’re using to draw your raytraced images. You mention that you’re using XNA, but that doesn’t really have any pixel manipulation APIs (aside from setting texture data).

  2. Paul on February 17th, 2007

    Hey Joel,

    It’s all homegrown code. Essentially, I’m building up a Texture2D object by casting rays into the scene and looking for objects that the rays intersect with. At each intersection point (closest to the camera) I compute a color. That color is modulated by the lights in the scene, each object’s material properties and so on. At the end of each pass I draw the resulting texture to the screen.

    I’m going to publish the code shortly (after I finish the next iteration on acceleration techniques — it’s a bit slow at the moment).


  3. ziggy on February 20th, 2007

    Nice work! Any chance of sharing the source with the community?


  4. Paul on February 25th, 2007

    You got it Ziggy, I’ve just added a blog entry with the source and an initial introduction to the code. This can be found at


Leave a reply