
Physically Based Hair Rendering
Master's thesis research on importance sampling the dual scattering approximation, to render hair with less noise for the same effort.
A head of hair carries on the order of a hundred thousand individual fibers, each of them thinner than the pixel it lands in, and each of them scattering light in ways an ordinary surface shader cannot express. A physically based renderer answers that with brute force: more samples per pixel, until the noise disappears. On the machine I had, a single frame at 512 samples per pixel took hours.
This master's thesis attacks the cost from the other side. Rather than take more samples, take better ones. It builds on the Marschner model for how light scatters through a single fiber, and on the dual scattering approximation, which is what gives light-coloured hair its colour: the light bouncing between fibers rather than off any one of them. The question the thesis answers is whether the importance sampling strategy d'Eon and colleagues designed for single-fiber scattering still pays off once dual scattering is layered on top of it.
The implementation is C++ inside PBRT, as a custom curve scattering function. It started on Pixar's RenderMan and moved to PBRT partway through, because being able to read and change the renderer's own source turned out to matter more than anything RenderMan offered. Hair density is precomputed into a sparse OpenVDB voxel grid and integrated along shadow rays to approximate the light passing through the volume. A quad-core machine with 8 GB of RAM shaped the rest: complex models had to be rendered as their camera-facing half only, and debugging ran on subframes to keep the feedback loop under a minute.
Measured as variance against uniformly sampled renders, importance sampling wins — substantially, and most visibly below 32 samples per pixel, which is exactly the range where noise is a problem in the first place. The research was carried out as a master's thesis internship at Animal Logic in Sydney, supervised by Prof. Remco Veltkamp, and published through Utrecht University's thesis repository in 2020. Both the thesis and the source code are public.
Abstract
Hair Rendering: Importance Sampling of Dual Scattering ApproximationUtrecht University · Prof. Remco Veltkamp · July 28, 2020
Rendering human hair models using individual hair fibers is a challenging task. It is challenging because of the extensive amount of hair fibers required to render a realistic model. Moreover hair fibers are very thin, resulting in noise in the renderings. To reduce this noise in a physically accurate way, more samples need to be taken. Marschner et al. (2003) proposed a physically based single fiber scattering model to render realistic human hair fibers. It is considered the founding work of current approach to physically based rendering human hair fibers.
Read the full abstractShow less
When rendering light colored hair, multiple fiber scattering is essential for the appearance of the hair color. Zinke et al. (2008) extended the work of Marschner by splitting multiple scattering up into two components: global multiple scattering and local multiple scattering. Global multiple scattering approximates the multiple scattering contribution, thereby reducing the rendering time considerably. Local multiple scattering resembles the Marschner model to keep the single fiber scattering characteristics. This approach is known as the dual-scattering method.
Importance sampling is a widely used noise-reduction technique to speed up renderings. By applying importance sampling, samples are not taken randomly (as is the case for uniform sampling), but are sampled according to a probability density distribution that favors samples that contribute more to the output rendering. This reduces noise faster and thus reduces the amount of samples that are required to produce noise-free renderings. Both uniform and importance sampling should eventually converge to the same result, with importance sampling reaching it faster.
d’Eon et al. (2013) proposed an importance sampling strategy that works particularly well for the Marschner model. This importance sampling strategy can also be applied to the dual scattering method. It is therefore very interesting to evaluate whether applying importance sampling to the dual-scattering method reduces the noise as well. This forms the main goal of this thesis: to find out if multiple importance sampling applied to the dual scattering method leads to a significant reduction of noise in the rendered image.
This report concludes by measurement and visual inspection that importance sampling for the dual-scattering method leads to a significant increase in rendering quality compared to uniform sampling. Especially up to 32 samples per pixel the noise is reduced substantially. Such an increase in quality is expected when rendering using a small amount of samples per pixel. It then becomes more important to sample high-contributing directions to reduce noise. This is exactly what multiple importance sampling is doing.
Reproduced from the thesis, in the original English.