Jitter

 

Table Of Contents

 

Overview

Models from polyhaven.com

The Jitter shader can be used to create randomized colors and float / integer values based on automatically generated attributes. For example, automatically adding unique color variation to different objects or using randomly generated float values to control things like metalness or roughness per-object. This is accomplished by pairing an input ID with a randomized seed, the input ID controls how the source objects are differentiated and the seed allows the user to quickly change the randomized output for each variation option.

 

Examples

Connecting custom User Data

To use a custom attribute to drive a jitter node create a User Data node that matches the data type of your attribute, in the example below an Integer User Data node is used. The "Attribute name" in your User Data node must use exactly the same name as the attribute added to your objects or else the data will not be found.

Then set the Jitter node's Input ID Mode to "User Data ID" and connect the output of your User Data node to the "User Data" input on the Jitter node as demonstrated in the image below. Once all hooked up your custom attribute will now be used to control randomization throughout your scene.

 

Randomize a Cloner / Matrix object with RSMGID

When using a Jitter node with a cloner (or matrix object) it is important to pick your ID Input Mode carefully since some ID sources work differently depending on how the geometry is handled. For example, the cloner's Instance Mode has a significant impact on the viable ID types.

Changing a Cloner's Instance Mode

 

When using the cloner's default "Instance" type with Jitter's "Name ID" mode everything will work as expected, however it will not work for "Render-Instance" or "Multi-Instance" - instead only outputting a single color for all clones.

Instance Mode: Instance
Jitter Input ID: Name ID
Render-Instance Multi-Instance

 

This can be resolved by using a different ID input, for cloners and matrix objects it is recommend to use the built in integer Mograph ID "RSMGID", this will result in consistent coloration for all Instance modes.

This does not work for manually created instances outside of a cloner.

Instance Mode: Instance
Jitter Input ID: Integer User Data -"RSMGID"
Render-Instance Multi-Instance

 

To use the Mograph ID with a Jitter node complete the following steps:

  1. Set the Jitter's Input ID Mode to "User Data"

  2. Create an Integer User Data node

  3. Set the Attribute Name to "RSMGID"

  4. Connect the Integer User Data node's output to the Jitter node's "User Data" input

Using "RSMGID" with a Jitter node

 

Randomize some Particles with RSPID

When using a Jitter node with particles it is recommended to use the built in integer Particle ID "RSPID".

For best results, add a Redshift Object tag to your particles and reference your particle geometry in the Custom Objects section. Apply the jitter material on the source object and not the particles themselves and do not parent the source object to the particles as pictured below.

Scene set up for particles and jitter

 

 

Jitter Input ID: Integer User Data -"RSPID"
Name ID Integer User Data -"RSMGID"

To use it with a Jitter node complete the following steps:

  1. Set the Jitter's Input ID Mode to "User Data"

  2. Create an Integer User Data node

  3. Set the Attribute Name to "RSPID"

  4. Connect the Integer User Data node's output to the Jitter node's "User Data" input

Using "RSPID" with a Jitter node

 

Combining user data

If you need to use a jitter material on multiple object types that are not compatible with the same user data (like a cloner and particles) you can combine user data with an add node.

Using "RSPID" with a Jitter node

 

Controlling the maximum number of unique IDs

The Jitter node is great at adding random variation to a large number of objects but there may be times where you want to limit the total number of unique variations. For example, if you have 100 objects and use an Input ID that provides a unique ID for each object then you will get 100 different variations. You could limit the total number of variations manually by using custom user data or you could just use an extra Jitter node.

In the example described below a limited number of color variations is used to demonstrate this set up but it can also be used for limiting the unique number of random floats and integers.

Start by creating a Jitter node with an Input ID that provides a unique ID for each object in your scene and call it "Max Variations," this node is used to control the maximum number of variations in the final output. Create another Jitter node with the Input ID Mode set to "User Data" and name this node "Color Range," this node is used to control the actual color output of your unique variations and it should be connected to a color input in your shader. Then connect the "Max Variations" Integer output to the User Data input on the "Color Range" node.

 

 

With this setup the total number of color variations is controlled by adjusting the min and max integer values on the "Max Variations" node, the number of unique integers in the output range corresponds directly to the number of unique color variations. For example an integer min of 0 and a max of 3 results in 4 unique colors (0,1,2,3) or an integer min of 1 and a max of 5 results in 5 unique colors (1,2,3,4,5).

Integer Min-Max: 1-1
Unique Colors: 1
1-2
2
0-2
3
1-3
3
1-5
5

 

The "Color Range" Jitter node is used to determine the actual color output, controlling the extent that the hue, saturation, and value can change based on the source color, however the total number of unique variations for hue, saturation, and value will always be limited to the maximum number of variations. For example, with an integer min of 1 and a max of 3 you will only ever get 4 unique color hues, 4 unique saturation levels, and 4 unique value levels.

