AlJitterColor shader

image2016-8-11 14-43-40.png

The alJitterColor shader is useful for applying random color variation to scenes containing many objects. In this short tutorial we will add some variation to the hue and gain of some lemons using a combination of the Utility and alJittercolor shaders.

  • Start off by assigning an alSurface shader to the lemons.

Utility Shader

  • Create a Utility shader and change its Color Mode to Object. This mode uses the name of the shapes to compute the color (this is necessary because the Signal attribute of the alJitterColor shader requires a unique value per object). Change the Shade Mode to flat.

image2016-8-11 12-58-42.png

Utility shader set to ‘Object’ Color Mode

 

The Utility shader outputs values between 0 to 1. However, the alJitterColor input uses in values which are non float values. Therefore we will need to multiply the output value of the Utility shader to a larger number.

  • Connect the Outcolor R of the Utility shader to the Input 1 attribute of a multiplyDivide node. You will also need to increase the Input 2 to a higher value. In this case we have used a value of 80.

image2016-8-11 13-46-35.png

Utility shader connected to Input 1 of multiplyDivide node

 

  • Connect the Output of the multiplyDivide node to the Signal attribute of the alJitterColor shader.
  • Connect the lemon texture map to the Input of an alJitterColor shader.
  • Finally, connect the Out Color of the alJitterColor shader to the Diffuse Color of the alSurface shader. 

image2016-8-11 12-43-0.png

Final shader network

AlJitterColor Shader

Now that everything is connected correctly, we can have some fun adjusting the hue of our lemons. Before starting, reset the values of the alJitterColor shader.

Min Gain
  • We can use the Min Gain to apply a minimum random gain to the lemons.
min-gain.jpg
Min Gain: 1 (left). Min Gain: 0.25 (right).
Max Hue Offset
  • We can also use the Max Hue Offset attribute to randomly adjust the hue of the lemon texture. In this case we only want to make a subtle adjustment and so a small value of 0.05 was used.

image2016-8-11 13-50-55.png

‘Max Hue Offset’ of AlJitterColor used as a hue shift for the lemon texture

max-hue.jpg

Max Hue Offset: 0 (left). Max Hue Offset 0.05 (right)

 

That concludes this tutorial on how to use the alJitterColor shader to randomly change the hue and gain of a color texture map.

The MtoA shader is available here.