Rib & Rsl
|
Introduction
Release 15 of prman introduced a new technique for rendering volumes using surface
shaders rather than interior (volume) shaders. A description of the technique can be
found at, Volume "cylinder" [-1 1 -1 1 -1 1] [2 2 2] Volume "ellipsoid" [-1 1 -1 1 -1 1] [2 2 2] Volume "cone" [-1 1 -1 1 -1 1] [2 2 2] Volume "cylinder" [-1 1 -1 1 -1 1] [2 2 2] This tutorial looks at a few of the issues relating to the specification and shading of a "box" volume primitive. |
Values Within a Volume
By its very nature, the shape of a Blobby is defined by a 3D "cloud" of floating point values.
The
envelope that defines the shape of a Blobby encloses the values that are greater than zero.
A surface shader rendering a volumetric Blobby has access to those values via
a variable called An ExampleListing 1 provides a simple example of a "box" volume primitive that has a width and height of 2 units and a length of 4 units. It has a "lattice" of 3 x 3 x 3 divisions and consequently can have 27 values bound to it. The dark areas in figure 1 show (approximately) the effect of the lattice vertices that have been assigned a "density" value of 0.1. |
The code for the simpleSmoke shader used to shade the "box" volume is given in listing 2. Of course a lattice with only 3 x 3 x 3 divisions can hardly be expected to yield interesting images.
|
Listing 1 (simpleBoxVol.rib)
|
|
Listing 2 (simpleSmoke.sl)
Although the archive (pre-baked) rib shown above is trivial, it does conform to the format of a correctly structured file. Apart from being much more complicated, archives generated by professional 3D applications such as Maya/RfM Pro or Houdini follow the same format. They also include commented text at the head of their archive files. |
Rib File Using an Archive
|
© 2002- Malcolm Kesson. All rights reserved.