Homework 2 - Part 3: Refraction

In the last part of the second assignment, we are expected to introduce Refraction for the objects which have transparent material(dielectric). A transparent material refracts and reflects the light according to refractive index of two mediums and angle of the light.

In my implementation, I followed the calculations which were shared at the lecture. They can also be found in "Fundamentals of Computer Graphics 3rd Edition" (Shirley, and Marschner, 2009).

When a reflection happened, I increased current recursive step. Also, I didn't let any reflection happen, if max recursive depth is reached. On the other hand, I didn't change current recursive step for the transmitted ray, since it is just refracted version of the incoming ray.

cornelbox_glass.xml (100 samples for each pixel)

[bilaly@Kalimdor | 23:34:59 | HW2]$ ./raytracer ../scenes/cornellbox_glass.xml 
Scene is parsed
Starting rendering on #8 thread(s)
cornellbox_glass.png(800x800) is saved in: 18 seconds 356 milliseconds 429 microseconds

scienceTree.xml (100 samples for each pixel)


[bilaly@Kalimdor | 23:33:31 | HW2]$ ./raytracer ../scenes/scienceTree.xml 
Scene is parsed
Starting rendering on #8 thread(s)
scienceTree.png(1440x720) is saved in: 50 seconds 264 milliseconds 566 microseconds

Yorumlar

Bu blogdaki popüler yayınlar

Homework 3 - Transformations, Instancing, Distribution Ray Tracing

Homework 7 - Object Lights, Spherical Environment Mapping, Path Tracing

Homework 4 - All About Textures (Textures, Perlin Texture, Bump Mapping)