class_visualshadernodecompare.rst 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the VisualShaderNodeCompare.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_VisualShaderNodeCompare:
  6. VisualShaderNodeCompare
  7. =======================
  8. **Inherits:** :ref:`VisualShaderNode<class_VisualShaderNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. A comparison function for common types within the visual shader graph.
  10. Description
  11. -----------
  12. Compares ``a`` and ``b`` of :ref:`type<class_VisualShaderNodeCompare_property_type>` by :ref:`function<class_VisualShaderNodeCompare_property_function>`. Returns a boolean scalar. Translates to ``if`` instruction in shader code.
  13. Properties
  14. ----------
  15. +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+
  16. | :ref:`Condition<enum_VisualShaderNodeCompare_Condition>` | :ref:`condition<class_VisualShaderNodeCompare_property_condition>` | ``0`` |
  17. +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+
  18. | :ref:`Function<enum_VisualShaderNodeCompare_Function>` | :ref:`function<class_VisualShaderNodeCompare_property_function>` | ``0`` |
  19. +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+
  20. | :ref:`ComparisonType<enum_VisualShaderNodeCompare_ComparisonType>` | :ref:`type<class_VisualShaderNodeCompare_property_type>` | ``0`` |
  21. +--------------------------------------------------------------------+--------------------------------------------------------------------+-------+
  22. Enumerations
  23. ------------
  24. .. _enum_VisualShaderNodeCompare_ComparisonType:
  25. .. _class_VisualShaderNodeCompare_constant_CTYPE_SCALAR:
  26. .. _class_VisualShaderNodeCompare_constant_CTYPE_VECTOR:
  27. .. _class_VisualShaderNodeCompare_constant_CTYPE_BOOLEAN:
  28. .. _class_VisualShaderNodeCompare_constant_CTYPE_TRANSFORM:
  29. enum **ComparisonType**:
  30. - **CTYPE_SCALAR** = **0** --- A floating-point scalar.
  31. - **CTYPE_VECTOR** = **1** --- A 3D vector type.
  32. - **CTYPE_BOOLEAN** = **2** --- A boolean type.
  33. - **CTYPE_TRANSFORM** = **3** --- A transform (``mat4``) type.
  34. ----
  35. .. _enum_VisualShaderNodeCompare_Function:
  36. .. _class_VisualShaderNodeCompare_constant_FUNC_EQUAL:
  37. .. _class_VisualShaderNodeCompare_constant_FUNC_NOT_EQUAL:
  38. .. _class_VisualShaderNodeCompare_constant_FUNC_GREATER_THAN:
  39. .. _class_VisualShaderNodeCompare_constant_FUNC_GREATER_THAN_EQUAL:
  40. .. _class_VisualShaderNodeCompare_constant_FUNC_LESS_THAN:
  41. .. _class_VisualShaderNodeCompare_constant_FUNC_LESS_THAN_EQUAL:
  42. enum **Function**:
  43. - **FUNC_EQUAL** = **0** --- Comparison for equality (``a == b``).
  44. - **FUNC_NOT_EQUAL** = **1** --- Comparison for inequality (``a != b``).
  45. - **FUNC_GREATER_THAN** = **2** --- Comparison for greater than (``a > b``). Cannot be used if :ref:`type<class_VisualShaderNodeCompare_property_type>` set to :ref:`CTYPE_BOOLEAN<class_VisualShaderNodeCompare_constant_CTYPE_BOOLEAN>` or :ref:`CTYPE_TRANSFORM<class_VisualShaderNodeCompare_constant_CTYPE_TRANSFORM>`.
  46. - **FUNC_GREATER_THAN_EQUAL** = **3** --- Comparison for greater than or equal (``a >= b``). Cannot be used if :ref:`type<class_VisualShaderNodeCompare_property_type>` set to :ref:`CTYPE_BOOLEAN<class_VisualShaderNodeCompare_constant_CTYPE_BOOLEAN>` or :ref:`CTYPE_TRANSFORM<class_VisualShaderNodeCompare_constant_CTYPE_TRANSFORM>`.
  47. - **FUNC_LESS_THAN** = **4** --- Comparison for less than (``a < b``). Cannot be used if :ref:`type<class_VisualShaderNodeCompare_property_type>` set to :ref:`CTYPE_BOOLEAN<class_VisualShaderNodeCompare_constant_CTYPE_BOOLEAN>` or :ref:`CTYPE_TRANSFORM<class_VisualShaderNodeCompare_constant_CTYPE_TRANSFORM>`.
  48. - **FUNC_LESS_THAN_EQUAL** = **5** --- Comparison for less than or equal (``a < b``). Cannot be used if :ref:`type<class_VisualShaderNodeCompare_property_type>` set to :ref:`CTYPE_BOOLEAN<class_VisualShaderNodeCompare_constant_CTYPE_BOOLEAN>` or :ref:`CTYPE_TRANSFORM<class_VisualShaderNodeCompare_constant_CTYPE_TRANSFORM>`.
  49. ----
  50. .. _enum_VisualShaderNodeCompare_Condition:
  51. .. _class_VisualShaderNodeCompare_constant_COND_ALL:
  52. .. _class_VisualShaderNodeCompare_constant_COND_ANY:
  53. enum **Condition**:
  54. - **COND_ALL** = **0** --- The result will be true if all of component in vector satisfy the comparison condition.
  55. - **COND_ANY** = **1** --- The result will be true if any of component in vector satisfy the comparison condition.
  56. Property Descriptions
  57. ---------------------
  58. .. _class_VisualShaderNodeCompare_property_condition:
  59. - :ref:`Condition<enum_VisualShaderNodeCompare_Condition>` **condition**
  60. +-----------+----------------------+
  61. | *Default* | ``0`` |
  62. +-----------+----------------------+
  63. | *Setter* | set_condition(value) |
  64. +-----------+----------------------+
  65. | *Getter* | get_condition() |
  66. +-----------+----------------------+
  67. Extra condition which is applied if :ref:`type<class_VisualShaderNodeCompare_property_type>` is set to :ref:`CTYPE_VECTOR<class_VisualShaderNodeCompare_constant_CTYPE_VECTOR>`.
  68. ----
  69. .. _class_VisualShaderNodeCompare_property_function:
  70. - :ref:`Function<enum_VisualShaderNodeCompare_Function>` **function**
  71. +-----------+---------------------+
  72. | *Default* | ``0`` |
  73. +-----------+---------------------+
  74. | *Setter* | set_function(value) |
  75. +-----------+---------------------+
  76. | *Getter* | get_function() |
  77. +-----------+---------------------+
  78. A comparison function. See :ref:`Function<enum_VisualShaderNodeCompare_Function>` for options.
  79. ----
  80. .. _class_VisualShaderNodeCompare_property_type:
  81. - :ref:`ComparisonType<enum_VisualShaderNodeCompare_ComparisonType>` **type**
  82. +-----------+----------------------------+
  83. | *Default* | ``0`` |
  84. +-----------+----------------------------+
  85. | *Setter* | set_comparison_type(value) |
  86. +-----------+----------------------------+
  87. | *Getter* | get_comparison_type() |
  88. +-----------+----------------------------+
  89. The type to be used in the comparison. See :ref:`ComparisonType<enum_VisualShaderNodeCompare_ComparisonType>` for options.
  90. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  91. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  92. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`