String Primitive Variables

This is another neat technique modified to work with 3delight.
Each sphere has a random texture applied from a group of 8 (see the mel script for more details)

Quoted from the pixar tutorial
“Primitive Variables are a powerful feature letting you pass information to your shaders on a per object basis. If you have
already completed the Primitive Variables tutorial from the introductory section, you will be aware of how useful they are.
However, you may have noticed there are no string PrimVar nodes in Slim or Hypershade. Using our understanding of
RIB and PrimVars we can easly create a workflow for passing arbitrary strings to our shaders. This could easily be
scripted to randomize a number of texture maps over leaves or stones; or to pass other arbitrary string data to our
shaders.”

Run the mel script on the selected geometry (you will need to modify a couple of details in the script)
// select geometry pieces and run
// modify ‘rand’ for number of pieces to pick from
// modify address to where source images come from

Here is an example rsl node surface shader. Cheers Ogre

RSL NODE
parameters
:
shader_input string Tex
output color out

code:
out = texture(Tex);

Leave a Reply

Your email address will not be published. Required fields are marked *