A super useful node in Arnold is the aiColorJitter node.
You can utilize this for example to create object id based texture randomization in shaders.
- Drag and drop your texture files in the Hypershade
- Create an aiSwitch node and connect the File nodes as inputs
- Create an aiColorJitter node
Set the Type to Object
Set the Input Color to black (0,0,0)
Set the Gain Max to the number of inputs (max ID + 1) minus a little number (for example 6 – 0.001 = 5.999)
Connect the Out Color R into the aiSwitch node as Index
- Connect the aiSwitch Out Color into the shader.
- You can use this method with MASH network generated instances of course
- Of course it works with OSL shaders as well (which using custom file name inputs).
File node/File Texture Name -> aiOSLShader/Filename (a custom input) -> aiOSLShader/Out Value -> aiSwitch/Input # -> aiSwitch/Out Color -> aiStandardShader/Emission Color
- The aiSwitch node can utilize 20 different inputs.