In this assignment, I implemented the second part of PathTracer, where I implemented various BRDF functions modeled after real life materials.
Part 1: Ray Generation and Intersection
In Part 1, I implemented models for reflection and refraction, to be used by mirror and glass materials. In the images below, I show how the mirror and glass material models react to increasing the number of light bounces. When there are 0 bounces, only light is shown from the light source, since 0 bounces means the light rays do not hit anything. At 1 bounce, only direct lighting is shown, so the scene is illuminated but the reflective and refraction materials are not. With increasing bounces, as indirect light increases, the mirror material shows a brighter reflection of the external surroundings, while the glass material shows more and more refraction as it becomes more brightly lit internally, and its shadow becomes brighter as well. You can also see the effects of the glass material in the reflection of the mirror material.
With max_ray_depth of 0.
|
With max_ray_depth of 1.
|
With max_ray_depth of 2.
|
With max_ray_depth of 3.
|
With max_ray_depth of 4.
|
With max_ray_depth of 5.
|
With max_ray_depth of 100.
|
Part 2: Microfacet Material
In the images below, you can see how, by increasing the alpha value, the material of the dragon becomes less reflective and appears more diffuse. With a larger alpha value, the distribution of microfacet normals is more spread out, so the material appears less glossy.