Advancement assignment 1: Kdtree and Stanford bunny.
First advancement assignment was implemented on the ray tracer. When using the complete bunny model some errors show up, but still here are the results.
Time to build tree: 3.394 secs
Time to render scene: 491.510 secs
Time to render without Kdtree: over 1 hour (gave up after 1hr)
Above is the picture with the whole model. Some spots show no triangles, not really sure why. However, simpler models work just fine. Check below the same model but with half the triangles (file bunny_res2).
Note: code for ray triangle intersection and triangle box overlap based on Tomas Akenine-Möller implementations, available at
Note: code for reading ply files based on implementations available at
Tone Reproductions added!
Ward’s operator, 10 nits
Ward’s operator, 100 nits
Ward’s operator, 1000 nits
Reinhard’s operator, 10 nits
Reinhard’s operator, 100 nits
Reinhard’s operator, 1000 nits
Checkpoint 5, added reflection to the back sphere!
Procedural texture for the floor was added for checkpoint 4.
For checkpoint 3, shading was added through shadow rays.
Below we have the picture of the scene with simple Phong Shading.
Next, one of the bonuses: Phong Blinn shading. Exactly the same values for the materials and light radiance where used, you can see the difference of both models.
Now another bonus, spawning arrays. I have made it possible to spaw arrays inside pixels in a grid, so inside each pixel we have 9 equally spaced rays that return color values which are averaged to get the final color of the pixel. Notice how the edges are less sharp. For this picture simple Phong illumination was used.
Last but not least, two light sources. Again, simple Phong was used.
More than two light sources can be used. It’s also possible to combine grid rays, multiple light sources and either Phong or Phong Blinn shading together. Here are just a few of the combinations for the sake of not making a huge post.
Second checkpoint, ray tracer framework. Here is the picture with rays coming from the camera and intersecting with the objects, each object with a different color.