Approximated Subsurface Scattering is a neat trick to render cheap and fast SSS and was featured in the Dice Frostbite engine. The method relies on a pre-process, in which for every surface point normals are inverted and a distance attenuated ambient occlusion value is calculated. This value represents the mean thickness at that point, which can be used to figure out how far the light has traveled through the object to reach this point. The entire shader is pretty short and can be copy pasted from the slides.
The tricky part of course is to generate the thickness map. If you’re lazy like me and don’t want to write the whole inverted-AO renderer, here’s a step by step guide to generate the map with the free xNormal instead:
- Get a model with texture coordinates
- Open xNormal and set both High definition meshes and Low definition models to the model file (just drag and drop it over the window)
- In Baking options check Thickness map and the size of the texture you want to produce. Do not forget to set the Output File!
- Click on Generate Maps
- A thickness map image should appear in the same path Output File points to
The demo below is written with Three.js. If you open the source code of this page you can copy the demo, including shaders. Thanks to JGcount of the Polycount forums for the model called Strongman, which I took from here.