Claudia Herbst-Tait
Professor
Pratt Institute
Department of Digital Arts


Surfaces & Sub-Surface Scattering: Using Mental Ray Nodes

Previously we used the Scatter attribute on a Blinn material (and several maps) to create a sub-surface scattering
effect; next, we'll use Mental Ray shader nodes.


For this tutorial, I am using the same scene as last week, only, I named it grapes_mental_ray.ma. Feel free to
use this file (its on DDA transfer), or use objects from your current project (i.e., assignment #2).


Load your file of choice, make sure to turn off Enable Default Lighting (Render Settings), and set the renderer to
Mental Ray.


In the Hypershade, switch to Create Mental Ray Nodes, open the Materials tab.


Now, scroll down, click on the misss_fast_simple; Maya created a material node (in the pop-up box, click the
Create New tab) and assign it to your object.


Note that the hardware display is not representative of the shader's actual color and that IPR is not reliable here,
thus always test render (regions) as you go along.


In the work area of the Hypershade, double-click the misss_fast_simple node to open the Attribute Editor, take
a look at the list of attributes. For example, there’s an Overall Color and, under the Subsurface Scattering Layer
tab, there are additional color attributes. Also note the Lightmap attribute which we’ll get back to in just a second.


Now, go back to Create Mental Ray Nodes, scroll down to Light Maps (open tab). Light Maps nodes provide Mental
Ray with information as to how light is absorbed by a surface. There are a couple of options… click on
miss_fast_Imap_maya.


Next, in the Hypershade, click the Shading Group tab (up there next to the Materials, Textures, Lights, tabs) –
select the misss_fast_simple shading group node and MMB drag it into the Work Area (figure 1).



Figure 1




Double-click the Shading Group node and, in the Attribute Editor, open the Mental Ray tab, open the
Custom Shaders Map. Connect the miss_fast_Imap_maya node to the Light Map Shader input (i.e.,
MMB click and drag the Light Map node into the Light Map Shader input) as depicted in figure 2.



Figure 2




Next, select the misss_fast_simple node and open the Attribute Editor. Open its Lightmap tab, click the
texture icon (figure 3); you should now see a mentalrayTexture node in your Work Area.



Figure 3




The mentalrayTexture node also needs to be connected to the Light Map node. Thus, select the
Light Map node, open the Attribute Editor, and open the Lightmap Write tab. MMB click and drag
the mentalrayTexture node to the Lightmap input (figure 4).



Figure 4




Select the mentalrayTexture node, open the Attribute Editor. Set the following: check Writable, set the File Size
Width and Height to the image size you are rendering (i.e., 720x480), set File Size Depth to 32 bits. (Note that default
Width and Height values are linked to an expression. Simply right-click and break the connection to enter your own values.)
For Image Name, enter the path to "User Works" and a name for the file it wants to save (D:/your_folder/make_up_a_file_name).


With the mentalrayTexture node still selected, graph it by using the in and output connections button (figure 5);
the connections should resemble figure 6.



Figure 5





Figure 6




Do a test render – you should now see the effect of sub-surface scattering, i.e., the object’s surface should now have
some degree of translucency and absorb light. Of course, the result depends in part on the position and quality of the
light. Figure 7 depicts the result I get using the "grape" file. The light clearly penetrates the surface.



Figure 7




OK, so now, let’s do some tweaking…


Select misss_fast_simple, open the Attribute Editor. Change the Overall Color attribute to the color of your object.
If you are working with last week’s grapes, make it a nice green or red-ish, purple-ish…you'll probably notice that
the Overall Color attribute alone does not determine the color...


The Diffuse Weight attribute determines the balance between the Overall Color and what’s below the object's surface.
When the Diffuse Weight value is set to a zero value, the Overall Color attribute does not contribute to the render;
conversely, if this value is set to 1, the Overall Color dominates and the sub-surface scattering has little to no effect.
For now, set the Diffuse Weigh to 0.7. You may want to do a comparison render on just a small region to see the
effect of this subtle change.


Further down in the Attribute Editor of the misss_fast_simple node, you’ll see Specular and Bump maps; you should
be pretty familiar with how to control those by now…Add a bump map (figure 8)…



Figure 8


Do a testrender… aaahhh.... it looks horrid.... you'll probably have to lower the Bump Depth. In my case (figure 9),
I am using a Bump Depth value of 0.05, i.e., pretty low value...



Figure 9




Btw, if you're graphing the misss_fast_simple node, this is what you should see (figure 10).



Figure 10




Now, at last, for some of those scattering attributes… let’s open the Sub-Surface Scattering tab (figure 11).



Figure 11




Note that, in many cases, the Overall Color and Front SSS Color should be similar or identical. Also, Front and
Back SSS colors should be similar (otherwise, when camera or light shift in the scene, the object's appearance
will change quite drastically). In my case, I am still using the same color map as before and also adjusted the
Color Gain (located in the Color Balance tab) to get a nice red for each of these three attributes. Here is what
I get so far (figure 12)



Figure 12




Horrid! OK, so it's far too shiny and the bump map is still too pronounced, etc. But for now, let's adjust the Sub-Surface
Scattering values, beginning with the Front and Back SSS Weight values. If these values are set to zero on both the
Front and Back attributes, sub-surface scattering is turned off. In other words, these values determine how pronounced
the sub-surface scattering effect it. (It makes sense to adjust these two values one at a time (turn one off, adjust the other).


Note that the SSS Front and Back Weight values interact with the Front and Back SSS Radius values, which determine
how the light plays across underneath the surface; the Back SSS Depth value determines how deep into the surface light
penetrates.


Figure 13 shows an example of the values I used -- all the remaining figures show different versions. Which one works best?
Personally, I like the renderings in which the grapes start looking radioactive... For a greater degree of realism, I would paint
some new color and bump maps.

Note that once I liked the sub-surface scattering effect, I realized that there was too much light in my scene. Thus, for some
of these examples, I deleted the point light that was in my scene and also experimented with replacing the spot light with a
large area light.



Figure 13






Figure 14






Figure 15





Figure 16





Figure 17





Figure 18