RIB GeneratorsRIB Generators provide a mechanism to import and manipulate procedural objects. Procedural objects are objects which are generated programatically through callbacks to the RenderMan interface. By attaching RIB Generators to coordinate systems and template objects in your scene you control the context in which your RIB Generators instantiate themselves.
RIB Generators are similar to shaders in that you can:
The API for RIB Generators is quite simple. Every RIB Generator must:
// Return a bounding box for your procedural geometry.
// Make calls through RenderMan Interface using information
// Arguments from the UI are passed in as name/value pairs as
// in the RenderMan Interface. We assume that type information
// is known to the plugin.
virtual int SetArgs( int n, RtToken tokens[], RtPointer values[] );
// This may be used to cull your geometry if it's offscreen.
virtual void Bound( RIBContext *, RtBound b );
// and entrypoints provided in the RIBContext object.
virtual int GenRIB( RIBContext * );
extern "C" RIBGen *RIBGenCreate(); extern "C" void RIBGenDestroy( RIBGen * );
void GetRenderingPass(RenderingPass *p, RtBoolean *declarePhase); RtBoolean GetMotionBlur(); void GetMotionInfo( RtFloat *sa, RtFloat *FPS, RtBoolean *subframe ); int GetFrame(); void GetShutter(RtFloat *open, RtFloat *close); const char *GetObjName(); void GetCamBasis( RtMatrix m, int inverse = 0 );
The best way to learn is always by example and is a simple example of a custom RIB Generator. Example files for ribgenDumpState can be found under $RATTREE/devkit/examples/ribgen.
|
Pixar Animation Studios
|