VisualShaderNodeCompare

Inherits: VisualShaderNode < Resource < Reference < Object

A comparison function for common types within the visual shader graph.

Description

Compares a and b of type by function. Returns a boolean scalar. Translates to if instruction in shader code.

Properties

Condition

condition

0

Function

function

0

ComparisonType

type

0

Enumerations

enum ComparisonType:

  • CTYPE_SCALAR = 0 —- A floating-point scalar.

  • CTYPE_VECTOR = 1 —- A 3D vector type.

  • CTYPE_BOOLEAN = 2 —- A boolean type.

  • CTYPE_TRANSFORM = 3 —- A transform (mat4) type.


enum Function:

  • FUNC_EQUAL = 0 —- Comparison for equality (a == b).

  • FUNC_NOT_EQUAL = 1 —- Comparison for inequality (a != b).

  • FUNC_GREATER_THAN = 2 —- Comparison for greater than (a > b). Cannot be used if type set to CTYPE_BOOLEAN or CTYPE_TRANSFORM.

  • FUNC_GREATER_THAN_EQUAL = 3 —- Comparison for greater than or equal (a >= b). Cannot be used if type set to CTYPE_BOOLEAN or CTYPE_TRANSFORM.

  • FUNC_LESS_THAN = 4 —- Comparison for less than (a < b). Cannot be used if type set to CTYPE_BOOLEAN or CTYPE_TRANSFORM.

  • FUNC_LESS_THAN_EQUAL = 5 —- Comparison for less than or equal (a < b). Cannot be used if type set to CTYPE_BOOLEAN or CTYPE_TRANSFORM.


enum Condition:

  • COND_ALL = 0 —- The result will be true if all of component in vector satisfy the comparison condition.

  • COND_ANY = 1 —- The result will be true if any of component in vector satisfy the comparison condition.

Property Descriptions

Default

0

Setter

set_condition(value)

Getter

get_condition()

Extra condition which is applied if type is set to CTYPE_VECTOR.


Default

0

Setter

set_function(value)

Getter

get_function()

A comparison function. See Function for options.


Default

0

Setter

set_comparison_type(value)

Getter

get_comparison_type()

The type to be used in the comparison. See ComparisonType for options.