class_openxrcompositionlayer.rst 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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:`Vector2i<class_Vector2i>` | :ref:`android_surface_size<class_OpenXRCompositionLayer_property_android_surface_size>` | ``Vector2i(1024, 1024)`` |
  27. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`enable_hole_punch<class_OpenXRCompositionLayer_property_enable_hole_punch>` | ``false`` |
  29. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  30. | :ref:`SubViewport<class_SubViewport>` | :ref:`layer_viewport<class_OpenXRCompositionLayer_property_layer_viewport>` | |
  31. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`protected_content<class_OpenXRCompositionLayer_property_protected_content>` | ``false`` |
  33. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  34. | :ref:`int<class_int>` | :ref:`sort_order<class_OpenXRCompositionLayer_property_sort_order>` | ``1`` |
  35. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  36. | :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` | :ref:`swapchain_state_alpha_swizzle<class_OpenXRCompositionLayer_property_swapchain_state_alpha_swizzle>` | ``3`` |
  37. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  38. | :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` | :ref:`swapchain_state_blue_swizzle<class_OpenXRCompositionLayer_property_swapchain_state_blue_swizzle>` | ``2`` |
  39. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  40. | :ref:`Color<class_Color>` | :ref:`swapchain_state_border_color<class_OpenXRCompositionLayer_property_swapchain_state_border_color>` | ``Color(0, 0, 0, 0)`` |
  41. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  42. | :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` | :ref:`swapchain_state_green_swizzle<class_OpenXRCompositionLayer_property_swapchain_state_green_swizzle>` | ``1`` |
  43. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  44. | :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` | :ref:`swapchain_state_horizontal_wrap<class_OpenXRCompositionLayer_property_swapchain_state_horizontal_wrap>` | ``0`` |
  45. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  46. | :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` | :ref:`swapchain_state_mag_filter<class_OpenXRCompositionLayer_property_swapchain_state_mag_filter>` | ``1`` |
  47. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  48. | :ref:`float<class_float>` | :ref:`swapchain_state_max_anisotropy<class_OpenXRCompositionLayer_property_swapchain_state_max_anisotropy>` | ``1.0`` |
  49. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  50. | :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` | :ref:`swapchain_state_min_filter<class_OpenXRCompositionLayer_property_swapchain_state_min_filter>` | ``1`` |
  51. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  52. | :ref:`MipmapMode<enum_OpenXRCompositionLayer_MipmapMode>` | :ref:`swapchain_state_mipmap_mode<class_OpenXRCompositionLayer_property_swapchain_state_mipmap_mode>` | ``2`` |
  53. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  54. | :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` | :ref:`swapchain_state_red_swizzle<class_OpenXRCompositionLayer_property_swapchain_state_red_swizzle>` | ``0`` |
  55. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  56. | :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` | :ref:`swapchain_state_vertical_wrap<class_OpenXRCompositionLayer_property_swapchain_state_vertical_wrap>` | ``0`` |
  57. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`use_android_surface<class_OpenXRCompositionLayer_property_use_android_surface>` | ``false`` |
  59. +-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------+--------------------------+
  60. .. rst-class:: classref-reftable-group
  61. Methods
  62. -------
  63. .. table::
  64. :widths: auto
  65. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`JavaObject<class_JavaObject>` | :ref:`get_android_surface<class_OpenXRCompositionLayer_method_get_android_surface>`\ (\ ) |
  67. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Vector2<class_Vector2>` | :ref:`intersects_ray<class_OpenXRCompositionLayer_method_intersects_ray>`\ (\ origin\: :ref:`Vector3<class_Vector3>`, direction\: :ref:`Vector3<class_Vector3>`\ ) |const| |
  69. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`is_natively_supported<class_OpenXRCompositionLayer_method_is_natively_supported>`\ (\ ) |const| |
  71. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. .. rst-class:: classref-section-separator
  73. ----
  74. .. rst-class:: classref-descriptions-group
  75. Enumerations
  76. ------------
  77. .. _enum_OpenXRCompositionLayer_Filter:
  78. .. rst-class:: classref-enumeration
  79. enum **Filter**: :ref:`🔗<enum_OpenXRCompositionLayer_Filter>`
  80. .. _class_OpenXRCompositionLayer_constant_FILTER_NEAREST:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` **FILTER_NEAREST** = ``0``
  83. Perform nearest-neighbor filtering when sampling the texture.
  84. .. _class_OpenXRCompositionLayer_constant_FILTER_LINEAR:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` **FILTER_LINEAR** = ``1``
  87. Perform linear filtering when sampling the texture.
  88. .. _class_OpenXRCompositionLayer_constant_FILTER_CUBIC:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` **FILTER_CUBIC** = ``2``
  91. Perform cubic filtering when sampling the texture.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _enum_OpenXRCompositionLayer_MipmapMode:
  95. .. rst-class:: classref-enumeration
  96. enum **MipmapMode**: :ref:`🔗<enum_OpenXRCompositionLayer_MipmapMode>`
  97. .. _class_OpenXRCompositionLayer_constant_MIPMAP_MODE_DISABLED:
  98. .. rst-class:: classref-enumeration-constant
  99. :ref:`MipmapMode<enum_OpenXRCompositionLayer_MipmapMode>` **MIPMAP_MODE_DISABLED** = ``0``
  100. Disable mipmapping.
  101. \ **Note:** Mipmapping can only be disabled in the Compatibility renderer.
  102. .. _class_OpenXRCompositionLayer_constant_MIPMAP_MODE_NEAREST:
  103. .. rst-class:: classref-enumeration-constant
  104. :ref:`MipmapMode<enum_OpenXRCompositionLayer_MipmapMode>` **MIPMAP_MODE_NEAREST** = ``1``
  105. Use the mipmap of the nearest resolution.
  106. .. _class_OpenXRCompositionLayer_constant_MIPMAP_MODE_LINEAR:
  107. .. rst-class:: classref-enumeration-constant
  108. :ref:`MipmapMode<enum_OpenXRCompositionLayer_MipmapMode>` **MIPMAP_MODE_LINEAR** = ``2``
  109. Use linear interpolation of the two mipmaps of the nearest resolution.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _enum_OpenXRCompositionLayer_Wrap:
  113. .. rst-class:: classref-enumeration
  114. enum **Wrap**: :ref:`🔗<enum_OpenXRCompositionLayer_Wrap>`
  115. .. _class_OpenXRCompositionLayer_constant_WRAP_CLAMP_TO_BORDER:
  116. .. rst-class:: classref-enumeration-constant
  117. :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **WRAP_CLAMP_TO_BORDER** = ``0``
  118. Clamp the texture to its specified border color.
  119. .. _class_OpenXRCompositionLayer_constant_WRAP_CLAMP_TO_EDGE:
  120. .. rst-class:: classref-enumeration-constant
  121. :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **WRAP_CLAMP_TO_EDGE** = ``1``
  122. Clamp the texture to its edge color.
  123. .. _class_OpenXRCompositionLayer_constant_WRAP_REPEAT:
  124. .. rst-class:: classref-enumeration-constant
  125. :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **WRAP_REPEAT** = ``2``
  126. Repeat the texture infinitely.
  127. .. _class_OpenXRCompositionLayer_constant_WRAP_MIRRORED_REPEAT:
  128. .. rst-class:: classref-enumeration-constant
  129. :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **WRAP_MIRRORED_REPEAT** = ``3``
  130. Repeat the texture infinitely, mirroring it on each repeat.
  131. .. _class_OpenXRCompositionLayer_constant_WRAP_MIRROR_CLAMP_TO_EDGE:
  132. .. rst-class:: classref-enumeration-constant
  133. :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **WRAP_MIRROR_CLAMP_TO_EDGE** = ``4``
  134. Mirror the texture once and then clamp the texture to its edge color.
  135. \ **Note:** This wrap mode is not available in the Compatibility renderer.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _enum_OpenXRCompositionLayer_Swizzle:
  139. .. rst-class:: classref-enumeration
  140. enum **Swizzle**: :ref:`🔗<enum_OpenXRCompositionLayer_Swizzle>`
  141. .. _class_OpenXRCompositionLayer_constant_SWIZZLE_RED:
  142. .. rst-class:: classref-enumeration-constant
  143. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **SWIZZLE_RED** = ``0``
  144. Maps a color channel to the value of the red channel.
  145. .. _class_OpenXRCompositionLayer_constant_SWIZZLE_GREEN:
  146. .. rst-class:: classref-enumeration-constant
  147. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **SWIZZLE_GREEN** = ``1``
  148. Maps a color channel to the value of the green channel.
  149. .. _class_OpenXRCompositionLayer_constant_SWIZZLE_BLUE:
  150. .. rst-class:: classref-enumeration-constant
  151. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **SWIZZLE_BLUE** = ``2``
  152. Maps a color channel to the value of the blue channel.
  153. .. _class_OpenXRCompositionLayer_constant_SWIZZLE_ALPHA:
  154. .. rst-class:: classref-enumeration-constant
  155. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **SWIZZLE_ALPHA** = ``3``
  156. Maps a color channel to the value of the alpha channel.
  157. .. _class_OpenXRCompositionLayer_constant_SWIZZLE_ZERO:
  158. .. rst-class:: classref-enumeration-constant
  159. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **SWIZZLE_ZERO** = ``4``
  160. Maps a color channel to the value of zero.
  161. .. _class_OpenXRCompositionLayer_constant_SWIZZLE_ONE:
  162. .. rst-class:: classref-enumeration-constant
  163. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **SWIZZLE_ONE** = ``5``
  164. Maps a color channel to the value of one.
  165. .. rst-class:: classref-section-separator
  166. ----
  167. .. rst-class:: classref-descriptions-group
  168. Property Descriptions
  169. ---------------------
  170. .. _class_OpenXRCompositionLayer_property_alpha_blend:
  171. .. rst-class:: classref-property
  172. :ref:`bool<class_bool>` **alpha_blend** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_alpha_blend>`
  173. .. rst-class:: classref-property-setget
  174. - |void| **set_alpha_blend**\ (\ value\: :ref:`bool<class_bool>`\ )
  175. - :ref:`bool<class_bool>` **get_alpha_blend**\ (\ )
  176. Enables the blending the layer using its alpha channel.
  177. Can be combined with :ref:`Viewport.transparent_bg<class_Viewport_property_transparent_bg>` to give the layer a transparent background.
  178. .. rst-class:: classref-item-separator
  179. ----
  180. .. _class_OpenXRCompositionLayer_property_android_surface_size:
  181. .. rst-class:: classref-property
  182. :ref:`Vector2i<class_Vector2i>` **android_surface_size** = ``Vector2i(1024, 1024)`` :ref:`🔗<class_OpenXRCompositionLayer_property_android_surface_size>`
  183. .. rst-class:: classref-property-setget
  184. - |void| **set_android_surface_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
  185. - :ref:`Vector2i<class_Vector2i>` **get_android_surface_size**\ (\ )
  186. The size of the Android surface to create if :ref:`use_android_surface<class_OpenXRCompositionLayer_property_use_android_surface>` is enabled.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_OpenXRCompositionLayer_property_enable_hole_punch:
  190. .. rst-class:: classref-property
  191. :ref:`bool<class_bool>` **enable_hole_punch** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_enable_hole_punch>`
  192. .. rst-class:: classref-property-setget
  193. - |void| **set_enable_hole_punch**\ (\ value\: :ref:`bool<class_bool>`\ )
  194. - :ref:`bool<class_bool>` **get_enable_hole_punch**\ (\ )
  195. 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.
  196. 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.
  197. .. rst-class:: classref-item-separator
  198. ----
  199. .. _class_OpenXRCompositionLayer_property_layer_viewport:
  200. .. rst-class:: classref-property
  201. :ref:`SubViewport<class_SubViewport>` **layer_viewport** :ref:`🔗<class_OpenXRCompositionLayer_property_layer_viewport>`
  202. .. rst-class:: classref-property-setget
  203. - |void| **set_layer_viewport**\ (\ value\: :ref:`SubViewport<class_SubViewport>`\ )
  204. - :ref:`SubViewport<class_SubViewport>` **get_layer_viewport**\ (\ )
  205. The :ref:`SubViewport<class_SubViewport>` to render on the composition layer.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_OpenXRCompositionLayer_property_protected_content:
  209. .. rst-class:: classref-property
  210. :ref:`bool<class_bool>` **protected_content** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_protected_content>`
  211. .. rst-class:: classref-property-setget
  212. - |void| **set_protected_content**\ (\ value\: :ref:`bool<class_bool>`\ )
  213. - :ref:`bool<class_bool>` **is_protected_content**\ (\ )
  214. If enabled, the OpenXR swapchain will be created with the ``XR_SWAPCHAIN_CREATE_PROTECTED_CONTENT_BIT`` flag, which will protect its contents from CPU access.
  215. When used with an Android Surface, this may allow DRM content to be presented, and will only take effect when the Surface is first created; later changes to this property will have no effect.
  216. .. rst-class:: classref-item-separator
  217. ----
  218. .. _class_OpenXRCompositionLayer_property_sort_order:
  219. .. rst-class:: classref-property
  220. :ref:`int<class_int>` **sort_order** = ``1`` :ref:`🔗<class_OpenXRCompositionLayer_property_sort_order>`
  221. .. rst-class:: classref-property-setget
  222. - |void| **set_sort_order**\ (\ value\: :ref:`int<class_int>`\ )
  223. - :ref:`int<class_int>` **get_sort_order**\ (\ )
  224. The sort order for this composition layer. Higher numbers will be shown in front of lower numbers.
  225. \ **Note:** This will have no effect if a fallback mesh is being used.
  226. .. rst-class:: classref-item-separator
  227. ----
  228. .. _class_OpenXRCompositionLayer_property_swapchain_state_alpha_swizzle:
  229. .. rst-class:: classref-property
  230. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **swapchain_state_alpha_swizzle** = ``3`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_alpha_swizzle>`
  231. .. rst-class:: classref-property-setget
  232. - |void| **set_alpha_swizzle**\ (\ value\: :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>`\ )
  233. - :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **get_alpha_swizzle**\ (\ )
  234. The swizzle value for the alpha channel of the swapchain state.
  235. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  236. .. rst-class:: classref-item-separator
  237. ----
  238. .. _class_OpenXRCompositionLayer_property_swapchain_state_blue_swizzle:
  239. .. rst-class:: classref-property
  240. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **swapchain_state_blue_swizzle** = ``2`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_blue_swizzle>`
  241. .. rst-class:: classref-property-setget
  242. - |void| **set_blue_swizzle**\ (\ value\: :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>`\ )
  243. - :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **get_blue_swizzle**\ (\ )
  244. The swizzle value for the blue channel of the swapchain state.
  245. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  246. .. rst-class:: classref-item-separator
  247. ----
  248. .. _class_OpenXRCompositionLayer_property_swapchain_state_border_color:
  249. .. rst-class:: classref-property
  250. :ref:`Color<class_Color>` **swapchain_state_border_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_border_color>`
  251. .. rst-class:: classref-property-setget
  252. - |void| **set_border_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  253. - :ref:`Color<class_Color>` **get_border_color**\ (\ )
  254. The border color of the swapchain state that is used when the wrap mode clamps to the border.
  255. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  256. .. rst-class:: classref-item-separator
  257. ----
  258. .. _class_OpenXRCompositionLayer_property_swapchain_state_green_swizzle:
  259. .. rst-class:: classref-property
  260. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **swapchain_state_green_swizzle** = ``1`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_green_swizzle>`
  261. .. rst-class:: classref-property-setget
  262. - |void| **set_green_swizzle**\ (\ value\: :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>`\ )
  263. - :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **get_green_swizzle**\ (\ )
  264. The swizzle value for the green channel of the swapchain state.
  265. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  266. .. rst-class:: classref-item-separator
  267. ----
  268. .. _class_OpenXRCompositionLayer_property_swapchain_state_horizontal_wrap:
  269. .. rst-class:: classref-property
  270. :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **swapchain_state_horizontal_wrap** = ``0`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_horizontal_wrap>`
  271. .. rst-class:: classref-property-setget
  272. - |void| **set_horizontal_wrap**\ (\ value\: :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>`\ )
  273. - :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **get_horizontal_wrap**\ (\ )
  274. The horizontal wrap mode of the swapchain state.
  275. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_OpenXRCompositionLayer_property_swapchain_state_mag_filter:
  279. .. rst-class:: classref-property
  280. :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` **swapchain_state_mag_filter** = ``1`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_mag_filter>`
  281. .. rst-class:: classref-property-setget
  282. - |void| **set_mag_filter**\ (\ value\: :ref:`Filter<enum_OpenXRCompositionLayer_Filter>`\ )
  283. - :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` **get_mag_filter**\ (\ )
  284. The magnification filter of the swapchain state.
  285. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_OpenXRCompositionLayer_property_swapchain_state_max_anisotropy:
  289. .. rst-class:: classref-property
  290. :ref:`float<class_float>` **swapchain_state_max_anisotropy** = ``1.0`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_max_anisotropy>`
  291. .. rst-class:: classref-property-setget
  292. - |void| **set_max_anisotropy**\ (\ value\: :ref:`float<class_float>`\ )
  293. - :ref:`float<class_float>` **get_max_anisotropy**\ (\ )
  294. The max anisotropy of the swapchain state.
  295. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_OpenXRCompositionLayer_property_swapchain_state_min_filter:
  299. .. rst-class:: classref-property
  300. :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` **swapchain_state_min_filter** = ``1`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_min_filter>`
  301. .. rst-class:: classref-property-setget
  302. - |void| **set_min_filter**\ (\ value\: :ref:`Filter<enum_OpenXRCompositionLayer_Filter>`\ )
  303. - :ref:`Filter<enum_OpenXRCompositionLayer_Filter>` **get_min_filter**\ (\ )
  304. The minification filter of the swapchain state.
  305. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_OpenXRCompositionLayer_property_swapchain_state_mipmap_mode:
  309. .. rst-class:: classref-property
  310. :ref:`MipmapMode<enum_OpenXRCompositionLayer_MipmapMode>` **swapchain_state_mipmap_mode** = ``2`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_mipmap_mode>`
  311. .. rst-class:: classref-property-setget
  312. - |void| **set_mipmap_mode**\ (\ value\: :ref:`MipmapMode<enum_OpenXRCompositionLayer_MipmapMode>`\ )
  313. - :ref:`MipmapMode<enum_OpenXRCompositionLayer_MipmapMode>` **get_mipmap_mode**\ (\ )
  314. The mipmap mode of the swapchain state.
  315. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_OpenXRCompositionLayer_property_swapchain_state_red_swizzle:
  319. .. rst-class:: classref-property
  320. :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **swapchain_state_red_swizzle** = ``0`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_red_swizzle>`
  321. .. rst-class:: classref-property-setget
  322. - |void| **set_red_swizzle**\ (\ value\: :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>`\ )
  323. - :ref:`Swizzle<enum_OpenXRCompositionLayer_Swizzle>` **get_red_swizzle**\ (\ )
  324. The swizzle value for the red channel of the swapchain state.
  325. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_OpenXRCompositionLayer_property_swapchain_state_vertical_wrap:
  329. .. rst-class:: classref-property
  330. :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **swapchain_state_vertical_wrap** = ``0`` :ref:`🔗<class_OpenXRCompositionLayer_property_swapchain_state_vertical_wrap>`
  331. .. rst-class:: classref-property-setget
  332. - |void| **set_vertical_wrap**\ (\ value\: :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>`\ )
  333. - :ref:`Wrap<enum_OpenXRCompositionLayer_Wrap>` **get_vertical_wrap**\ (\ )
  334. The vertical wrap mode of the swapchain state.
  335. \ **Note:** This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_OpenXRCompositionLayer_property_use_android_surface:
  339. .. rst-class:: classref-property
  340. :ref:`bool<class_bool>` **use_android_surface** = ``false`` :ref:`🔗<class_OpenXRCompositionLayer_property_use_android_surface>`
  341. .. rst-class:: classref-property-setget
  342. - |void| **set_use_android_surface**\ (\ value\: :ref:`bool<class_bool>`\ )
  343. - :ref:`bool<class_bool>` **get_use_android_surface**\ (\ )
  344. If enabled, an Android surface will be created (with the dimensions from :ref:`android_surface_size<class_OpenXRCompositionLayer_property_android_surface_size>`) which will provide the 2D content for the composition layer, rather than using :ref:`layer_viewport<class_OpenXRCompositionLayer_property_layer_viewport>`.
  345. See :ref:`get_android_surface()<class_OpenXRCompositionLayer_method_get_android_surface>` for information about how to get the surface so that your application can draw to it.
  346. \ **Note:** This will only work in Android builds.
  347. .. rst-class:: classref-section-separator
  348. ----
  349. .. rst-class:: classref-descriptions-group
  350. Method Descriptions
  351. -------------------
  352. .. _class_OpenXRCompositionLayer_method_get_android_surface:
  353. .. rst-class:: classref-method
  354. :ref:`JavaObject<class_JavaObject>` **get_android_surface**\ (\ ) :ref:`🔗<class_OpenXRCompositionLayer_method_get_android_surface>`
  355. Returns a :ref:`JavaObject<class_JavaObject>` representing an ``android.view.Surface`` if :ref:`use_android_surface<class_OpenXRCompositionLayer_property_use_android_surface>` is enabled and OpenXR has created the surface. Otherwise, this will return ``null``.
  356. \ **Note:** The surface can only be created during an active OpenXR session. So, if :ref:`use_android_surface<class_OpenXRCompositionLayer_property_use_android_surface>` is enabled outside of an OpenXR session, it won't be created until a new session fully starts.
  357. .. rst-class:: classref-item-separator
  358. ----
  359. .. _class_OpenXRCompositionLayer_method_intersects_ray:
  360. .. rst-class:: classref-method
  361. :ref:`Vector2<class_Vector2>` **intersects_ray**\ (\ origin\: :ref:`Vector3<class_Vector3>`, direction\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_OpenXRCompositionLayer_method_intersects_ray>`
  362. Returns UV coordinates where the given ray intersects with the composition layer. ``origin`` and ``direction`` must be in global space.
  363. Returns ``Vector2(-1.0, -1.0)`` if the ray doesn't intersect.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_OpenXRCompositionLayer_method_is_natively_supported:
  367. .. rst-class:: classref-method
  368. :ref:`bool<class_bool>` **is_natively_supported**\ (\ ) |const| :ref:`🔗<class_OpenXRCompositionLayer_method_is_natively_supported>`
  369. Returns ``true`` if the OpenXR runtime natively supports this composition layer type.
  370. \ **Note:** This will only return an accurate result after the OpenXR session has started.
  371. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  372. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  373. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  374. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  375. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  376. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  377. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  378. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  379. .. |void| replace:: :abbr:`void (No return value.)`