26.01.2015 Views

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

is an array of floats that define the bounding box of the primitive in object space.<br />

subdividefunc is the routine that the renderer should call (when necessary) to have<br />

the primitive subdivided. A bucket-based rendering scheme can potentially save<br />

memory space by delaying this call until the bounding box overlaps a bucket that<br />

must be rendered. <strong>The</strong> calling sequence for subdividefunc is:<br />

(*subdividefunc)( RtPointer data, RtFloat detail )<br />

where data is the parameter that was supplied in defining the primitive, and detail<br />

is the screen area of the bound of the primitive. When subdividefunc is called, it is<br />

expected to subdivide the primitive into other smaller procedural primitives or into<br />

any number of non-procedural primitives. If the renderer can not determine the true<br />

detail of the bound (e.g., if the geometric primitive data is being archived to a file),<br />

subdividefunc may be called with a detail value equal to RI INFINITY. This should be<br />

interpreted by the subdividefunc as a request for the immediate full generation of the<br />

procedural primitive.<br />

freefunc is a procedure that the rendering program calls to free the primitive when<br />

the data is no longer needed. <strong>The</strong> calling sequence for freefunc is:<br />

(*freefunc)( RtPointer data )<br />

Note that the rendering program may call back multiple times with the same procedural<br />

primitive, so the data area should not be overwritten or freed until the freefunc<br />

is called.<br />

<strong>The</strong> <strong>RenderMan</strong> <strong>Interface</strong> provides three standard built-in procedural primitives.<br />

<strong>The</strong>ir declarations are:<br />

RtVoid RiProcDelayedReadArchive (RtPointer data, RtFloat detail);<br />

RtVoid RiProcRunProgram (RtPointer data, RtFloat detail);<br />

RtVoid RiProcDynamicLoad (RtPointer data, RtFloat detail);<br />

<strong>The</strong>se built-in procedurals are the subdivide routines. All three may use the single<br />

built-in free function:<br />

RtVoid RiProcFree (RtPointer data);<br />

<strong>The</strong> RiProcFree procedure simply calls the standard C free() routine on data. <strong>The</strong><br />

meanings of the standard built-in procedural types are explained below.<br />

RIB BINDING<br />

Procedural procname [args] [bound]<br />

<strong>The</strong> procedural name procname must be a built-in procedural, either one of the standard<br />

ones described below or an implementation-specific procedural. <strong>The</strong> args parameter<br />

is an array of strings supplying arguments to the built-in procedural. <strong>The</strong><br />

expected arguments for each type of procedural are explained in the following sections<br />

on those primitives.<br />

EXAMPLE<br />

RtString args[] = { ”sodacan.rib” };<br />

RtBound mybound = { -1, 1, -1, 1, 0, 6 };<br />

88

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!