RfM RibboxLights On Particles (Reyes)

Introduction

This tutorial demonstrates how two Ribboxes attached to two shading
groups can be used to create an effect that might be difficult or impossible to
achieve using Maya's standard tools. The workflow outlined in this tutorial
produced an animation of nearly 400 point lights "parented" to a particle system
- figure 1.

Why Use Two Ribboxes?

Instancing a light at particle positions using TCL is not difficult - listing 1.
However, because RfM writes the rib information about a particle system
into an AttributeBegin / AttributeEnd block it means that lights
"created by" the particles have no effect outside of the block. For example,

Consequently, in order for surfaces to be effected by the "particle lights" they must have a
Ribbox assigned to their shading group or groups. The role of the additional Ribbox
is to inject into the rib stream a sequence of Illuminate statements that, in effect,
re-activate the lights parented to the particle system.

The Script

The TCL script shown in listing 1 (ParticleUtils.tcl) should be copied to the
users custom TCL scripts directory that is sourced by RenderMan
Studio. Suggestions on how this can be done can be found in the tutorial,
"RfM: Customizing"

The following LoadExtension line should be added to the users custom RfM.ini file.

Step 3

Step 4

Enter the following code in the Ribbox,[addLight $OBJNAME 0.005]
The pre-defined variable OBJNAME will be automatically substituted
by the name of the
particle system. The parameter (0.005) will set the intensity of each light that
the proc addLight instances for each particle. Some experimentation
will be required before an appropriate value is chosen.

Step 5

Find the shading group(s) of the surface or surfaces to be illuminated by the
particle lights. From the Attributes menu select,
Attributes->RenderMan->Add RIB Box
Select RIB Box Interpolation TCL.

Step 6

Enter the following code in the Ribbox,[activateLights]

Step 7

Because the particle lights use the classic "pointlight" shader copy its file from,

RfM_INSTALLATION_DIR/lib/shaders/pointlight.slo

to the project directory that Maya is currently referencing.

Step 8

Open the Outliner and make sure the particle and the emitter appears
before the geometry that will be illuminated by the lights created by the particles.

Possible Issues with RfM Batch Render

If the rendered images obtained from using the Batch Render button
on the RenderMan shelf
are different to the images rendered using the Render button
the best way of discovering the cause of the error is to render one of the "root"
rib files in the batch render directory. For example, suppose the scene name is foo the
"root" rib for frame 1 will be,

renderman/foo_1122110312/rib/0001/0001.rib

Open "0001.rib" in Cutter and use control+e, alt+e or Apple+e to render the frame. Look
for errors reported in Cutter's Process Monitor. For example, a typical error might be,

Cannot find: slim/shaders/foo_1122110312/BaseVolume.slo

One way to fix such a problem is to edit the path to the shader in the attribute editor.
For example, change $STAGE to the explicit name of the scene.