CS 6620.001 "Ray Tracing for Graphics" Fall 2014

Welcome to my ray tracing site for the course CS 6620.001, being taught at the University of Utah in Fall 2014 by Cem Yuksel.

Welcome fellow students! I have lots of experience tracing rays, and with graphics in general, and so I'll be pleased to help by giving constructive tips throughout (and I'll also try very hard to get the correct image, or say why particular images are correct as opposed to others). If you shoot me an email with a link to your project, I'm pretty good at guessing what the issues in raytracers are from looking at wrong images.

Hardware specifications, see bottom of page.

Timing information will look like "(#t #s ##:##:##)" and corresponds to the number of threads used, the number of samples (per pixel, per light, possibly explained in context), and the timing information rounded to the nearest second.


Project 3 - "Shadows"

As I mentioned on the discussion board for this class, I decided to implement Z-fractal order rendering. The aim of doing this is to shade pixels that are close to each other spatially in a manner close together temporally. By doing this, there's a better chance the rays will hit the same data and cached data in the CPU can be reused.

Here's an example of the Z-fractal in action:

Partially shaded render.

There are 12 threads working here, each working on a large chunk of the image. Eventually, those areas will fill in and merge with each other and new chunks will be chosen. Notice that each chunk is a square: a fairly compact region of the image. Here's an animated ".gif" of the same render (with four threads and half the block size):

Animation of shading order.

I think that's rather pretty.


Shadowing had actually been long since implemented, but I ran into one sticking issue reenabling it. My BRDFs are based on table representations, but these have significant discretization issues near the ecliptic plane. The problem is that my raytracer is designed to be physically based, so every sample is weighted by the rendering equation's \(\vec{N}\cdot\vec{L}\) term. Unfortunately, this conflicts with OpenGL-style shading, which doesn't. To get around this, I have an option that multiplies a divide-by-N-dot-L factor into the BRDF table. This is where the most objectionable issues come from; since \(\vec{N}\cdot\vec{L}\rightarrow 0\) as the light approaches the ecliptic plane, the table value blows up and kills precision.

Fortunately, it seems that multiplying by \(\vec{N}\cdot\vec{L}\) is actually expected, so the problem is now moot.

(16t 100s 00:04:24):

Rendering of required scene 1.

(16t 100s 00:10:28):

Rendering of required scene 2.

I took it upon myself to finish up my microfacet BRDF code. It turns out that it's still not done, but the architecture required is now at least present. The only problem, I think, is how Fresnel is handled.

I also basically rewrote my scene loader. It was horrifically written last time. This update allows it to check all parameters and ensure everything is loaded. Basically, it should find most errors, in a way that my older code very much wouldn't. The errors are a bit less clear since to do this with a reasonable amount of code there was some generalization (fancy C++ templates! Woohoo!), but I think it's worth it.

I also resurrected some distance estimation rendering code. I fixed a number of simple problems with it and started getting some good results. Here's a level 4 Menger Sponge rendered at double the previous resolution (16t 10s 00:08:47):

Rendering of Menger Sponge.

I had more difficulty with a Mandelbulb. The following image was rendered with too high a precision, and as such shadow rays couldn't escape (16t 10s 00:02:59):

Rendering of Mandelbulb (bad).

By tweaking the parameters a little, I was able to get better results (16t 10s 00:03:14):

Rendering of Mandelbulb (better).

Unfortunately, this is still incorrect. It turns out that the distance estimator for the Mandelbulb is inaccurate at far distances, and the bounding sphere I was using to get close enough (radius \(6.0\)) still left rays too inaccurate. I shrunk the sphere to radius \(3.0\) to obtain (16t 10s 00:06:50):

Rendering of Mandelbulb (good).

Proceed to the Previous Project or Next Project.


Hardware

Except as mentioned, renders are done on my laptop, which has: