Archive / Category / Tutorials

I came across an article yesterday which referenced a presentation at SIGGRAPH 2004 by ATI, talking about a quick method for faking subsurface scattering in skin and had to give it a try in Blender. It’s by no means accurate, but it’s very fast and easy to set up now in Blender. The technique is apparently what they used on the Matrix: Revolutions ’superpunch’ shot, it’s basically using UV information for finding pixel locations on the surface, by rendering a baked image of the lighting and blurring it.

Luckily, with the baking tools now in Blender, this is simple. Just set up your unwrapped model so it’s rendering as usual [1], give it a new image texture and do a Bake Render Meshes → Full Render, to get a baked image of that lighting information [2]. When you do this, it’s important to set the baking bleed margin high [3], so when you blur this image later, you don’t get the black background spilling back into the visible area.


basic render baked lighting to the UV map margin bleed setting

[1] Basic render

[2] Baked UV map

[3] Margin settings

Now just load that image up as an image texture on your model’s material. You can do this without saving or packing the image since it’s still in memory, but if you don’t, it’ll be lost when you next load up that blend file, so you might as well save it. The next step is to blur this image, to fake the light scattering around under the surface. You can do this in Photoshop or something, but the easiest way is to just raise the ‘Filter’ value in the image texture [4]. This sets the width of the sampling area for when the pixels are looked up during texture mapping, and is pretty much the same as blurring the image. Switch on ‘Gauss’ to use Gaussian filtering instead of the box filter. Gaussian is much softer and doesn’t leave stepping artifaces with large filter sizes like Box does. It can also help to switch off MipMaps, though this will slow down the render as a tradeoff.

Finally, you’re going to be using this image texture to provide the lighting on your object, so first turn down your diffuse shader’s reflection value (usually ‘Ref’), give this texture a UV mapping, and turn up ‘Emit’ so the material is self illuminated by the texture. There are a few ways you could go about this such as mapping the texture to affect the ‘Ref’ channel, but what I’ve done in these examples is to turn down Ref to about 0.15, Emit up to about 0.85 and map the texture to the Color channel.

Render, and there you have it [5]! I gave it a try on my recent sculpt model, and it looks interesting there too [6]. For some situations, this works just fine, but it’s only really practical for things like skin, since it’s just blurring. It won’t handle real translucency, like light coming through a leaf.

Image texture filter settings Suzanne with fake SSS Effect applied to a sculpt model

[4] Filter settings

[5] Suzanne rendered with the effect

[6] Applied to a sculpt model

The good thing about this technique, unlike the toon shader/shadow buffer method, is that it lets you use a standard lighting and material setup. This technique isn’t view dependent, so it will be fine in animations like flyarounds, as long as the model or light sources aren’t moving. Perhaps it would be possible to get it working in animation by means of a script - i.e. for reach frame, do the bake render, and since you’re already using that image as a texture, it should go fine. Of course this is still a cheesy hack, so bring on the real thing!

Update 2006.07.04: This faking method has now been made redundant with the material node system in Blender 2.42. Check out my new node-based method, with image, movie, description and .blend file.

Here’s a video tutorial about creating a car paint shader in Blender, in time for the Blender community F1 challenge. I tried to give a thorough explanation of the theory behind it, rather than just posting the .blend file on it’s own.

mpeg4 icon  Car paint (12MB MPEG4)   /  
.blend icon  Featured .blend file

Car paint shader example image

I bought a copy of the wonderful Snapz Pro X the other day, and wanted to put it through its paces with something practical. I’d been asked about the new inbuilt Glow effect in Blender 2.34 on the elysiun.com forums, so I decided to try my hand at making a couple of tutorial videos.

They’re in QuickTime MPEG4 format, but Linux people should be able to view them with mplayer or videolan too. Feedback would be appreciated, since it’s a first time for me!

mpeg4 icon  Glow Effect 1: Basics using the glow effect (5MB)
mpeg4 icon  Glow Effect 2: Isolating individual objects (7MB)

|