Jul 012008
 

Here are a couple experiments put together for Pixar’s RenderMan University which demonstrate programmable raytracing in RenderMan.

Custom Gather


Copyright © Pixar Animation Studios

The is an example of using the gather() construct in an unusual fashion to create an interesting visual effect. The gather() call fires a hemisphere of rays above each shading point on the ground plane, and instead of tracing the usual diffuse or specular reflections (what raytracing is most often used for), the rays return their length (i.e. the distance to) each hit object, in this case the spheres. From there it is a simple case of normalizing the average distance and mapping it into a colored ramp.

Visualizing Ray Depth


Copyright © Pixar Animation Studios

This example is a visualization of ray depth. Each ray is traced into the scene and is reflected/refracted a number of times before it terminates on the bouncing sphere. The “camera” ray is always at trace depth 0, this is when the sphere is in plain view to the camera. As it falls behind the transparent screen the trace depth increases by one. Reflections off the floor and through the screen increase the depth a step further.