---
title: "Lama Skin Shading"
canonical: "https://rmanwiki-27.pixar.com/space/RU/657555758/Lama%20Skin%20Shading"
format: markdown
---
> Macro (widget)

The following is an excerpt from a larger tutorial from Rassoul on his Making of a Samurai character, but for this lesson, we’re just going to take a look at how he setup the skin shader using Lama


> ℹ️ <span style="color: #ffffff">**Mari Texturing**</span>

The first step was transferring textures from a VFace scan from TexturingXYZ by using ZBrush and the ZWrap plugin. 

Once this was done, the textures were imported into Mari and cleaned up of any imperfections from the scan or the manual transfer process.

The Diffuse, Displacement, and Utility maps from the scan were used to create all necessary surfacing channels.

![Texturing_channels.gif](media://a40a37c8-b72c-4423-b131-a54174bea588)

> ℹ️ <span style="color: #ffffff">**Texturing Tips**</span>

####   
Roughness

When creating the Roughness channel, keep in mind that oil builds up in the pores and therefore makes them less rough than the surface of the skin. This should be subtly represented in your Roughness map.

####   
Clear Coat

The clear coat (specifically referring to the mask that is driving the shader used to create the clear coat) needs to have different values on different parts of the face, depending on your reference. However, usually the T-zone on the face is oilier and therefore requires higher values for the clear coat.

####   
Clear Coat Roughness

Similar to the Clear Coat, the Clear Coat Roughness must be dialed in based on references. The Roughness value inside the pores should be higher than that on the surface. This contradicts the theory used for the Roughness, but it helps balance out the pores and keep him from being too oily. If your character is very shiny and oily, you can make the pores shinier to match.

####   
DMFP

The Diffuse Mean Free Path is the distance light travels per wavelength, measured in r, g, b channels. This is a useful DMFP value chart for humans and is measured in centimeters.

|  |  |
| --- | --- |
| Base value | 1.9500 1.3000 0.8027 |
| Lips | 2.9000 1.8080 1.1937 |
| Ears | 3.8000 1.6077 1.2179 |
| Cheeks | 2.5000 1.3625 0.8750 |
| Nose | 2.0000 1.3333 0.8233 |
| Nostril wings | 3.9000 1.6350 1.0500 |
| Eye sockets | 1.5000 1.0000 0.6175 |


> ℹ️ <span style="color: #ffffff">**Skin Shader**</span>

The skin material is made up of 4 main parts:

- The SSS layer
- The primary spec layer
- The clear coat layer
- The displacement and Bump to Roughness layers

![skin_shading_network.jpg](media://2e9165cc-0406-4791-8aff-5353c2e1dd1f)


### <span style="color: #4c9aff">Sub Surface Scattering</span>

The “LamaSSS” shader drives the bulk of the skin material. 

Since the character has a lot of parts that are covered up by either clothing, thick hair, or armor, I made a mask for the SSS which is used to mix between two Lama bsdfs, the “LamaSSS” which is a heavy shader for the visible parts, and the “LamaDiffuse” which is a much lighter shader used for the covered up parts.

The IOR is set to 1.4, and the scale is set to 1. 

This ensures the values provided in the DMFP map are respected and not multiplied by the scale. The unit length is set to 0.1, which makes it a cm scene for the SSS calculation.

![SSS_shader_params.jpg](media://d55b09c7-e7b6-4dc1-9277-b396a850a6e7)

The shader uses the “Path-traced exponential” mode because, although it is the most computationally intensive of the modes, it is also the most physically accurate.

Human skin is forward scattering, so setting the anisotropy to 0.9 provides a realistic behaviour. Light-scattering anisotropy is typically more pronounced around cartilage or thin skin, such as the ears. 

You may need to adjust the value depending on your target photographic reference.

We need to set the SSS shader to not trace the meniscus to avoid dark lines where the meniscus intersects with the skin. We do this by creating a membership for the meniscus and adding that membership to the shader with a minus. 

We also need to tick “Continuation Rays”.

While here, we can also set the visibility and trace parameters for the meniscus, which help resolve the same issue of dark shadows and dark lines around the eye intersection points.

![meniscus_POS.jpg](media://54691a03-bc2b-4a89-93d7-a8d88f8e3459)

---

### <span style="color: #4c9aff">Primary specular</span>

The primary specular layer is made from a “LamaDielectric” shader set to physical mode with an IOR of 1.45. The roughness map feeds it, and the normals are coming from the Bump to Roughness node, which we’ll go over shortly.

###   
<span style="color: #4c9aff">Clear Coat</span>

Much like the Primary specular layer, the coat uses a “LamaDielectric” shader with an IOR of 1.37. The coat is not fed by a Bump to Roughness node or any normals node for that matter. It is fed directly only by the Coat Roughness channel.

###   
<span style="color: #4c9aff">Layered Displacement </span>

The displacement is where most of the skin detail comes from. The setup is quite basic. I’m using the RGB displacement map from my transferred scan from TexturingXYZ and adjusting the values of each channel (representing the primary, secondary, and tertiary displacement details, respectively) to match my reference. 

This was done in a “PxrDispScalarLayer.” I also set the “MIP Bias” to -4 to ensure that a higher resolution MIP was selected for all distances.

![displacement.jpg](media://5599c244-2218-43c1-8bdf-8284d7c2885d)

There was also a detail displacement pass extracted from ZBrush during modeling. I used the follicle mask from the groom to add a concave bump to this ZDisp pass using a “PxrBlend” and then layered this entire setup with the TexturingXYZ displacement to create the final displacement setup.

### <span style="color: #4c9aff">Bump to Roughness</span>

I used Bump to Roughness (BTR) to drive the fine porous bump details in the skin. This was so that the details and fidelity could be maintained from afar, even when aliasing would usually crush bump details generated by a bump shader. 

The BTR node pumps the bump details into roughness and anisotropy channels to maintain the same look when the bump is no longer visible from a distance.

I set the filter scale to 0.7 in the advanced parameters to ensure a very high level of detail in the texture mips.

You can feed the BTR node with your own roughness map by plugging your roughness map into the “Base Roughness” port. This is the roughness the BTR node will use when fully zoomed into detail, so it is your highest level of accuracy.

I had to invert the bump normal and increase the “Bump Normal Gain” significantly to get the look I wanted.

![BTR_params.jpg](media://ce98d05b-3e32-4d34-8995-2597c1f42b56)