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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>The</strong>se functions access the value of the parameter named paramname of one of the<br />

shaders attached to the geometric primitive that is currently being shaded. If the<br />

appropriate shader exists, and a parameter named paramname exists in that shader,<br />

and the parameter is the same type as variable, then the value of that parameter is<br />

stored in variable and the function returns 1; otherwise, variable is unchanged and<br />

the function returns 0.<br />

Note that if the data corresponding to name is uniform, but the variable variable is<br />

varying, the appropriate uniform-to-varying conversion will take place, however, the<br />

reverse case is considered failure.<br />

<strong>The</strong> lightsource function is only available inside illuminance blocks and refers to the<br />

light being examined by the current iteration.<br />

float incident( string paramname; output type variable )<br />

float opposite( string paramname; output type variable )<br />

<strong>The</strong>se functions access the value of the volume shader parameter paramname that<br />

is stored in the volume shaders attached to geometric primitive surface. incident<br />

accesses values from the volume shader that describes the volume which contains<br />

the incident ray I. opposite accesses values from the volume shader that describes<br />

the volume on the other side of the surface. If the named variable exists and is of the<br />

correct type, the value is stored in value and the function returns 1; otherwise, value<br />

is unchanged and the function returns 0.<br />

Note that if the data corresponding to name is uniform, but the variable variable is<br />

varying, the appropriate uniform-to-varying conversion will take place, however, the<br />

reverse case is considered failure.<br />

float attribute ( string name; output type variable )<br />

Returns data that is part of the primitive’s attribute state, either from individual <strong>RenderMan</strong><br />

<strong>Interface</strong> calls that set attributes or from the RiAttribute call. <strong>The</strong> name specifies<br />

the piece of <strong>RenderMan</strong> <strong>Interface</strong> attribute state that will be returned in variable.<br />

If the data name is known to the renderer and its type and storage class match that<br />

of variable, the named data will be written into variable and attribute() will return<br />

a value of 1.0. If the data is unknown or the types do not match, variable will be<br />

unchanged and attribute() will return 0.0.<br />

Note that if the data corresponding to name is uniform, but the variable variable is<br />

varying, the appropriate uniform-to-varying conversion will take place, however, the<br />

reverse case is considered failure.<br />

<strong>The</strong> standard data names supported by attribute are listed in Table 15.4. A particular<br />

implementation may support additional attribute queries.<br />

float option ( string name; output type variable )<br />

Returns data that is part of the renderer’s global option state, either from individual<br />

<strong>RenderMan</strong> <strong>Interface</strong> calls that set options or from the RiOption call. <strong>The</strong> name specifies<br />

the piece of <strong>RenderMan</strong> <strong>Interface</strong> option state that will be returned in variable. If<br />

the data name is known to the renderer and its type and storage class match that of<br />

148

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

Saved successfully!

Ooh no, something went wrong!