Project 3

Shadows

Ray Traced View

Ray tracer MK3, revenge of the shadows...

Z Buffer

Ray Traced View # 2

Z Buffer View # 2

Bugs

I'm not sure why, but normalizing the ray in GenLight::Shadow was a bad idea. I'm thinking t_max is relative to the magnitude of the input ray, so by normalizing the ray, I'm messing up that relation. Things seem to work if I don't normalize.

Extra sneaky bugs!

Unfortunately, computers can get a little sloppy with their numerical precision. Here, shadow rays are getting trapped under the surface instead of lying exactly on the surface. An easy fix for this is to add a bias.

I found I didn't need the bias for some reason, and after talking about it in class, we came to the conclusion I probably wasn't checking for intersections with back faces (which is very important. >~<). After fixing my back face intersection test, this is the bug that creeps up without the bias.

Timing

Box Scene: 0:00:00

Test Scene: 0:00:00

Hardware

Intel HD Graphics 620, Intel Core i7 - 7500U CPU @ 2.7GHz, 16GB of memory