Renderman User Documentation
Subsurface Scattering and Brickmaps


A phenomena occurs when light strikes a surface.

Depending on the material, light can bounce back - creating specular and color bleed.

Light is also absorbed by the material and scattered throughout.

Subsurface Scattering is the procedure for creating this effect. This write-up explores the methods for which RfM generates data to calculate subsurface effects.
 


Figure 01: Bake Radiance Surface Shader



Renderman's SubSurface procedure can be executed with knowledge of RSL, RiSpec, and an understanding of point clouds and brickmaps.

In previous write-ups point cloud generating bake passes were used to store occlusion data.

A similiar process is used with Subsurface Diffusion.

The objective is to create a SSDiffuse channel for the scene.

A point cloud containing radiance information is passed to the brickmake.exe to generate a radiance brickmap.

In the point occlusion write-up a shader was used to read baked occlusion data.

In this case, a shader that reads radiance data from a baked brickmap is needed.

Subsurface effects are dependent on lighting, therefore, the scene must have a lightsource.

Figure 01 is a surface shader for the preliminary bake pass. This shader instructs Rman to generate a point cloud with a radiance channel.

The resulting point cloud can be seen in Figure 02.

 


Figure 02: Point Cloud with Radiance Channel



Unlike occlusion - which is float data, ssdiffuse is color data. For color data, point clouds are not a practical format to use.

This is where brickmaps come into use.

Brickmaps convert the point data of point clouds into six-sided cubes. Each face holds color data.

The brickmake executable will convert a point cloud to a brickmap. From the command line: brickmake input.ptc output.bkm

 

Figure 04: Subsurface Diffuse Sequence 02



The radiance brickmap is plugged into a 3Dtexture function in the beauty pass's surface shader. The result is figure 03 - a ssdiffuse display channel.

From this output it is clear the bake pass's ssdiffusion shader needs to be modified.

SSDiffuse parameters Unit Length and Albedo can alter the behavior of the light entering the object.

Another approach to modifying scattering behavior is with the PTfilter executable.
 

Figure 04: Subsurface Diffuse Sequence 02



The PTfilter executable takes the radiance point cloud input and outputs a point cloud with new radiance information.

This is done with PTfilter's preset material tags. Add a material tag and write in one of their presets.

Figure 04 is the sequence with ssdiffuse channel.

With a subsurface brickmap and the occlusion point cloud generated from the previous write-up we can combine the two respective surface shaders.

Figure 05 is a surface shader that reads both point occlusion and ssdiffusion.

Combined with Display Channels to output AOVs, we have a very robust and practical surface shader.
 


Figure 05: Point Occlusion and Brickmap SSDiffuse Surface Shader



Figure 06 is the resulting sequence of a shader that multiplies occlusion and subsurface diffusion to Cs in shader.

Using the occlusion and subsurface diffuse AOVs in post-render compositing resulted in Figure 07.
 

Figure 06: Occlusion and SSDiffuse Comp 01



Note: When developing ssdiffusion, it's best to use the surface shader's parameters - not PTfilter. The ssdiffusion parameters provide more avenue for modification.
 


Figure 07: Occlusion and SSDiffuse Comp 02