This page may include unlocalized contents


Golaem HSL

Introduction

This shader uses a given color and changes it by inputs for Hue, Satuation and Lightness (HSL). If these color variations are individually controlled, e.g. by evaluating user data on the objects assigned to the shader, differently colored objects can be realized with otherwise identical material assignments. This is useful, for example, for color variations of clothing on the figures of a crowd simulation.



Inputs

Color

This color or texture is changed by the following parameters for Hue, Satuation and Lightness.


Hue [-1.0 .. +1.0]

The value 1.0 stands for a Hue change of +360°. Negative values are also possible to reduce the Hue angle of the entered Color.


Satuation [-1.0 .. +1.0]

This value is added to the saturation of the Color input. The value 1.0 stands for an addition of 100% saturation.


Lightness [-1.0 .. +1.0]

This value is added to the brightness of the Color input. The value 1.0 stands for an addition of 100% brightness.


Outputs

Out Color

This is the modified color


Example

In this example we have two cube objects with the same material. In this material we are using the Golaem HSL shader for the diffuse color. The Color input of the Golaem HSl shader is set to a hue of 180° with 100% saturation and 100% brightness.

To be able to color the cubes individually, the values for Hue, Satuation or Lightness must be varied for these objects. For this purpose, User Data at the objects are suitable, which are then read out by a Scalar User Data node.


Individual User Data values are read from the textured objects and used to add Hue variations to the shading.


To make this work, you have to add User Data to both cube objects first and give them the same name. In this example the name "Color Variation" was used. This name has then to be entered at the Scalar User Data node as well. You can now control the Hue offset for the cubes by using their individual User Data input.


User Data values have been added to the cubes. The name of this User Data value must be entered in the Scalar User Data node.