Blobby objects, otherwise known as soft objects or implicit surfaces,
enable fluid effects, such as water separating into droplets, to be modeled
and animated. This tutorial does not deal with RenderMan's Blobby RIB statement
but instead shows how the general principles of implicit surfaces can be applied
to surface shading.
The center point defines the location from which a blobby radiates
a field (of values). Much in the same way as a point source of illumination
radiates light, the strength of the field surrounding a blobby diminishes away
from its center. Eventually, the strength of the
field drops to zero at some predefined radius.
For example, the polygon shown in figure 1 is illuminatd by two point lights.
Naturally, we see the gradation of brightness across its surface. However, if
those parts of the polygon that share the same level of illumination are connected
with a colored line the polygon is, in effect, displaying a slice through
an otherwise invisible halo ie. field, of equal brightness values.
In figure 1 the red line connects all the points on the surface
of the polygon that share an intensity of 1.2 while the blue line passes
through intensity values of 0.3.
The code in listing 1 applies the principle of a blobby object
to a surface shader. Simple_blobby has three parameters that control
its blobby effect. The iso parameter controls the size of the
blobby patch that it applies to a surface. The arrays contain
the xyz location of three blobbies and their radii.
The shader uses the
The basic shader can be improved and made to generate more interesting effects in several ways. Its principle weakness is that it uses a simple "if" test to decide whether or not to apply red to the surface. This binary decision inevitably produces serious aliasing artifacts - note the jagged perimeter of the blobby coloration in figure 3.
Rather than using an "
Ideally, the explicit value of 0.05 should be substituted for a shader parameter so that the degree of smoothing can be set by the rib file.
A "contour" line can be rendered by multiplying two smoothsteps - figure 5.
In addition to their standard characteristics, blobbies can also be assigned polarity. In listing 5 we see that this version of the blobbies surface shader is passed an array of values indicating whether a particular blobby has a positive or a negative field.
Bobbies can also be given an individual color. This version uses mixtures of colors to indicate where parts of a surface have been influenced by more than one blobby.
Modifying dist with noise before it is used by smoothstep to calculate the field value has a dramatic effect - figure 8. Of course, rather than increasing the frequency of the noise by a fixed value (7) the shader should have an additional parameter to control the noise.
© 2002- Malcolm Kesson. All rights reserved.