home about gallery publications education links contact


..::gooey sub surface scattering::..

Note from the author: This article was written with 3ds max 5/6.x in mind. Readers should be made aware that there is are several Mental Ray SSS shaders in 3ds max 7.

Sub-Surface Scattering or “SSS” for short has been one of the industry’s buzzwords over the past year or so. For those who haven’t heard of it, here’s a quick rundown. SSS is the process of distributing light within a translucent surface, such as wax, plastic, a large body of water (such as the sea) or human skin. Ears, noses and other thin areas of the body are common uses for this lighting effect as they break up the light shone upon them and create a slight glowing effect as they appear to be illuminated from the inside. We can also illustrate the effect with some suspended matter in fluids, such as orange juice, milk or even dirty stagnant water; even though there is no internal illumination, the substance still seems to be quite bright!

Apart from illuminating fluids and thin body parts, SSS is commonly illustrated in skin shading. This can be demonstrated by looking at your own forearm in shade and then in direct sunlight. When viewing it in the shade you will notice a few of the veins underneath the skin and, depending on how warm you are, a slight red hint from any expanded blood vessels. However, if you view the same area in direct sunlight you will notice that the veins are more prominent and the red hint spreads out a little. This is because of the intense light from the sun penetrating the skin membrane and diffusing out as it passes through the layers of skin and into the muscle, veins and other, err, “stuff” in your arm and illuminating them as it passes through them. This can also be illustrated further by shining a torch over the same area or shining it through your closed fingers.

However, this type of illumination does not come without a price, and that price is render time. Even with all of these new and advanced renderers, SSS can take an age to render because of the amount of calculations required to distribute the light properly. However, if we have successfully analysed the way the light behaves with this particular type of material, we should be able to effectively fake it by adding layer upon layer of maps (and possibly entire materials depending on the overall effect) and using clever masking, blending and lighting techniques to create the desired result.

This now poses a problem. To get any decent SSS effect we need to think about what the surface looks like and how it behaves. A SSS effect on a limb is going to appear different to that on an ear or on a candle, mainly due to the thickness of the object and what material it is made of. As a limb (an arm or leg) is quite thick, the light is not going to penetrate right through the object and illuminate the shadowed side, so will therefore just penetrate and disperse on the top few layers.

Therefore we can create an additional SSS map which can be used in the Self-Illumination slot of a Standard material which is controlled by a Gradient set to illumination falloff or by using a Falloff map set to Shadow / Light, which will only display the sub-surface map when the illumination of the object is quite intense (the rest of the time it will give a subtle effect depending on the illumination intensity).

For a thinner object however we are going to have to re-work the internal illumination effect. We can still use self-illumination for to create the surface scattering effect, but any internal illumination will be dealt with by either using a Translucent shader or the translucency feature in a Raytrace Material; they both behave the same way. This shader type creates an internal illumination effect by controlling the self-illumination of the material and only displaying it in the shadowed areas and those opposite the direction of the light, although we will have to add maps to its translucency feature so that it behaves correctly. This is mainly due to the amount of falloff around the perpendicular, creating a thin membrane skin effect which is visible when the object is viewed edge-on, which it does not natively have.

