Translucency Based On Shadow Buffers
Dec28,2002
Introduction
When translucent material is illuminated by some very bright light source, most of the light will enter the surface layer, and interact with the particles inside the material before exiting it. Rendering such effects often needs raytrace to find ray length, but in some cases, this task can be done by a cheaper shadow map. This note is based on Christophe Hery's Stupid RenderMan Tricks 2002. Thank all the experts for developing such a wonderful technique. And I write a template named "transl" to apply it in RAT.
You may also need a light template with category control.
How It Works
![]() |
![]() |
| 1.Find Refraction Ray T by fresnel function. | 2.Define sample points Q along T. |
![]() |
![]() |
| 3.Transform Q to the camera space of the scattering light from which the shadow map is generated, and find its depth. | 4.Compare the value with the depth stored in the shadow buffer, then we know how long the light has travelled through the object and how much it should be attenuated. |
How To Use It
![]() |
Create a cylinder and place some lights in the test scene. The brightest key light is behind the object. Attach transl to the object. Render. Nothing happened. |
![]() |
Since the shader only respond to the light belongs to a category named "scatter", attach a zjspot to the light, and change the __category to "scatter", then reload it. The shader still needs a shadow map, so attach a ShadowMapGenerator to the light. |
![]() |
Refer to the shadow map to be computed. "shdd" is the ShapeNodeName of the light. |

Render and get some image like this.

Increase "Max Distance" and "Samples".

A little displacement makes the effects more complex.
More Test Images
![]() |
![]() |
![]() |
![]() |
Limitations
Normal shadow map is nothing more than a 2-D image buffering depth data. Selecting "min" as its depth filter, all the information behind the nearest point will be discarded. So this technique cannot handle complex model yet. And color bleeding is not easy. I will find some way to fix it in the future works, I hope so.
ZJ.