Subsurface Scattering

Subsurface Scattering

  • Important

    This page has been updated to reflect the changes in the new shading system introduced in RMS 4. Please be sure to download the latest tutorial file package for compatibility.

Subsurface scattering is an important effect for realistic rendering of translucent materials such as skin, flesh, fat, fruits, fungi, milk, marble, and many others. Subsurface scattering is responsible for effects like color bleeding inside materials, or the diffusion of light across shadow boundaries.

Tutorial: Subsurface Scattering

To get started, let's open the Maya scene, rms4SSS.ma.

(Where are the tutorial files?)


1. Before Subsurface Scattering

Before we get started let's render our scene without subsurface scattering:

Render-> Render Current Frame

You'll get an image like the one below:

images/rms4SSSOOB.png

The basic scene

What you've got here is your basic, garden-variety mushroom, nestled comfortably on a bumpy plane. We have a Maya Spot Light serving as our "key" light and an RMSEnvLight providing fill. Thanks to the recent improvements in PRMan's ray tracing performance, not to mention the new implementation of ray-traced subsurface scattering, we're tracing rays straight out the gate, yo.


2. Adding Subsurface Scattering

Attached to the fungus among us is one of the fancy new RMSGPSurface nodes. It is the proverbial kitchen sink, the Swiss Army-slash-Delux-slash-AllPurpose of yore, and all good things wrapped into one. (For details, check out About RMSGPSurface in the RMS 4 Shading & Lighting section.) We've got a fungi diffuse color goin' on, and we've tweaked our diffuse and specular settings to give us a nice little something, all ready for us to add some Subsurface Scattering.

So...

In our RMSGPSurface, scroll down to the Subsurface Controls, open the disclosure, and change the Diffuse Mix setting to something that's not zero (and preferably less than one) by moving the slider to the right (for the image below, we've spiked it to the right, because tutorials are no place for subtlety).

Also, we need to make sure that the light that's scattering through our mushroom makes it to the surface, so bump the Diffuse Mean Free Path (DMFP) up to 10. Furthermore... the default setting for Samples - 16 - is fast but noisy, so let's bump that up to 64, which will clean it up and have a virtually imperceptible effect on our render time.

images/rms4SSS.png

Scattering!


3. Tweaking Subsurface Scattering

There are a number of ways to affect the look of your subsurface scattering. We've already mentioned the Diffuse Mean Free Path, which you can use to control how much light is getting to the surface of your object. That light can also be tinted, and we can change our material's albedo, which affects how the light is absorbed.

In our scene you can find a simple fractal texture in the Hypershade. Let's connect its outColor to the sssAlbedo of our RMSGPSurface. Or, if you'd rather, you can simply change the Albedo color, or attach whatever you'd like via the Attribute Editor. We've also opted to tint our DMFP with a bit of red, because... um, just because. It looks kinda cool. For a final image, you might choose to increase the samples, too. Also, this mushroom geometry features some sharp curvature, so we've enabled the Smooth Features parameter under the Advanced Subsurface settings.

Annnnd... renderfy!

images/rms4SSSfancy.png

Fancy!

Speaking of the Advanced Subsurface settings, here is also where you can define a subset of trace objects, set a maximum distance for contributing objects, and even enable indirect light contributions to the subsurface scattering calculation (disabled by default).


4. Point-Based Subsurface Scattering

If you're like me, you live in a world where mushrooms don't move much. In fact, there could be lots of situations where you have assets that use subsurface scattering that won't change from frame to frame. Or maybe you just like point clouds. Regardless of your motivation, a point-based subsurface scattering workflow is basically exactly as we've described for ray-traced subsurface scattering, with one simple change: under the Subsurface Controls, in the Point Based SSS section, change the Sss Map parameter from "none" to "compute". (Note: you should also make sure that the Unit Length parameter in the _SSDiffuse pass settings matches the Unit Length you're using in your shader.) Annnd... renderfy!

images/rms4SSSptc.png

Point-based Subsurface Scattering

A few notes about point-based subsurface scattering and passes:

  1. There is a default subsurface scattering pass that is used when you enable "compute" for the Sss Map parameter. This same pass will be used by any and all shaders for which you enable that parameter. You can, however, create separate explicit passes, manually, and reference them in your shader via the Sss Map Connection field by right-clicking and selecting an existing pass or choosing to create a new pass.

    Note that when creating a pass explicitly you have can choose to bake out an organized point cloud, a regular point cloud, or a brick map. Baking to a brick map actually creates a third pass, because a point cloud is generated first, then that point cloud is converted into a brick map.

  2. Any pass can be reused by changing Caching Behavior in its Settings from "compute" to "reuse".

  3. Point-based subsurface scattering is actually two additional passes, one, _SSDiffuse, that generates a point cloud, and another, _SSRender, that renders the subsurface scattering (or "volume diffusion"). The _SSRender pass has all the basic settings that any render pass has, including the ability to manage secondary outputs for the render pass.


5. And In Conclusion...

PRMan has long been highly regarded for its subsurface scattering, garnering awards and setting the standard for realistic organic materials. Recent releases of the renderer have extended and improved the support for this feature, enabling the slick and easy implementation of subsurface scattering in RenderMan for Maya's new GP shading system. Both ray-traced and point-based solutions are simple to set up and use, provide superior results, and can be mixed and matched for the highest quality renders in any production scenario.

For detailed technical information about PRMan's subsurface scattering, take a look at the Translucency and Subsurface Scattering application note in the PRMan Manual.

images/rms4SSSdeluxe.png

Subsurface Scattering, IBI, and Thrice-Bounced Indirect Illumination