Project 3-2 | Pathtracer

Name: Star Li | SID: 3033789672


Overview

In this truncated version of Project 3-2, we further implement some advanced features in ray tracing. For me, I chose to add Mirror and Glass Materials and Depth of Field. In the former feature, I took advantage of the physical properties of light and materials, adding the corresponding BSDF for mirror and glass materials. Reflection and refraction are also added that make the rendered scene more realistic. In the later feature, we abandoned the original pinhole camera model and adopted the more common thin-len model. This brings in concepts such as aperture and focal length which can be tuned around to give interesting focusing effects.

Overall, this project is much shorter and easier (since I've got accustomed to working with C++) than the previous ones. It once again impresses me as many seemingly complicated physical phenomenal such as lighting and refraction can be nicely simulated/approximated by computer once you understand the math/physics behind. This part of the project also gives me several hints on potential topics for the final project.


Part 1: Mirror and Glass Materials

In this part, we achieve some interesting effects on a mirror sphere and a glass sphere.

xd
M = 0
xd
M = 1


xd
M = 2
xd
M = 3


xd
M = 4
xd
M = 5


xd
M = 100



Part2: Depth of Field

In the first part of Project 3, we assumed a pinhole camera model and built up our path-tracing algorithm on top of that. This is, however, not our eyes or real-world camera works. In this part, we will implement a better approximation (still) -- the thin-len model. Everything that can be captured by a pinhole camera is in focus, which is not the case in the thin-lens camera. Basically, all light rays that goes into a certain pixel in a pinhole camera has a direction from a fake "camera origin" (0, 0, 0) to it; in a thin-len camera since we get an entire thin lens instead of a origin point, we need to sample point on the lens and multiple rays of different direction can enter the same pixel. Below are some examples of using this thin-len model with different aperture and focal lengths.

Varying focal lengths

pixel sample rate = 32, light sample rate = 4, maximum depth = 5, aperture = 0.5

xd
focal length = 1.2 (all blur)
xd
focal length = 2.5 (near is clearer)
xd
focal length = 4.5 (far is clearer)
xd
focal length = 5.5 (all blur again)

Varying aperture

pixel sample rate = 32, light sample rate = 4, maximum depth = 5, focal length = 2.5

xd
aperture = 0.3
xd
aperture = 1
xd
aperture = 1.5
xd
aperture = 2.5



Made with ❤ with Bootstrap, by Star Li (listar2000@berkeley.edu) My Website