Enlarge Screenshot
Create a Geosphere with a radius of 30 with 30 segments, and a Plane with a Length and Width of 2000 in the Top Viewport. Position the Geosphere so that it is sitting on top of the Plane. Add a UVW Map modifier to the Geosphere and set to XYZ to UVW mapping, add a Displace modifier with a Strength of 50 and Luminance Center and Use Existing Mapping enabled, and add a Relax modifier with a Relax Value of 1 and 3 Iterations.
Enlarge Screenshot
Open the Material Editor. Create a Smoke map, set it Source to Explicit Map Channel, Size to 30, Iterations to 1, Exponent to 0.3 and set its Color 2 to black. Go to Frame 100, enable Auto Key and set Color 2 to white. Instance copy this map into the Map slot in the Geosphere’s Displace modifier. Turn off Auto Key. In the Top Viewport, create a Skylight light and create and position a Direct light so that it represents early morning, with raytraced shadows, a Falloff/Field that encompasses the Geosphere and Overshoot turned on.
Enlarge Screenshot
Animate the sphere so that it sits on the ground as it deforms and expands. Assign a Standard material to the plane with a neutral grey colour and assign another material to the Geosphere. Set its shader to Translucent and enable Self-Illumination. Add a Mix map to the Diffuse slot and label it Stretch Mix. Set Color 1 to RGB 0,60,150, add a Falloff map to the Mix Amount slot and label it Stretch Side Control. Swap the colours, add an Output map labelled Smoke Clip to the Front slot and set its output curve as illustrated. Instance copy the animated Smoke map to the Output map’s Map slot.
Enlarge Screenshot
Add a Gradient Ramp map to the Stretch Mix map’s Color 2 slot and label it Interior Material Colour. Set the Gradient Type to Lighting, move the flag at position 50 to 54 and set it and the one at position 0 to RGB 255,132,0 and the one at position 100 to RGB 255,214,0. Instance copy the Smoke Clip map into the material’s Glossiness and Specular Level map slots. Add a Falloff map to the Self-Illumination slot, set its Falloff Type to Shadow/Light and add a Falloff map set to Fresnel to the Lit slot. Add an Output map to the second Falloff map’s Side slot, set its Output Amount to 2 and Instance copy the Stretch Mix map to its Map slot.
Enlarge Screenshot
Set the Translucent slot’s amount to 50 and add a Mix Map to its slot. Instance copy the Stretch Mix map to the Color 2 slot and add an Output map to the Mix Amount slot. Turn on Enable Color Map and raise the point on the left to about 0.5 and make the line slightly curved. Instance copy the Deform modifier’s Smoke map to the Map slot of this map.
Enlarge Screenshot
Set the Bump amount to 100 and add a Mask map to its slot. Add a Noise map to its Map slot and set the Source to Explicit Map Channel. Set the Noise Type to Fractal and set the Size to 0.5. Add an Output map to the Mask map’s Mask slot, instance the Smoke Clip map into its Map slot, turn on Invert and Enable Color Map and add an extra point to the line, positioning it at about 0.8 to the right and 1 up so the colours of the sub-map are inverted and clipped off, so the bump only appears on the non-displaced areas.
Enlarge Screenshot
The final render illustrates our gooey SSS effect with the “skin” of our rubbery object stretched so the interior colours show through.
Download the max file!
Zip file to accompany.

..::tips::..

Add a Falloff map to the Reflection slot of the material and add a Mask map to its Side slot. Add a Raytrace map to the Map slot of this Mask map and instance the Smoke Clip map to the Mask slot. This therefore ensures that the object (along with the glossiness and specular highlights) is only reflective on the areas which show the sub-surface colour, illustrating that the surface has become taut.

Finally, change the Environment background colour to a nice sky blue. We can render off the scene as it stands, but for a little extra effect, and to suggest that light is passing through the object, either do one of the following: If you have got a pretty past computer, go to the Advanced lighting section and enable Light Tracer, setting the number of Bounces to 1 and lowering the Rays/Sample if desired (perform a test render to see if render times are acceptable for your machine). You may also want to increase the Object Mult. setting.

Alternatively, create a position a low intensity Omni light dead centre of the Geosphere, prevent it from illuminating it and animate its position as the Geosphere deforms throughout the duration of the animation. Set the colour of the light to the same blue which is present in the assigned material, and animate its change in colour to (almost) the orange in the Gradient Ramp map. Finally, set and animate the Far Attenuation of this light so that the “bounced” or “scattered” light does not tint areas too far away!

We have had to use Raytrace shadows due to the way the Translucent Shader works in 3ds max. If Shadow Maps were used, we would end up with some really nasty banding right across the surface of our object where the shadow map and the translucent shader would both be trying to shade the object. Therefore to remove this banding, we can change the shadow type to Raytrace. This may take a little longer to render, but the artefacts are removed.

Initially published: 3D World magazine, Issue 49, March 2004.

Copyright Pete Draper, March 2004. Reproduction without permission prohibited.

www.xenomorphic.co.uk