OSL
|
Introduction
This tutorial presents a shader called
For information about this scene refer to the tutorial RiMel - ParticleInstancer. A section of the beauty pass rib shows that each teapot archive was assigned a unique user defined attribute named "particle_id". TransformBegin
Translate -0.273621 -0.148285 -1.03048
Rotate 0 1 0 0
Rotate 291.711 0 1 0
Rotate 0 0 0 1
Scale 0.2 0.2 0.2
Attribute "user" "float particle_id" [6]
ReadArchive "RIB_Archive/pot.0021.rib"
TransformEnd
The OSL function getattribute() retrieves the value of a named attribute, for example, float id; getattribute(attrName, id); where the value of attrName might be a custom attribute such as "user:particle_id" or a standard attribute such as "identifier:id". |
The Shader UI
|
|
Listing 1 - attrToColor.osl
|
Shader RegistrationThe metadata that follows immediately after name of the shader ie. [[ int rfm_nodeid = 20, string rfm_classification = "rendernode/RenderMan/pattern", string help = "Brief description goes here." ]]
is "embedded" within the shader (attrToColor.oso) when it is compiled. If the users,
RenderMan_for_Maya.ini and |
© 2002- Malcolm Kesson. All rights reserved.