Skip to content

Code for "Practical Multiple-Scattering Sheen Using Linearly Transformed Cosines" (SIGGRAPH 2022 Talk) by Tizian Zeltner, Brent Burley, and Matt Jen-Yuan Chiang

License

Notifications You must be signed in to change notification settings

tizian/ltc-sheen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teaser

Practical Multiple-Scattering Sheen Using Linearly Transformed Cosines

Source code of the talk "Practical Multiple-Scattering Sheen Using Linearly Transformed Cosines" by Tizian Zeltner, Brent Burley, and Matt Jen-Yuan Chiang presented at SIGGRAPH 2022.

  • The pbrt-v3 directory contains our reference implementation of the final sheen BRDF together with additional baselines and prior work that we compare against in the supplementary material.

  • All code necessary to reproduce the LTC fitting is located in the fitting directory.


We introduce a new volumetric sheen BRDF that approximates scattering observed in surfaces covered with normally-oriented fibers. The implementation is based on a linearly transformed cosine (LTC) lobe [Heitz et al. 2016]. To be precise, our cosine-weighted BRDF is

$$ f_r(\omega_i, \omega_o) \cos\theta_o = C_\text{sheen} \cdot R_i \cdot D_o \left( \frac{\textbf{M}^{-1}_i \cdot \omega_o}{|| \textbf{M}^{-1}_i \cdot \omega_o ||} \right) \frac{| \textbf{M}^{-1}_i |}{|| \textbf{M}^{-1}_i \cdot \omega_o ||^3}, $$

where $D_o$ is a normalized clamped cosine distribution and $C_\text{sheen}$ is an artist-specified RGB scale. The directional hemispherical reflectance $R_i \in \mathbb{R}^{+}$ and the linear transform $\textbf{M}^{-1}_{i} \in \mathbb{R}^{3\text{x}3}$ both depend on the incident elevation angle $\theta_i$ and a roughness parameter $\alpha$.

Their values are fit to a reference BRDF for a regular grid of 32 inputs for both $\alpha$ and $\cos\theta_i$. For a good approximation, we found it sufficient to only fit $R_i$ and two values $A_i, B_i$ of the full matrix

$$ \textbf{M}^{-1}_i = \begin{bmatrix} A_i & 0 & B_i \\ 0 & A_i & 0 \\ 0 & 0 & 1 \end{bmatrix}. $$


In terms of reference BRDFs we use two versions in this codebase (which are both impractical to use directly in a renderer):

  1. The volumetric layer with a fiber-like SGGX phase function discussed in the talk abstract, where the cross section parameter $\sigma \text{ }\in\text{ } [0, 1]$ is mapped to the roughness as $\alpha = \sqrt{\sigma}$. Importantly, this includes multiple-scattering which requires a costly stochastic evaluation via random walks. Further, we are only interested in its reflected component which is poorly importance sampled in some configurations and thus can have unacceptably high variance. (See code)

  2. An analytic approximation of the above that is very cheap to evaluate. However it cannot directly be importance sampled which also leads to variance in practice. (See code)

By fitting suitable LTC parameters we can sidestep all of these issues and arrive at BRDFs with efficient evaluation and perfect cosine-weighted importance sampling. Because the cosine is baked in (for sampling efficiency), the resulting BRDF is only approximately reciprocal, which we did not find problematic in practice.

We provide precomputed coefficient tables for both versions. They are also visualized below.


Fitted BRDF NumPy array C++ array
SGGX volume ltc_table_sheen_volume.npy ltc_table_sheen_volume.cpp
Approximation ltc_table_sheen_approx.npy ltc_table_sheen_approx.cpp

LTC coefficients (volume) LTC coefficients (analytic approximation)

Note how the left-most parts of the tables for version (1) are not smooth. The stochastically evaluated BRDF is particularly noisy in those $\theta_i, \alpha$ configurations which leads to an unstable fitting process. However this does not cause any issues in practice as the reflectance $R_i$ is also very small in those cases.

Version (2) produces lookup tables that are smooth in all regions, but at the cost of slightly higher approximation error compared to the original SGGX volume layer reference.

About

Code for "Practical Multiple-Scattering Sheen Using Linearly Transformed Cosines" (SIGGRAPH 2022 Talk) by Tizian Zeltner, Brent Burley, and Matt Jen-Yuan Chiang

Resources

License

Stars

Watchers

Forks