:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/VisualShaderNodeCompare.xml. .. _class_VisualShaderNodeCompare: VisualShaderNodeCompare ======================= **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` A comparison function for common types within the visual shader graph. .. rst-class:: classref-introduction-group Description ----------- Compares ``a`` and ``b`` of :ref:`type` by :ref:`function`. Returns a boolean scalar. Translates to ``if`` instruction in shader code. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ | :ref:`Condition` | :ref:`condition` | ``0`` | +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ | :ref:`Function` | :ref:`function` | ``0`` | +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ | :ref:`ComparisonType` | :ref:`type` | ``0`` | +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_VisualShaderNodeCompare_ComparisonType: .. rst-class:: classref-enumeration enum **ComparisonType**: :ref:`🔗` .. _class_VisualShaderNodeCompare_constant_CTYPE_SCALAR: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_SCALAR** = ``0`` A floating-point scalar. .. _class_VisualShaderNodeCompare_constant_CTYPE_SCALAR_INT: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_SCALAR_INT** = ``1`` An integer scalar. .. _class_VisualShaderNodeCompare_constant_CTYPE_SCALAR_UINT: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_SCALAR_UINT** = ``2`` An unsigned integer scalar. .. _class_VisualShaderNodeCompare_constant_CTYPE_VECTOR_2D: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_VECTOR_2D** = ``3`` A 2D vector type. .. _class_VisualShaderNodeCompare_constant_CTYPE_VECTOR_3D: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_VECTOR_3D** = ``4`` A 3D vector type. .. _class_VisualShaderNodeCompare_constant_CTYPE_VECTOR_4D: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_VECTOR_4D** = ``5`` A 4D vector type. .. _class_VisualShaderNodeCompare_constant_CTYPE_BOOLEAN: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_BOOLEAN** = ``6`` A boolean type. .. _class_VisualShaderNodeCompare_constant_CTYPE_TRANSFORM: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_TRANSFORM** = ``7`` A transform (``mat4``) type. .. _class_VisualShaderNodeCompare_constant_CTYPE_MAX: .. rst-class:: classref-enumeration-constant :ref:`ComparisonType` **CTYPE_MAX** = ``8`` Represents the size of the :ref:`ComparisonType` enum. .. rst-class:: classref-item-separator ---- .. _enum_VisualShaderNodeCompare_Function: .. rst-class:: classref-enumeration enum **Function**: :ref:`🔗` .. _class_VisualShaderNodeCompare_constant_FUNC_EQUAL: .. rst-class:: classref-enumeration-constant :ref:`Function` **FUNC_EQUAL** = ``0`` Comparison for equality (``a == b``). .. _class_VisualShaderNodeCompare_constant_FUNC_NOT_EQUAL: .. rst-class:: classref-enumeration-constant :ref:`Function` **FUNC_NOT_EQUAL** = ``1`` Comparison for inequality (``a != b``). .. _class_VisualShaderNodeCompare_constant_FUNC_GREATER_THAN: .. rst-class:: classref-enumeration-constant :ref:`Function` **FUNC_GREATER_THAN** = ``2`` Comparison for greater than (``a > b``). Cannot be used if :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. .. _class_VisualShaderNodeCompare_constant_FUNC_GREATER_THAN_EQUAL: .. rst-class:: classref-enumeration-constant :ref:`Function` **FUNC_GREATER_THAN_EQUAL** = ``3`` Comparison for greater than or equal (``a >= b``). Cannot be used if :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. .. _class_VisualShaderNodeCompare_constant_FUNC_LESS_THAN: .. rst-class:: classref-enumeration-constant :ref:`Function` **FUNC_LESS_THAN** = ``4`` Comparison for less than (``a < b``). Cannot be used if :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. .. _class_VisualShaderNodeCompare_constant_FUNC_LESS_THAN_EQUAL: .. rst-class:: classref-enumeration-constant :ref:`Function` **FUNC_LESS_THAN_EQUAL** = ``5`` Comparison for less than or equal (``a <= b``). Cannot be used if :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. .. _class_VisualShaderNodeCompare_constant_FUNC_MAX: .. rst-class:: classref-enumeration-constant :ref:`Function` **FUNC_MAX** = ``6`` Represents the size of the :ref:`Function` enum. .. rst-class:: classref-item-separator ---- .. _enum_VisualShaderNodeCompare_Condition: .. rst-class:: classref-enumeration enum **Condition**: :ref:`🔗` .. _class_VisualShaderNodeCompare_constant_COND_ALL: .. rst-class:: classref-enumeration-constant :ref:`Condition` **COND_ALL** = ``0`` The result will be ``true`` if all components in the vector satisfy the comparison condition. .. _class_VisualShaderNodeCompare_constant_COND_ANY: .. rst-class:: classref-enumeration-constant :ref:`Condition` **COND_ANY** = ``1`` The result will be ``true`` if any component in the vector satisfies the comparison condition. .. _class_VisualShaderNodeCompare_constant_COND_MAX: .. rst-class:: classref-enumeration-constant :ref:`Condition` **COND_MAX** = ``2`` Represents the size of the :ref:`Condition` enum. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_VisualShaderNodeCompare_property_condition: .. rst-class:: classref-property :ref:`Condition` **condition** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_condition**\ (\ value\: :ref:`Condition`\ ) - :ref:`Condition` **get_condition**\ (\ ) Extra condition which is applied if :ref:`type` is set to :ref:`CTYPE_VECTOR_3D`. .. rst-class:: classref-item-separator ---- .. _class_VisualShaderNodeCompare_property_function: .. rst-class:: classref-property :ref:`Function` **function** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_function**\ (\ value\: :ref:`Function`\ ) - :ref:`Function` **get_function**\ (\ ) A comparison function. See :ref:`Function` for options. .. rst-class:: classref-item-separator ---- .. _class_VisualShaderNodeCompare_property_type: .. rst-class:: classref-property :ref:`ComparisonType` **type** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_comparison_type**\ (\ value\: :ref:`ComparisonType`\ ) - :ref:`ComparisonType` **get_comparison_type**\ (\ ) The type to be used in the comparison. See :ref:`ComparisonType` for options. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`