---
title: "LamaLayer"
canonical: "https://rmanwiki-25.pixar.com/space/REN25/20416060/LamaLayer"
format: markdown
---
![image](media://07b751a7-7cde-458d-bcc8-6ac8a944a88d)

<span style="color: #000000">This node vertically stacks 2 materials, with the base being at the bottom of the stack, with the Top layer above it.</span>

#### <span style="color: #3d90b3">Material Top</span>

<span style="color: #000000">Material to be used as the top layer.  </span> <span style="color: #000000">If no top layer is set, then the base material will be used by itself.</span>

#### <span style="color: #3d90b3">Material Base</span>

<span style="color: #000000">Material to be used as the base layer </span>

#### <span style="color: #3d90b3">Top Mix</span>

<span style="color: #000000">Defines the mix between the base and top layers.  </span> <span style="color: #000000">This value can either be set via the slider or B/W map, PxrPattern, or float value.</span>

#### <span style="color: #3d90b3">Top Thickness</span>

<span style="color: #000000">This value defines the thickness of the top layer. </span> <span style="color: #000000">This value can either be set via the slider or B/W map, PxrPattern, or float value.</span>

<span style="color: #000000">It is only relevant for interior effects associated with the top material, such as absorption. If the top material is itself a layer node, this value is passed on to its base component. And if the top material is a mix or add, this value is passed on to both child materials.</span>

#### <span style="color: #3d90b3">Layer Mode</span>

Switches the layering model.

- **Fresnel Blend** simply attenuates the base layer using the transmission of the top layer.
- **Smooth Coating** extends this model by also refracting the rays through the top layer.
- **Rough Coating** extends the Smooth Coating model by clamping the roughness of the base layer to the roughness of the top layer.
- **Auto** chooses the model depending on the materials that are being layered.

<span style="color: #000000">In Auto mode, Fresnel Blend will be used when the base layer is diffuse, while Rough Coating will be used when the base layer is specular.</span>

# Layering Modes

## Fresnel Blend

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| ![image](media://b70646d1-9efc-4205-8bdf-f5940b595245) | ![image](media://8d85aa56-5257-4feb-aa7a-79cad700b877) | ![image](media://623091d5-8ee8-4c9c-a809-2bedae581545) | ![image](media://6055294c-544d-4e24-8644-d8b3f5ace01b) | ![image](media://4aba8a59-0d80-4005-a2bd-5e1143974d23) |
| Rough gold base layer and dielectric top layer with varying IOR (1.0-3.0) |

## Rough Coating

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| ![image](media://fd57f889-9fec-45b4-9735-a2cdc860d109) | ![image](media://b123c553-a5ce-4cbd-9716-4c350d703ea1) | ![image](media://e1e4c54e-450d-44c5-9b4d-b5298f80290b) | ![image](media://38e6cab4-c76e-473d-b1c4-34d8fb9876ae) | ![image](media://a11eb16b-6fc2-4060-be04-2c08bb1eac50) |
| Rough gold base layer and dielectric top layer with varying IOR (1.0-3.0) |

#### Attenuation

|  |
| --- |
| ![image](media://fe9c2d8e-78c8-4df6-96e9-eae222446956) |
| LamaDielectric (absorptionColor set to red) layered on top of a white LamaDiffuse, layer thickness varying from 1 to 3.2 |

The top layer is considered for both the outgoing and incoming rays, meaning that the ray is attenuated by the top layer twice: once when it leaves and once when it exits. This is the case for both fresnel attenuation at the interface, and for absorption through the thickness of the layer.

#### Refraction

Refraction is considered by refracting both the incoming and outgoing rays through the top layer, instead of passing them straight through as in the fresnel blend mode. This changes the look of the base layer as it receives these refracted rays. As an approximation, the top layer is considered to have a roughness of zero for the refraction calculation. This means that as the roughness of the top layer increases, the accuracy of the model decreases.

#### Scattering

To compensate for rough top layers, the roughness of the base layer is clamped to the roughness of the top layer, so that if the roughness of the top layer is greater, then the roughness of the base layer will be increased to match it. This approximates the scattering of rays as they pass through the rough top layer.

#### Relative IOR

The IOR of the top layer is also tracked, so that the relative IOR of the base layer is correct. For example, if there is a water layer on top of a skin layer, the relative IOR of the skin layer will be reduced, causing lower reflectivity.

## Smooth Coating

The smooth coating layer mode is very similar to the rough coating mode, but without the roughness clamping. This allows for greater control of the base layer roughness.

## Auto

The auto mode is identical to rough coating in most cases, but switches to fresnel blend for diffuse layers. This is to accommodate for the common Diffuse < Specular < Clearcoat material configuration, where the diffuse and specular materials are thought of as one single base material, with the clearcoat sitting on top.


# Comparisons

## Weidlich & Wilkie surface types

These images show a collection of simple and common material configurations, inspired by <span style="color: #333333"> </span> <span style="color: #1155cc"> </span><span style="color: #1155cc">[Weidlich and Wilkie's arbitrarily layered micro-facet surfaces](https://www.cg.tuwien.ac.at/research/publications/2007/weidlich_2007_almfs/weidlich_2007_almfs-paper.pdf)</span><span style="color: #1155cc"> </span> . These have been rendered with both the fresnel blend mode, and rough coating mode.

![image](media://47434a15-4c1e-4482-91a1-55fc5e507d78)

![image](media://55a054bf-581e-409a-95e2-48e59810d31c)

![image](media://334f2478-f7ce-4b69-b99a-4b95356bdea6)

## Smooth gold with a rough/bumpy purple coating

These images show a smooth gold base layer with a bump mapped dielectric with absorption.

In the fresnel blend image, the effect of the bump map is isolated to the top dielectric layer, as the rays that reach the base layer only pass through the top layer and are not refracted. In the rough coating image, we can see that the bump map has a much larger effect on the base layer as the rays are being refracted by the top layer.

The absorption also works differently, giving less variation in colour across the surface in the rough coating case. This is because the refraction causes the distances that the rays travel between the top layer and base layer to be compressed into a smaller range.

We can also see that in the rough coating image, the base layer reflection is much more diffused, this is due to the scattering of rays through the top layer, which is achieved by the roughness approximation.

|  |  |
| --- | --- |
| ![image](media://1e3c6174-34f4-45fc-8fc5-e3ef4e839a6b) | ![image](media://c1b0de4a-b594-4966-9a1b-04e5ba86ef06) |
| fresnel blend | rough coating |

![image](media://583f0bb5-87ce-48e4-84fa-c55d3b404a10)

## Rough/bumpy gold with a smooth purple coating

These images are of a similar material configuration, but with the roughness and bump map on the base layer instead of the top layer. This configuration demonstrates that even when the top layer is smooth, it still creates a difference in look due to the refraction and compression of rays that reach the base layer.

|  |  |
| --- | --- |
| ![image](media://79a9d954-00c6-48d8-8650-d2d388a1944b) | ![image](media://4be02045-65d4-4a42-a48d-a5e05e551f72) |
| fresnel blend | rough coating |

![image](media://d8b335cd-a5a9-41e9-b8f9-afa2d9275427)