I'm currently trying to implement a Monte Carlo path tracer. I've done some research and it seems that a common approach to materials is to use a layered model. Something like this:

enter image description here

When light hits the surface, Fresnel tells us how much of that light is reflected by the first layer and how much goes to the second, and so forth.

So I did something similar, but simpler: only one layer of specular and one layer of diffuse. No transmittance yet. So far so good, I use a simple cosine-weighted brdf for my diffuse and the Cook-Torrance microfaceted model for my specular.

Now comes the hard part: what should I do once a ray hits the surface? Normally, I'd pick the brdf corresponding to the surface material, sample an incident light direction, evaluate the brdf, and divide by the right probability distribution function.

But here, a surface hit effectively corresponds to multiple materials. The naive way to handle this would be to sample once for each layer hit. But this clearly is source of a huge performance hit, causing my path to effectively become a tree.

Is there a better solution?

  • 1
    $\begingroup$ Can you not 'monte-carlo' the material layers? E.g. Weight each layer according to their reflectivity and pick one at random based on that. Deeper layers will need some attenuation based on the sum of absorption of all layers above them. $\endgroup$
    – PaulHK
    Feb 1, 2017 at 8:59

1 Answer 1


Wenzel Jakob et al presented a framework for layered Materials at SIGGRAPH 2014. Section 6.2 explains importance sampling. If you prefer code over equations, the method is implemented in the Mitsuba renderer.

  • 2
    $\begingroup$ Note that the method by Jakob et al. relies on rendering of tabulated BSDF data in some specialised Fourier basis representation. For details, also refer to the corresponding technical report. An open-source implementation is also available in the newest, 3rd edition of PBRT. The BSDF files can be generated with layerlab in Python. $\endgroup$
    – tizian
    Jan 29, 2017 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.