Sub Surface Scattering

Maya, Mental Ray: Materials

This page is slightly old though the principles are still good.

MR SUBSURFACE SCATTERING

Subsurface Scattering is the effect of light passing inside of an object, bouncing around and then coming back out. Any object with translucent type qualities may have SSS. Typical objects include.

Skin, wax, jelly babies, Fruit, like grapes or tomatoes, silicone even marble etc.

YouTube / private - via Iframely

 

Setting Up a simple SSS Shader

MISSS Fast Shader Maya
The “Misss Fast Simple Maya” Mental Ray shader is a good shader to start with to understand what’s happening with SSS.

Diffuse, Front and Back Scatter
There’s 3 layers to this shader, Diffuse Front Scatter and back Scatter. It’s a good idea to understand what each of these layers do.

Work on each layer individually, Diffuse, Front Scatter and Back Scatter. So switch the weight of each layer to 0 and the layer we’re working on to 1. That way we can see it’s effect.

Lights need to be positioned correctly to get the right effects. Especially for back scatter as the light needs to come from behind. So we need to have back or rim lighting to see it’s affect.

Snail Man Example
The example below shows a “MISSS Fast Shader Maya” on snail man. There’s three lights in this scene. A key light, fill and back light. The back light is set strong to an intensity of 3. No GI or Final gather has been applied.

Combining Diffuse Front and Back Scatter

Each Layer Rendered By Itself

Combined Shade Settings
The image above is a combination of the three layers, Diffuse Front and back Scatter, the settings for this particular image are below.

Color Weights
Overall Color: (White)
Diffuse Weight: .3 (30%)
Front Scatter Weight: .6 (60%)
Back Scatter Weight: .6 (60%)

Depth of the Scatter
Front Scatter Depth: 3 (cm)
Back Scatter Radius and Depth: 2 (cm)

Snail Man Test Vid
Here’s the snail man in a video, graded in After Effects to show the effects of SSS
 

YouTube / andrew silke - via Iframely

Diffuse Weight
Diffuse is the regular affect normal shaders have. If the diffuse weight is set to 1, and Front and Back Scatter to 0 then there will be no SSS effect.

Diffuse Weight is the % weighting that that layer is affecting where 1 is 100% and 0 = no effect.

*The Diffuse weight and Front SSS Weight should always equal 1 when added together, or just below. Otherwise the shader will be luminous.

Back Scatter can be additive so no need to worry about it in this equation.

Front Scatter

Light that’s coming off the front light into the shader and bouncing around is called Front Scatter. The Front SSS Radius is how much the light is being bumped around. It’s in maya units, and for skin type objects is usually a cm or two. Thats .5 -3 maya units.

At zero it will look like a normal shader as there will be no bouncing.

Wax Candles have a high front scatter, ie very soft feel
The radius is important because that’s how deep the light will penetrate and get scattered around.

*The Diffuse weight and Front SSS Weight should always equal 1 when added together, or just below. Otherwise the shader will be luminous.

Back Scatter
Back Scatter is when light passes through the object from behind lighting up the front. This is seen in humans on ears with a very strong back lighting.

Back Scatter “Radius” and “Depth” can be set individually, but we usually keep them the same. If “Depth” is set to 0 then it will assume the value of the Back SSS Radius so it’s a good idea to do this.

Back SSS Radius = How much light is bouncing around inside
Bakc SSS Depth = The depth of the object before the light will pass through.

Back Scatter Weight does not need to relate to diffuse and front scatter values as it’s effect can add to the brightness of the shader as it would in reality.

 

ADVANCED SSS

 

DIGITAL TUTORS NOTES

 

MISSS Fast Shader Passes

The Shader Passes shader splits all the elements into passes, so we can comp them later.

