HSL Shader

The Crowd HSL Shader for Mental Ray is a Mental Ray shader which can be used to add some visual diversity to the rendered crowd. It lets you vary the hue, saturation and lightness of a texture/shader which will be applied on the same mesh on different Entities.

Crowd HSL Shader used in the tshirt shading graph of a crowd (variation of saturation on a texture)


To create a Crowd Switch Shader for Mental Ray, the Mental Ray plugin must be loaded.
  • Hypershade: MentalRay / Miscellaneous / CrowdHSLShaderMentalRay
  • MEL command: createNode CrowdHSLShaderMentalRay;


In Color Input shader/textures slot to modify
H, S, L Hue, saturation, lightness parameters (between -1. and 1.). 0 means that the parameter will have any effect on the input shader/texture. These parameters are usually linked to a value which changes for each character (e.g. GetUserDataScalar), 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 outValue.
In the following example the Crowd HSL Shader has a texture connected to its In Color attribute. Its Saturation attribute is fed by a GetUserDataScalar 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: