:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the VisualShaderNodeCompare.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_VisualShaderNodeCompare: VisualShaderNodeCompare ======================= **Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` A comparison function for common types within the visual shader graph. Description ----------- Compares ``a`` and ``b`` of :ref:`type` by :ref:`function`. Returns a boolean scalar. Translates to ``if`` instruction in shader code. Properties ---------- +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ | :ref:`Condition` | :ref:`condition` | ``0`` | +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ | :ref:`Function` | :ref:`function` | ``0`` | +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ | :ref:`ComparisonType` | :ref:`type` | ``0`` | +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ Enumerations ------------ .. _enum_VisualShaderNodeCompare_ComparisonType: .. _class_VisualShaderNodeCompare_constant_CTYPE_SCALAR: .. _class_VisualShaderNodeCompare_constant_CTYPE_VECTOR: .. _class_VisualShaderNodeCompare_constant_CTYPE_BOOLEAN: .. _class_VisualShaderNodeCompare_constant_CTYPE_TRANSFORM: 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_VisualShaderNodeCompare_Function: .. _class_VisualShaderNodeCompare_constant_FUNC_EQUAL: .. _class_VisualShaderNodeCompare_constant_FUNC_NOT_EQUAL: .. _class_VisualShaderNodeCompare_constant_FUNC_GREATER_THAN: .. _class_VisualShaderNodeCompare_constant_FUNC_GREATER_THAN_EQUAL: .. _class_VisualShaderNodeCompare_constant_FUNC_LESS_THAN: .. _class_VisualShaderNodeCompare_constant_FUNC_LESS_THAN_EQUAL: 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 :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. - **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`. - **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`. - **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`. ---- .. _enum_VisualShaderNodeCompare_Condition: .. _class_VisualShaderNodeCompare_constant_COND_ALL: .. _class_VisualShaderNodeCompare_constant_COND_ANY: 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 --------------------- .. _class_VisualShaderNodeCompare_property_condition: - :ref:`Condition` **condition** +-----------+----------------------+ | *Default* | ``0`` | +-----------+----------------------+ | *Setter* | set_condition(value) | +-----------+----------------------+ | *Getter* | get_condition() | +-----------+----------------------+ Extra condition which is applied if :ref:`type` is set to :ref:`CTYPE_VECTOR`. ---- .. _class_VisualShaderNodeCompare_property_function: - :ref:`Function` **function** +-----------+---------------------+ | *Default* | ``0`` | +-----------+---------------------+ | *Setter* | set_function(value) | +-----------+---------------------+ | *Getter* | get_function() | +-----------+---------------------+ A comparison function. See :ref:`Function` for options. ---- .. _class_VisualShaderNodeCompare_property_type: - :ref:`ComparisonType` **type** +-----------+----------------------------+ | *Default* | ``0`` | +-----------+----------------------------+ | *Setter* | set_comparison_type(value) | +-----------+----------------------------+ | *Getter* | 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.)`