Edmonds

New in PRMan3.9 is the RiBlobby function, allowing metaballs to be evaluated at rendertime. While this is relativly well documented in Pixar's Application note #31, and appears to be well designed and thought out, the actuall RIB syntax is more than a little intimidating, effectivly being machine code for a virtual dataflow machine. Edmonds is an assembler for this machine, taking a human readable description of the required object and producing the required RIB description of the object.

The original release of Edmonds had a minor bug which generated an incorrect leaf count when multiply invoked from a single rib file - this shouldbe fixed now.

Users are refered to the AppNote for full details of the RiBlobby function. However a Blobby program consists of a number of expressions evaluated in sequence. These expressions may either be leaf nodes or a combination of previous expressions. Each expression is assigned to a variable allowing it to be referenced.
 

Leaf  Expressions

Leaf expressions may be either a constant, an ellipsoid, a segement or a ground plane.

Constant simply takes the form of a floating point value:
    a=1.2345
   pi=3.14159265

An ellipsoid can take three forms:
    e=ellipsoid 1,2,3,4
specifies a sphere of radious 1 centred at 2,3,4.
    f=ellipsoid 1,2,3,4,5,6
is an ellipsoid with x,y,and z radii of 1, 2, and 3 respectivly centred at 4,5,6.
    g=ellipsoid 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
specifies a unit sphere transformed by the 4x4 homogenious matrix defined by the 16 parameters.

A segment blob is a convolution surface defined by 23 parameters as specified in AppNote #31:
   s=segment 1,2,3,4,5...21,22,23
In future releases I'd like to overload this function with some simpler versions, as I've done with ellipsoid, so if anyone has any sugguestions for how simple segment blobs should be specified just email me.

A ground place can be included as follows:
    p=plane "z-file",1,2,3,4
where z-file is a depth map and that float parameters are as defined in AppNote #31.
 

Combinatorial Expressions

Having placed the basic objects from which the field is generated, these may be combined to produce the final object using the following operations.

sum (or add), mul (or product), max (or union), and min (or intersection) can combine any number of previously defined expressions:
total=sum g,s
all=union total,p
Z=mul total,all,pi,a

sub and div operate simlarly, but allow only two arguments:
diff=sub Z,total
X=div Z,a

Variables may also be renamed and negated:
newZ=Z
minusZ= -Z

The final expression is used by RenderMan to produce the blobby surface.

Example

Create a file prog.blobby constaining
    s1=ellipsoid 1,0,0,0
    s2=ellipsoid 1,1,0,0
    s3=ellipsoid 1,2,0,0
    pin=ellipsoid 3,0.3,0.3,  1,0,0

    beads=union s1,s2,s3
    result=sub beads,pin

This can be compiled:
    edmonds prog.blobby
producing the RIB code:

Blobby 4
[
1001 0
1001 16
1001 32
1001 48
2 3 2 1 0
4 4 3
]
[1.000000       0.000000        0.000000        0.000000        0.000000
1.000000        0.000000        0.000000        0.000000        0.000000
1.000000        0.000000        0.000000        0.000000        0.000000
1.000000        1.000000        0.000000        0.000000        0.000000
0.000000        1.000000        0.000000        0.000000        0.000000
0.000000        1.000000        0.000000        1.000000        0.000000
0.000000        1.000000        1.000000        0.000000        0.000000
0.000000        0.000000        1.000000        0.000000        0.000000
0.000000        0.000000        1.000000        0.000000        2.000000
0.000000        0.000000        1.000000        3.000000        0.000000
0.000000        0.000000        0.000000        0.300000        0.000000
0.000000        0.000000        0.000000        0.300000        0.000000
1.000000        0.000000        0.000000        1.000000        ]
[""]

Note that Pixar have confirmed a typo in AppNote 31 - sub is opcode 4, and div is opcode 5, rather than as in some versions of the documentation.

Inline Operation

Edmonds may also be invoked directly by the renderer, allowing the more readable blobby code to be embedded into a rib file:

Procedural "RunProgram" [ "edmonds" "
                                f=ellipsoid 1,0,0,0
                                g=ellipsoid 1,1,0,0
                                x=sum f,g
                                END" ] [ -2 2 -2 2 -2 2 ]

Due to the way RenderMan communicates with external programs it is necessary to terminate each embeded blobby program with the line END.

Download

Edmonds may be freely used provided appropriate credit is given, and I am informed of how you are using it.

Edmonds is currently compiled for IRIX, and WIN32, but can be made available for other platforms on request.

Remember Blobby objects only work in PRMan3.9

Download Edmonds for IRIX

Download Edmonds for WIN32

Ian Stephenson.
DCT Systems
NCCA,Bournemouth University