In the example below the only parameter that is changed is the maximum hue variation, note how the unique ID of each object does not change but the color changes drastically as the value increases. When the maximum variation range is low it is difficult to tell that there are 3 unique colors but this becomes more apparent as the variation range grows.

Hue Variation Max: 0 to 360
Unique Colors: 3

 

The seed values can be adjusted to quickly trial different results, changing the Integer Seed on the "Max Variation" node determines the distribution of unique IDs across all objects.

Changing the Integer Seed

 

Changing the hue seed on the "Color Range" node determines the distribution of unique hues across all objects, allowing you to quickly test different color palettes.

Changing the Hue Seed

 

If you are happy overall with your limited color palette but would still prefer some slight variation this setup can be taken even further with the addition of yet another Jitter node. Create a new Jitter node called "Color Variation" and use an Input ID that provides a unique ID for each object in the scene. Connect the Color output of the "Color Range" node to the Color input of the "Small Color Variation" node.

 

 

By keeping the variation range small the final result will closely resemble the base color palette while adding some subtle visual interest.

Hue Min-Max: 0
Saturation Min-Max: 0
Value Min-Max: 0
-10 to 10
-0.2 to 0
-0.2 to 0
-30 to 30
-0.2 to 0
-0.2 to 0

 

 

Parameters

 

General

Controls what attribute the randomization is based on.

Redshift reserves the following intrinsic attributes:

In the example images below three different tool models are used to demonstrate the Jitter shader. When using Name ID each individual tool has its own unique color, this is because each tool has its own unique name in the scene. However, when using Object ID there are only three unique colors - one for each distinct kind of tool because all hammers have the same object ID, all screwdrivers have the same object ID, and all crowbars have the same object ID. In the UserData ID example a custom integer user data attribute was added with a unique ID for the tools on the top, middle, and bottom parts of the screen as well as a lone hammer in the center. This results in four unique colors but they are not limited to tools of the same kind.

Input ID Mode: Name ID Object ID UserData ID
Integer User Data with custom user attribute

 

When the Input ID Mode is set to UserData ID an Integer User Data node or other ID source should be connected to this port. This also functions as the default value if the selected user data is not found.

 

Color Jitter

The source color or texture that all color randomization is based on.

The higher the range in color variation the lower the impact the source color has on the final output because of how drastically the colors are likely to change, however, when color variation is low the source color becomes more important since the randomized colors stay closer to that starting position.

Source Color: Blue
Hue Max: 30
Red
30
Blue
360
Red
360

 

Controls how far the hue can be offset from the source color's original hue in degrees along a color wheel. Higher ranges between the min and max result in a greater potential for hue variation, a value of 0 for both results in no change.

To help visualize how the source color's hue is offset a color wheel is included in the example images below, the color wheel spins as the hue variation parameters are changed and move back toward the starting position the closer the min or max values get to zero. Note how the number of unique colors is grows as the range increases between the minimum and maximum values. In the rightmost example both the hue min and hue max are animated at the same time across the entire hue scale separated by a consistent range of 30, this results in all the colors maintaining a narrow band of color variation while still moving through all the different colors along the wheel.

Hue Max: -40 to +40
Hue Min: 0
-180 to +180
0
-330 to + 360
-360 to + 330

 

Changes the seed value that is used to determine the randomized hue. Changing the seed will result in different hues per ID.

Changing the hue seed

 

Controls how far the saturation can be offset from the source color's original saturation. Higher ranges between the min and max result in a greater potential for saturation variation, a value of 0 for both results in no change.

It is expected behavior that previously greyscale values will take on a color if random saturation is allowed to go above 0.

Saturation Max: -1 to +1

 

Changes the seed value that is used to determine the randomized saturation. Changing the seed will result in different saturation levels per ID.

Changing the saturation seed

 

Controls how far the color value can be offset from the source color's original value. Higher ranges between the min and max result in a greater potential for value variation, a value of 0 for both results in no change.

Value Max: -1 to +1

 

Changes the seed value that is used to determine the randomized color value. Changing the seed will result in different color values per ID.

Changing the value seed

 

Float Jitter

Controls the minimum and maximum range of potential float values that can be output.

In the example image below the random float value is being used to drive a coat reflection on all objects.

Float Max: 0 to 1

 

Changes the seed value that is used to determine the randomized float value. Changing the seed will result in different float values per ID.

Changing the float seed

 

Integer Jitter

Controls the minimum and maximum range of potential integer values that can be output, always returning a whole number.

 

Changes the seed value that is used to determine the randomized integer value. Changing the seed will result in different integer values per ID.