Renderman User Documentation
Point Clouds for Occlusion


In our AOV write-up we relied on raytracing to generate an occlusion pass.

For a short web video, raytracing may not seem too costly, but in an industry standard animation raytracing can induce severe CPU stress and multiply render times exponentially.

Renderman excels with taking raytraced data and storing it for reuse. Eliminating the need of raytracing after preliminary bake passes.

Figure 01: Raytraced Occlusion Sequence


Figure 01 shows the results of raytraced occlusion surface shader.

Figure 02 illustrates a standard Rman raytraced occlusion surface shader.

I've replaced the cube turntable with geometry that provides complexity that can adequately display occlusion's aesthetic - Figure 03.

 

Figure 02: Raytraced Occlusion Surface Shader



The objective is to expediate our render by omitting the raytracing process.

Using point clouds and their brickmap equivelents will see this possible with no loss in quality.

The following documents this process at the RSL and RiSpec fundamentals.

Figure 03: Maya Generated Geometry


The first step to the trace-free process is setting up a bake pass.

The bake pass is the .rib render setup involving raytracing to generate a pointcloud with occlusion data.

Figure 04 shows our bake pass occlusion shader.

This shader instructs Rman to write the occlusion data to a point cloud.

For this pass raytracing must be activated. Fortunately, only one frame needs be rendered.

The render globals dice rasterorient and culling should be deactivated for this pass.

 

Figure 04: PTC Generating Bake Pass Occlusion Shader



The resulting image is of no consequence.

However, browse to the [renderman > data] project folder and find a point cloud (.ptc) and brickmap (.bkm) file.

These files are what we desire.

They can be viewed in their respected executables (ptviewer and brickviewer) - Figure 05.

With the existing point cloud and brickmap data, the bake pass is finished.

Figure 05: Bake Pass's Generated Brickmap



A new surface shader is needed for the geometry for the beauty pass.

The bake pass occlusion shader (Figure 04) called on Rman to generate a point cloud, however now we want a surface shader that reads that point cloud - Figure 06.

The shader reads the point cloud with a string parameter - similiar to that of a texture.

The point cloud can be declared in the shader, or be written out as an external string parameter (as it is in this shader. IE [string pointcloud = "";] ).

Figure 06: Occlusion Shader Reads Point Cloud



With our point cloud shader in place for a beauty pass, we can now render occlusion without raytracing.

Before that is done, there are more settings we will want to change to our .rib to enhance render times.

We want to activate culling and dice rasterorient because they cannot damage raytracing procedures.

Since we are not tracing for the rest of the sequence there's no harm - Figure 07.



Figure's 08 and 09 are sequences of point cloud occlusion rendered without raytracing.

With tracing activated the sequence rendered approximately 1 hour per frame.

With point clouds and brickmaps the sequence renders with only seconds for frame.

Figure 07: .rib File - Activating Culling and Deactivating Raytracing



Note:
Sequences rendered through Cutter execute with performance on par with rendering from the command line. This also attributes to render time.

It is recommended that users with 3D packages render from the command line, as more CPU is available when not having to launch 3D software.

Figure 08: Traceless Point Cloud Occlusion Render Sequence 01

Figure 09: Traceless Point Cloud Occlusion Render Sequence 02