You are here

Switch Shader

The Crowd Switch Shader for Redshift is an Redshift shader which can be used to add some visual diversity to the rendered crowd. It lets you vary the texture/shader which will be applied on the same mesh on different Entities. This shader consists of several inputs for available textures/shaders and a selector determining the input to choose as output color.

Crowd Switch Shader used in the tshirt shading graph of a crowd

Creation

To create a Crowd Switch Shader for Redshift, the Redshift plugin must be loaded.

Hypershade: Redshift / Shader / Utility / RedshiftShaderSwitch

MEL command: createNode RedshiftShaderSwitch;

Configuration

Selector

Value determining which input will be used. It is usually linked to a value which changes for each character (e.g. RedshiftUserDataInteger), hence creating the diversity

Shading Graph Integration

This shader can be used to feed a color attribute of any other shader. The output attribute of this shader is called outColor.

In the following example the Crowd Switch Shader has 3 textures connected to its 3 first Shader slots. Its Selector value is fed by a Redshift RedshiftUserDataInteger shader and its output is connected to the Color attribute of a Blinn Tshirt shader.

At render time, Entities having this Blinn Tshirt shader listed in their Assets and a correctly defined Shader Attribute, you get the following result: