## Exercises

- ① A consequence of Fermat’s principle from optics is that
light traveling from a point in a medium with index of refraction
to a point in a medium with index of refraction
will follow a path that minimizes the time to get from the first point to
the second point. Snell’s law can be shown to follow directly from this
fact.
Consider light traveling between two points and separated by a planar boundary. The light could potentially pass through the boundary while traveling from to at any point on the boundary (see Figure 9.56, which shows two such possible points and ). Recall that the time it takes light to travel between two points in a medium with a constant index of refraction is proportional to the distance between them times the index of refraction in the medium. Using this fact, show that the point on the boundary that minimizes the total time to travel from to is the point where .
Figure 9.56: Derivation of Snell’s Law. Snell’s law can be derived using Fermat’s principle, which says that light will follow the path that takes the least amount of time to pass between two points. The angle of refraction at the boundary between two media can thus be shown to be the one that minimizes the time spent going from to a point on the boundary plus the time spent traveling the distance from that point to . - ② Read the recent paper by d’Eon (2021) that
describes a BRDF based on a model of the aggregate scattering of large
collections of spherical particles that are themselves Lambertian.
Implement this approach as a new
`BxDF`in`pbrt`and render images comparing its visual appearance to that of the`DiffuseBxDF`. - ③ Read the paper of Wolff and Kurlander (1990)
and the course notes of Wilkie and Weidlich (2012) and
apply some of the techniques described to modify
`pbrt`to model the effect of light polarization. (A more in-depth review of the principles of polarization is provided by Collett (1993).) Set up scenes and render images of them that demonstrate a significant difference when polarization is accurately modeled. For this, you will need to implement a polarized version of the Fresnel equations and add BSDFs that model optical elements like linear polarizers and retarders. - ③ Construct a scene with an actual geometric model of a rough plane with a large number of mirrored microfacets, and illuminate it with an area light source. Place the camera in the scene such that a very large number of microfacets are in each pixel’s area, and render images of this scene using hundreds or thousands of pixel samples. Compare the result to using a flat surface with a microfacet-based BRDF model. How well can you get the two approaches to match if you try to tune the microfacet BRDF parameters? Can you construct examples where images rendered with the true microfacets are actually visibly more realistic due to better modeling the effects of masking, self-shadowing, and interreflection between microfacets?
- ③ One shortcoming of the microfacet-based BSDFs in this
chapter is that they do not account for multiple scattering among
microfacets. Investigate previous work in this area, including the
stochastic multiple scattering model of Heitz
et al. (2016b) and the analytic models of Lee
et al. (2018) and Xie and Hanrahan (2018), and
implement one of these approaches in
`pbrt`. Then implement an approximate model for multiple scattering, such as the one presented by Kulla and Conty Estevez (2017) or by Turquin (2019). How do rendered images differ from`pbrt`’s current implementation? How closely do the approximate approaches match the more comprehensive ones? How does execution time compare? - ③ Review the algorithms for efficiently finding an
approximation of a material’s normal distribution function and using that
to measure BRDFs that are outlined in Section 9.8
and explained in more detail in Dupuy and Jakob (2018).
Follow this approach to implement a
*virtual gonioreflectometer*, where you provide`pbrt`with a description of the microgeometry of a complex surface (cloth, velvet, etc.) and its low-level reflection properties and then perform virtual measurements of the BSDF by simulating light paths in the microgeometry. Store the results of this simulation in the file format used by the`MeasuredBxDFData`and then render images that compare using the tabularized representation to directly rendering the microgeometry. How do the images compare? How much more computationally efficient is using the`MeasuredBxDFData`? - ② Marschner et al. (2003) note that human
hair actually has an elliptical cross section that causes glints in human
hair due to caustics; subsequent work by Khungurn and Marschner
(2017) proposes a model that accounts for this effect
and shows that it matches measurements of scattering from human hair well.
Extend the
`HairBxDF`implementation here, following their approach. One issue that you will need to address is that the returned by`Curve::Intersect()`is always perpendicular to the incident ray, which leads to different orientations of the azimuthal coordinate system. This is not an issue for the model we have implemented, since it operates only on the difference between angles in the hair coordinate system. For elliptical hairs, a consistent azimuthal coordinate system is necessary. - ③ Read Yan et al.’s paper on fur scattering
(2015) and implement their model, which accounts for
scattering in the medulla in fur. Render images that show the difference
from accounting for this in comparison to the current implementation. You
may want to also see Section 4.3 of Chiang et al. (2016a),
which discusses extensions for modeling the undercoat (which is shorter and
curlier hair underneath the top level) and a more
*ad hoc*approach to account for the influence of scattering from the medulla. - ③ Read one or more papers from the “Further Reading” section
of this chapter on efficiently rendering glints, which are evident when the
surface microstructure is large enough or viewed closely enough that the
assumption of a continuous distribution of microfacet orientations is no
longer valid. Then, choose one such approach and implement it in
`pbrt`. Render images that show off the effects it is capable of producing.