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 13 - "Photon Mapping"
I was torn between rewriting my entire rendering pipeline or trying to fix the one I have. Since the one I have isn't actually bad, I eventually decided to try to fix it.
I was successful, tweaking my implementation to support caustic and indirect photonmaps with a Monte Carlo final gather. I . . . might be holding back some other features for next week 😀
My implementation traces photons into a per-thread vector to avoid synchronization overhead, and then merges these vectors into a single flattened representation of a KD-tree. The tree is constructed to be optimally balanced.
I discovered something interesting. Here's a low-photon count visualization of only the caustic map for the SmallPT scene modified to have a point light source (timing unavailable):

Note that the photons on the walls are mainly from the reflective sphere.
There's that strange ring at the top. At first I thought it might be a double caustic (i.e. an image of the caustic produced on the floor). Some other website I found seemed to support this. However, since caustic map photons are terminated at diffuse surfaces (like the floor), this isn't possible. Indeed, removing the floor entirely doesn't remove it. I thought maybe it was a double reflection/refraction-ish kind of thing using the other ball, but it wasn't this either.
I decided to visualize the light paths, so I wrote code that produced (timing unavailable):

This clearly confirms that the caustic is coming from the refractive sphere. It's hard to see from where, though. So, I visualized the light paths in different colors. Here's a small subset of them (timing unavailable):

The green paths are what we're looking for. Tracing them back reveals that the caustic is produced by a refracted total internal reflection of originally refracted light—that is, light refracts into the sphere, totally internally reflects off the opposite side, and then refracts back out. This is similar to the primary mechanism by which rainbows are formed (image source):

I've been working a lot on the final project (and I'm deliberately holding back some photon mapping images for that purpose). Here's a simple render of a sphere (timing neglects photon trace and build) (16t ?,^0s 00:06:01):

There's still some noise in the caustic. This happens primarily because most of the photons traced are worthless. You can get much better results by sending photons only toward the sphere. I implemented this in an extremely hacky way, and I haven't set up a rerender for that scene.
Late Monday I got the idea to try to hack in a relativistic rendering. Here's the first result of relativistic photon mapping (16t 1,^0s 00:07:49):

All lighting comes from the photon map. Clearly neat, but too excessive. Here's \(\frac{1}{4}\) the gravity rendered with Whitted rendering (so shadow rays exist, and they aren't bent). The brightness doesn't match because all this is a horrible hack (16t 1,^0s 00:05:56):

Here's the same rendered with photon mapping (16t 1,^0s 00:05:41):

Very nice. I tweaked some photon mapping parameters and increased the gravity \(40\%\). I also moved the light forward and the black hole back so as to get the gravitational lensing caustic (the light was behind the black hole, so the caustic was projected in front) (16t 1,^0s 00:05:53):

I moved the black hole back to its original position to bring the caustic more forward (since it's not under the teapot). Also, since I don't know where the caustic went on the glass sphere, I changed it to a mirror (I remembered I had forgotten to regenerate the photon map, so I had to set up this render twice) (16t 1,^0s 00:06:10):

Satisfied, here's the larger version. Ten times the photons, more photons in estimate, four times the resolution in each direction (16t 1,^0s 01:52:41):

Notice the caustic. There's a faint black spot in the middle caused by a the gravitational lens not focusing perfectly.
What this really needs is more photons, maybe some color in the reflections, and more samples. But, there's only an hour and a half left, so this is the last image for this week.
For more photon mapping, check out project 6.5 and project 6.75.
Proceed to the Previous Project or Next Project (Ray Tracing Competition).
Hardware
Except as mentioned, renders are done on my laptop, which has:
- Intel i7-990X (12M Cache, [3.4{6|7},3.73 GHz], 6 cores, 12 threads)
- 12 GB RAM (DDR3 1333MHz Triple Channel)
- NVIDIA GeForce GTX 580M
- 750GB HDD (7200RPM, Serial-ATA II 300, 16MB Cache)
- Windows 7 x86-64 Professional (although all code compiles/runs on Linux)