class_openxrcompositionlayer.rst 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.3/modules/openxr/doc_classes/OpenXRCompositionLayer.xml.
  6. .. _class_OpenXRCompositionLayer:
  7. OpenXRCompositionLayer
  8. ======================
  9. **Experimental:** This class may be changed or removed in future versions.
  10. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  11. **Inherited By:** :ref:`OpenXRCompositionLayerCylinder<class_OpenXRCompositionLayerCylinder>`, :ref:`OpenXRCompositionLayerEquirect<class_OpenXRCompositionLayerEquirect>`, :ref:`OpenXRCompositionLayerQuad<class_OpenXRCompositionLayerQuad>`
  12. The parent class of all OpenXR composition layer nodes.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. Composition layers allow 2D viewports to be displayed inside of the headset by the XR compositor through special projections that retain their quality. This allows for rendering clear text while keeping the layer at a native resolution.
  17. \ **Note:** If the OpenXR runtime doesn't support the given composition layer type, a fallback mesh can be generated with a :ref:`ViewportTexture<class_ViewportTexture>`, in order to emulate the composition layer.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +---------------------------------------+-----------------------------------------------------------------------------------+-----------+
  24. | :ref:`bool<class_bool>` | :ref:`alpha_blend<class_OpenXRCompositionLayer_property_alpha_blend>` | ``false`` |
  25. +---------------------------------------+-----------------------------------------------------------------------------------+-----------+
  26. | :ref:`bool<class_bool>` | :ref:`enable_hole_punch<class_OpenXRCompositionLayer_property_enable_hole_punch>` | ``false`` |
  27. +---------------------------------------+-----------------------------------------------------------------------------------+-----------+
  28. | :ref:`SubViewport<class_SubViewport>` | :ref:`layer_viewport<class_OpenXRCompositionLayer_property_layer_viewport>` | |
  29. +---------------------------------------+-----------------------------------------------------------------------------------+-----------+
  30. | :ref:`int<class_int>` | :ref:`sort_order<class_OpenXRCompositionLayer_property_sort_order>` | ``1`` |
  31. +---------------------------------------+-----------------------------------------------------------------------------------+-----------+
  32. .. rst-class:: classref-reftable-group
  33. Methods
  34. -------
  35. .. table::
  36. :widths: auto
  37. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Vector2<class_Vector2>` | :ref:`intersects_ray<class_OpenXRCompositionLayer_method_intersects_ray>`\ (\ origin\: :ref:`Vector3<class_Vector3>`, direction\: :ref:`Vector3<class_Vector3>`\ ) |const| |
  39. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`is_natively_supported<class_OpenXRCompositionLayer_method_is_natively_supported>`\ (\ ) |const| |
  41. +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. .. rst-class:: classref-section-separator
  43. ----
  44. .. rst-class:: classref-descriptions-group
  45. Property Descriptions
  46. ---------------------
  47. .. _class_OpenXRCompositionLayer_property_alpha_blend:
  48. .. rst-class:: classref-property
  49. :ref:`bool<class_bool>` **alpha_blend** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_alpha_blend>`
  50. .. rst-class:: classref-property-setget
  51. - |void| **set_alpha_blend**\ (\ value\: :ref:`bool<class_bool>`\ )
  52. - :ref:`bool<class_bool>` **get_alpha_blend**\ (\ )
  53. Enables the blending the layer using its alpha channel.
  54. Can be combined with :ref:`Viewport.transparent_bg<class_Viewport_property_transparent_bg>` to give the layer a transparent background.
  55. .. rst-class:: classref-item-separator
  56. ----
  57. .. _class_OpenXRCompositionLayer_property_enable_hole_punch:
  58. .. rst-class:: classref-property
  59. :ref:`bool<class_bool>` **enable_hole_punch** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_enable_hole_punch>`
  60. .. rst-class:: classref-property-setget
  61. - |void| **set_enable_hole_punch**\ (\ value\: :ref:`bool<class_bool>`\ )
  62. - :ref:`bool<class_bool>` **get_enable_hole_punch**\ (\ )
  63. Enables a technique called "hole punching", which allows putting the composition layer behind the main projection layer (i.e. setting :ref:`sort_order<class_OpenXRCompositionLayer_property_sort_order>` to a negative value) while "punching a hole" through everything rendered by Godot so that the layer is still visible.
  64. This can be used to create the illusion that the composition layer exists in the same 3D space as everything rendered by Godot, allowing objects to appear to pass both behind or in front of the composition layer.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_OpenXRCompositionLayer_property_layer_viewport:
  68. .. rst-class:: classref-property
  69. :ref:`SubViewport<class_SubViewport>` **layer_viewport** :ref:`🔗<class_OpenXRCompositionLayer_property_layer_viewport>`
  70. .. rst-class:: classref-property-setget
  71. - |void| **set_layer_viewport**\ (\ value\: :ref:`SubViewport<class_SubViewport>`\ )
  72. - :ref:`SubViewport<class_SubViewport>` **get_layer_viewport**\ (\ )
  73. The :ref:`SubViewport<class_SubViewport>` to render on the composition layer.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_OpenXRCompositionLayer_property_sort_order:
  77. .. rst-class:: classref-property
  78. :ref:`int<class_int>` **sort_order** = ``1`` :ref:`🔗<class_OpenXRCompositionLayer_property_sort_order>`
  79. .. rst-class:: classref-property-setget
  80. - |void| **set_sort_order**\ (\ value\: :ref:`int<class_int>`\ )
  81. - :ref:`int<class_int>` **get_sort_order**\ (\ )
  82. The sort order for this composition layer. Higher numbers will be shown in front of lower numbers.
  83. \ **Note:** This will have no effect if a fallback mesh is being used.
  84. .. rst-class:: classref-section-separator
  85. ----
  86. .. rst-class:: classref-descriptions-group
  87. Method Descriptions
  88. -------------------
  89. .. _class_OpenXRCompositionLayer_method_intersects_ray:
  90. .. rst-class:: classref-method
  91. :ref:`Vector2<class_Vector2>` **intersects_ray**\ (\ origin\: :ref:`Vector3<class_Vector3>`, direction\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_OpenXRCompositionLayer_method_intersects_ray>`
  92. Returns UV coordinates where the given ray intersects with the composition layer. ``origin`` and ``direction`` must be in global space.
  93. Returns ``Vector2(-1.0, -1.0)`` if the ray doesn't intersect.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_OpenXRCompositionLayer_method_is_natively_supported:
  97. .. rst-class:: classref-method
  98. :ref:`bool<class_bool>` **is_natively_supported**\ (\ ) |const| :ref:`🔗<class_OpenXRCompositionLayer_method_is_natively_supported>`
  99. Returns true if the OpenXR runtime natively supports this composition layer type.
  100. \ **Note:** This will only return an accurate result after the OpenXR session has started.
  101. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  102. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  103. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  104. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  105. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  106. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  107. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  108. .. |void| replace:: :abbr:`void (No return value.)`