Condition
 
 
 

Incorporate the Condition utility in shader networks capable of acting one way in one set of circumstances and another way in a different set of circumstances. For example, you can create a double-sided shaded surface (see Double-sided shaded surfaces).

Find this utility in the Create Bar (see Hide, resize or customize the Create bar).

To use this utility, see Use the Condition utility.

Condition produces a color value depending on the conditions you set. It requires one logical operator and two choice values, as shown in the following example:

If (A operation B)
Outcolor = Color1
else
Outcolor = Color2

Condition compares the value in A with the value in B to find out whether the value in A is greater, smaller, equal to, less than, less than or equal to, greater than or equal to, or not equal to the value in B.

Since it is a branching function, it does one thing if a logical expression is true and something else if it is false. For example, if the value in A is not equal to the value in B, Color If True is chosen in OutColor. If the value in A is equal to the value in B, and Color If False is chosen in OutColor.

Find this utility in the Create Bar (see Hide, resize or customize the Create bar).

First Term

Represents the first term of the condition.

Second Term

Represents the second term of the condition.

Operation

Displays a drop-down list from which you can select an operator. The operators include: Equal, Not Equal, Greater Than, Greater or Equal, Less Than, Less or Equal.

Color If True

The color or texture that is output when the condition is true.

Color If False

The color or texture that is output when the condition is false.

Out Color

The output attribute with the result obtained. Available in the Connection Editor only.

The following shows some examples of the Condition utility in use:

The Condition utility can be something as simple as comparing the values in the First Term and the Second Term. The result of this comparison makes it possible to change the color or texture of an object.

For example, if the First Term is less than the Second Term, the resulting color of the object (OutColor) is Color If True, and Color If False appears when the First Term is not less than the Second Term.

TipBecause you can also map all the input attributes, you can switch between two textures, for example, connecting them to Color If True and Color If False.