Contact Support

Using Primvars in RenderMan

RenderMan has a feature called primvars that allow you to directly override the value of any shader parameter.

This means that you can have a single instance of a shader used by multiple pieces of geometry (for example by being placed high up in the hierarchy) with string parameters for textures, but each piece of geometry can use its own specific textures by simply creating a primvar with the same name as shader parameter.

In Katana any string attribute called textures.xxx is automatically written out to RenderMan as a primvar called xxx. For instance if your shader has a string parameter called BumpMap, setting an attribute called textures.BumpMap on a piece of geometry creates a primvar called BumpMap on the geometry with the value of the textures.BumpMap attribute.

This means that with suitably named shader parameters you can simply create attributes in Katana called textures.xxx on pieces of geometry to allow each piece of geometry to pick up its individual textures.

You can also do per-face assignment of textures using primvars. If textures.xxx is set to an array of string values, with the number of elements matching the number of faces, that array is written out as a varying primvar instead of a constant one so each face picks up its own value.

Note:  The xxx values must take the form of an array. For example, rather than:

SetAttr( ’textures.ColMap’, "newTexture" )

use

SetAttr( ’textures.ColMap’, [ "newTexture" ]