<p>Thinking about it from a physical standpoint, it seems that it would work like a generalized version of diffuse / specular calculation.</p>

<p>You'd start with the top most layer and use fresnel etc to calculate a percentage of light that reflects vs transmits.  You then use a random number to determine which of these to do for your sample.</p>

<p>In the case of reflection, you'd do the specular lobe of your top most layer, reflect off the surface and move on.</p>

<p>In the case of transmission, you'd move to the 2nd layer.</p>

<p>At this layer, you'd once again calculate the percentage chance to reflect vs transmit.</p>

<p>In the case of reflection, you'd use the specular lobe of this second layer, do the reflection and move on.</p>

<p>In the case of transmission, you'd move to the inner layer.</p>

<p>For this inner most layer you'd once again figure out if you needed to reflect or transmit.</p>

<p>For reflection you'd use this inner layer's specular lobe.</p>

<p>For transmission, you'd do your diffuse calculation, or whatever else your inner most surface wants to do for transmitted light (sub surface scattering? refraction? etc).</p>

<p>I'm uncertain if each layer should do it's own refraction and if technically you should move the ray a tiny bit between layers to get more realistic effects.  For your case it may not make a difference.</p>

<p>But basically, if you had a sphere with 3 layers on it, it SHOULD behave as if you had 3 different spheres nested in one another that each had a single layer that handled transmission vs reflection.</p>

<p>Having a layered material is just a more compact way of saying that this is what you want, compared to having the three separate objects.</p>

CC BY-SA 3.0
2017-10-20T16:46:53.423Z
2017-10-20T16:46:53.423Z
Alan Wolfe
<p>I'm wondering about the technique used when sampling a layered material for the next event in a path tracer. I have a material with three layers: a base diffuse, specular and sheen lobes. How does one go about choosing a discrete layer to sample for the next ray direction? Is this just a random selection? If so, are equal weights assigned to the layers or are weights used based on final contribution of a lobe? Thanks for any insight into this stage of sampling.</p>

<p>~M</p>

<pathtracing>
Path Tracing & Materials
Mark Davies
# Path Tracing & Materials

(Asked by: username_0 on 2017-10-20)

I'm wondering about the technique used when sampling a layered material for the next event in a path tracer. I have a material with three layers: a base diffuse, specular and sheen lobes. How does one go about choosing a discrete layer to sample for the next ray direction? Is this just a random selection? If so, are equal weights assigned to the layers or are weights used based on final contribution of a lobe? Thanks for any insight into this stage of sampling.

~M

**Tags:** pathtracing


---

## 1 answers

### Answer by username_1 on 2017-10-20. Score: 3

Thinking about it from a physical standpoint, it seems that it would work like a generalized version of diffuse / specular calculation.

You'd start with the top most layer and use fresnel etc to calculate a percentage of light that reflects vs transmits. You then use a random number to determine which of these to do for your sample.

In the case of reflection, you'd do the specular lobe of your top most layer, reflect off the surface and move on.

In the case of transmission, you'd move to the 2nd layer.

At this layer, you'd once again calculate the percentage chance to reflect vs transmit.

In the case of reflection, you'd use the specular lobe of this second layer, do the reflection and move on.

In the case of transmission, you'd move to the inner layer.

For this inner most layer you'd once again figure out if you needed to reflect or transmit.

For reflection you'd use this inner layer's specular lobe.

For transmission, you'd do your diffuse calculation, or whatever else your inner most surface wants to do for transmitted light (sub surface scattering? refraction? etc).

I'm uncertain if each layer should do it's own refraction and if technically you should move the ray a tiny bit between layers to get more realistic effects. For your case it may not make a difference.

But basically, if you had a sphere with 3 layers on it, it SHOULD behave as if you had 3 different spheres nested in one another that each had a single layer that handled transmission vs reflection.

Having a layered material is just a more compact way of saying that this is what you want, compared to having the three separate objects.


---