Turn Screen Composite off (this stops lighting from over exposing, but since we are working in Linear 32bit colour space we don’t worry about this and it’s better to switch off.

When Using Indirect Lighting we need to go into the Lightmap Sample of the Shader and Click on “include indirect lighting”. It’s much faster with this off and can render test passes without and switch it on later.

Make sure your objects are modelled to scale. Scale conversion should be at 1 if you’ve modelled to scale.

We can make our front scatter and back scatter colors very different to see how they’re being affected in our scene. Ie red and blue.

Scattered Contribution attribute only turns off the diffuse completely so we only see the scattering layers.

Samples we usually don’t have to play with. It’s for noise in the translucence areas. Turn this value up to get rid of noise if it occurs.

In Shader Passes the 3 weight boxes for each scatter and diffuse always equal one. so 90 5 and 5 is the same as .9 .5 and .5?? Not sure if this is actually correct!

Light Map Scatter Bias is an attribute on the lightmap which regulates how the light will get bounced around. 1, will keep the light moving in the direction it came from. -1 one will bounce it back and 0 is the default. Leave at 0 is probably best for most situations.

 

Comparing 3 SSS MR Shaders

http://www.digitaltutors.com/lesson/20620-Comparison-of-the-three-main-fast_sss-shaders

This tute compares the 3 main fast SSS MR Shaders.

1. Fast Shader X Passes
2. Fast Simple Maya
3. Fast Skin Maya

Fast Simple Maya isn’t good because spec can’t be switched off.
X Passes automatically renders as passes and has 3 layers, diffuse, front and back scatter – no spec
Fast Skin Maya has no default passes built in but it has an extra slot for 2 front scatter passes, for two layers of skin. Has spec which can be turned off.

 

Rendering Fast Skin in Passes to a layered .exr

http://www.digitaltutors.com/lesson/20624-Rendering-SSS_skin-with-render-passes-and-displacement
Build a shader network with one shader for each of the passes

1. Diffuse
2. Epidermal (front scatter A)
3. Subdermal (front scatter B)
4. Back Scatter
5. Spec A
6. Spec B (you can join the spec if desired)

Switch the weight off for everything except the desired layer.

Create a render buffer for each shader

buffer > write to render buffer

.outvalue > .color

Name all the buffers, (important)

Setup Passes
Click on the render layer then
Render Settings Icon (Passes tab)

Create Custom Color

Make a custom color for each render pass.

Associate your passes with the render layer you want

Connect each render buffer to the Custom Color Pass in the Render Buffer Node settings dropdown

Also make the names shortergo
render settings > Common > Frame Buffer Naming (custom) type

To check your render passes use the program IMF display which comes with mental ray and maya, it’s made for 32 bit images.

 

Combining the shaders to one Beauty

Create a MIB Color mix node

Add all the layers with “Add” as the mode

Create a shader and assign to make a Shading Group

Assign the MIB Color Mix node to the material shader and the shadow shader

Assign the dummy shader to the head.

 

Displacement

Turn off the filter of your displacement file image

Alpha Gain = 1
Alpha Offset = -.5

This is so the middle color is grey

Select Surface
Rendering Editors > Mental Ray > Approximation Editor
Click: Create Displacement

Now there’s presets for the quality

Fine View Low Quality or Regular Grid Low is for faster renders
Fine View High Quality is for best results

The Bumpiness and SSS are very closely connected

 

Normal Map Creation

Creat Bump Map as per usual
Turn Filter off for the Normal Map Texture
Switch the Color Profile to Linear
Create a “MISSS Set Normal” node
Link the bump2d to the new MISSS Set Normal
.outnormal > normal

MISSS Set Normal > Shader
.outvalue > normal camera

Switch the bump map to tangent space normals

Under Bump2d > Effects Turn off blurring

If we have multiple shaders SSS style then we need the normal map to feed into the Diffuse Shader and also the Specular shader/s.

 

Optimising the shader balls in MR

If our mental ray sliders and update shaders are slowing us down, we can use the folling mel command to speed things up. This is for big complex shaders and the way MR tries to update the shader balls.

RenderThumbnailUpdate 0;

A script by DJX is available to toggle the shader ball update on and off.

 

Connecting the Colors

The main color texture goes into the color for Diffuse and also the Epidermal Layer.

Epidermal is a more saturated blurred and smaller version of the main Diffuse map.

Back scatter can be left as red.

Map Spec Color map with dots and such for the spec pass.

 

SSS Speeding Up Render Checklist

For test renders we can
1. Switch indirect light off
2. Displacement
3. Lightmap, you may manually tweak the lightmap settings
4. Turn down Final Gather or switch off or bake it out.

 

Color bleed and wavelength dependent scatter

In SSS the red rays actually travel further than the blue and green. So to get a more realistic skin look we need to factor this in. You can fake it by breaking up the channels and having the red channel go deeper into the skin.

Since Maya 2013 a new skin shader was brought in. This is called the shader2 or skin2 which has variables for this effect built in.

Split out the colors into 3 shaders with only one scatter pass mapped with a multiply and divide node then pump all the output of the shaders to a MIB color mix

output into > color 0, 1, and 2

Then the output into a mia material X

MIA has true reflection, not specular. BRDF reflection (fresnel)

Lightmap has to go into the MIA

MIA goes back to a SSS

Red Radius 2.7
Green .43
Blue .22

Tweaking teh Shader
http://www.digitaltutors.com/lesson/20630-Combining-SSS_skin-with-mia-shader

MIA material settings
.3 is a good roughness diffuse value for the face (mia)

specular color is white

map the reflectivity (spec) Oiliness, more for lips nose, forehead, less on eyebrows?

glossiness .01 (blur value of the reflections, .01 is lots)
glossy samples 128

BRDF values
.09
1
5

 

After Effects .exr layers workflow

http://www.youtube.com/watch?v=StqSiJ46O4Y
effects > 3D Layer > Extractor

Installing The Open Exr After Effects Plugin
http://youtu.be/fQFVYG8kRo0?t=14m54s

Open the dialog box and click on R > it will show all the layers

Other Way
Pro EXR Website
Download Mac

Copy Plugins into format and plugins and effects folders

Create ProExr Layer Comps

 

EXTERNAL TUTORIALS

SSS Foundations (Digital Tutors)
http://www.digitaltutors.com/lesson/3772-Understanding-properties-of-forward-light-scattering

Advanced SSS – Skin Shading in MR (Digital Tutors)
http://www.digitaltutors.com/lesson/20612-Introduction-and-project-overview

Portrait Production – Creating a Realistic Portrait in Maya
http://eat3d.com/maya_portraits

Free SSS MR Skin Tute
https://www.youtube.com/watch?v=VIYopSeGnoI&list=PLA5B647B17DF56515&index=48

Instructor

Andrew Silke

Leave a reply