Jitter between texture maps?

Jitter between texture maps?

VictorvdBrink
Enthusiast Enthusiast
1,502 Views
3 Replies
Message 1 of 4

Jitter between texture maps?

VictorvdBrink
Enthusiast
Enthusiast

Hi there. 

I was wondering whether its possible to use something like aiColorJitter node but instead of just having the node generate the color, have it randomly choose from several different input maps. 

I have 4 (slightly) different color maps that I'd like to be applied randomly to duplicates of the objects that I apply the material to. 

I thought maybe I could make something work with the aiLayerShader but that only combines several materials together based on an alpha input. I really need the material to select a different color map based on object ID. 

Is this possible at all?

Thanks! 

0 Likes
Accepted solutions (1)
1,503 Views
3 Replies
Replies (3)
Message 2 of 4

Stephen.Blair
Community Manager
Community Manager

I would use aiSwitch



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 3 of 4

lee_griggs
Autodesk
Autodesk

Changing the seed value here might also help.

https://www.youtube.com/watch?v=kaSnzrdQsqo

Lee Griggs
Arnold rendering specialist
AUTODESK
0 Likes
Message 4 of 4

VictorvdBrink
Enthusiast
Enthusiast
Accepted solution

This put me on the right path. I'm still very new to all the different nodes arnold offers in the hypershade. But I was able to narrow down my Google search with the aiSwitch. 

I found this video and turns out this is exactly what I needed. 


This guy is is using the aiSwitch to input different color correction instances. But you can use the exact same method to input several different texture maps. 

So for the next person who finds this:

1. Create aiSwitch node. 


2. Input your texture maps (or whatever) into the aiSwitch node. 


3. Create aiUtility node > set shading mode: flat > set color mode: object ID


4. Create aiRandom node > set type: color


5.Create aiRange node 


6. Connect your aiUtility, aiRandom and aiRange node in that order. 


7. Take the R channel of the aiRange node and use it to drive the index parameter of the aiSwitch node (drag from the R channel and hover over the yellow input connection to open the input selection window).


8. Change the Output Max parameter on your aiRange node to the desired number of inputs in your aiSwitch node. 

9. And lastly ofcourse, connect your aiSwitch node with all your inputs to whatever channel you need on your aiStandardSurface shader.

And bob's your uncle. 

Finally a quick screenshot of what the node network looks like in the end:

e2ee82fc5bdb7a8f84d048be1f0b0481.png

Thanks for the help!