Advancement Assignment 1

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)

bunny

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).

Screenshot_2016-05-17_22-33-46

Note: code for ray triangle intersection and triangle box overlap based on Tomas Akenine-Möller implementations, available at

http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/code/

Note: code for reading ply files based on implementations available at

http://paulbourke.net/dataformats/ply/

 

Checkpoint 7

Tone Reproductions added!

Ward’s operator, 10 nits

perceptual_10

Ward’s operator, 100 nits

perceptual_100

Ward’s operator, 1000 nits

perceptual_1000

Reinhard’s operator, 10 nits

photo_10

Reinhard’s operator, 100 nits

photo_100

Reinhard’s operator, 1000 nits

photo_1000

Checkpoint 3

For checkpoint 3, shading was added through shadow rays.

Below we have the picture of the scene with simple Phong Shading.

normalShadingPhong

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.

normalShadingBlinn

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.

gridShadingPhong

Last but not least, two light sources. Again, simple Phong was used.

twoLightsPhong

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.