Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/modules/openxr/doc_classes/OpenXRCompositionLayer.xml
11354 views
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<class name="OpenXRCompositionLayer" inherits="Node3D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
3
<brief_description>
4
The parent class of all OpenXR composition layer nodes.
5
</brief_description>
6
<description>
7
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.
8
[b]Note:[/b] If the OpenXR runtime doesn't support the given composition layer type, a fallback mesh can be generated with a [ViewportTexture], in order to emulate the composition layer.
9
</description>
10
<tutorials>
11
</tutorials>
12
<methods>
13
<method name="get_android_surface">
14
<return type="JavaObject" />
15
<description>
16
Returns a [JavaObject] representing an [code]android.view.Surface[/code] if [member use_android_surface] is enabled and OpenXR has created the surface. Otherwise, this will return [code]null[/code].
17
[b]Note:[/b] The surface can only be created during an active OpenXR session. So, if [member use_android_surface] is enabled outside of an OpenXR session, it won't be created until a new session fully starts.
18
</description>
19
</method>
20
<method name="intersects_ray" qualifiers="const">
21
<return type="Vector2" />
22
<param index="0" name="origin" type="Vector3" />
23
<param index="1" name="direction" type="Vector3" />
24
<description>
25
Returns UV coordinates where the given ray intersects with the composition layer. [param origin] and [param direction] must be in global space.
26
Returns [code]Vector2(-1.0, -1.0)[/code] if the ray doesn't intersect.
27
</description>
28
</method>
29
<method name="is_natively_supported" qualifiers="const">
30
<return type="bool" />
31
<description>
32
Returns [code]true[/code] if the OpenXR runtime natively supports this composition layer type.
33
[b]Note:[/b] This will only return an accurate result after the OpenXR session has started.
34
</description>
35
</method>
36
</methods>
37
<members>
38
<member name="alpha_blend" type="bool" setter="set_alpha_blend" getter="get_alpha_blend" default="false">
39
Enables the blending the layer using its alpha channel.
40
Can be combined with [member Viewport.transparent_bg] to give the layer a transparent background.
41
</member>
42
<member name="android_surface_size" type="Vector2i" setter="set_android_surface_size" getter="get_android_surface_size" default="Vector2i(1024, 1024)">
43
The size of the Android surface to create if [member use_android_surface] is enabled.
44
</member>
45
<member name="enable_hole_punch" type="bool" setter="set_enable_hole_punch" getter="get_enable_hole_punch" default="false">
46
Enables a technique called "hole punching", which allows putting the composition layer behind the main projection layer (i.e. setting [member sort_order] to a negative value) while "punching a hole" through everything rendered by Godot so that the layer is still visible.
47
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.
48
</member>
49
<member name="layer_viewport" type="SubViewport" setter="set_layer_viewport" getter="get_layer_viewport">
50
The [SubViewport] to render on the composition layer.
51
</member>
52
<member name="protected_content" type="bool" setter="set_protected_content" getter="is_protected_content" default="false">
53
If enabled, the OpenXR swapchain will be created with the [code]XR_SWAPCHAIN_CREATE_PROTECTED_CONTENT_BIT[/code] flag, which will protect its contents from CPU access.
54
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.
55
</member>
56
<member name="sort_order" type="int" setter="set_sort_order" getter="get_sort_order" default="1">
57
The sort order for this composition layer. Higher numbers will be shown in front of lower numbers.
58
[b]Note:[/b] This will have no effect if a fallback mesh is being used.
59
</member>
60
<member name="swapchain_state_alpha_swizzle" type="int" setter="set_alpha_swizzle" getter="get_alpha_swizzle" enum="OpenXRCompositionLayer.Swizzle" default="3">
61
The swizzle value for the alpha channel of the swapchain state.
62
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
63
</member>
64
<member name="swapchain_state_blue_swizzle" type="int" setter="set_blue_swizzle" getter="get_blue_swizzle" enum="OpenXRCompositionLayer.Swizzle" default="2">
65
The swizzle value for the blue channel of the swapchain state.
66
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
67
</member>
68
<member name="swapchain_state_border_color" type="Color" setter="set_border_color" getter="get_border_color" default="Color(0, 0, 0, 0)">
69
The border color of the swapchain state that is used when the wrap mode clamps to the border.
70
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
71
</member>
72
<member name="swapchain_state_green_swizzle" type="int" setter="set_green_swizzle" getter="get_green_swizzle" enum="OpenXRCompositionLayer.Swizzle" default="1">
73
The swizzle value for the green channel of the swapchain state.
74
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
75
</member>
76
<member name="swapchain_state_horizontal_wrap" type="int" setter="set_horizontal_wrap" getter="get_horizontal_wrap" enum="OpenXRCompositionLayer.Wrap" default="0">
77
The horizontal wrap mode of the swapchain state.
78
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
79
</member>
80
<member name="swapchain_state_mag_filter" type="int" setter="set_mag_filter" getter="get_mag_filter" enum="OpenXRCompositionLayer.Filter" default="1">
81
The magnification filter of the swapchain state.
82
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
83
</member>
84
<member name="swapchain_state_max_anisotropy" type="float" setter="set_max_anisotropy" getter="get_max_anisotropy" default="1.0">
85
The max anisotropy of the swapchain state.
86
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
87
</member>
88
<member name="swapchain_state_min_filter" type="int" setter="set_min_filter" getter="get_min_filter" enum="OpenXRCompositionLayer.Filter" default="1">
89
The minification filter of the swapchain state.
90
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
91
</member>
92
<member name="swapchain_state_mipmap_mode" type="int" setter="set_mipmap_mode" getter="get_mipmap_mode" enum="OpenXRCompositionLayer.MipmapMode" default="2">
93
The mipmap mode of the swapchain state.
94
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
95
</member>
96
<member name="swapchain_state_red_swizzle" type="int" setter="set_red_swizzle" getter="get_red_swizzle" enum="OpenXRCompositionLayer.Swizzle" default="0">
97
The swizzle value for the red channel of the swapchain state.
98
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
99
</member>
100
<member name="swapchain_state_vertical_wrap" type="int" setter="set_vertical_wrap" getter="get_vertical_wrap" enum="OpenXRCompositionLayer.Wrap" default="0">
101
The vertical wrap mode of the swapchain state.
102
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
103
</member>
104
<member name="use_android_surface" type="bool" setter="set_use_android_surface" getter="get_use_android_surface" default="false">
105
If enabled, an Android surface will be created (with the dimensions from [member android_surface_size]) which will provide the 2D content for the composition layer, rather than using [member layer_viewport].
106
See [method get_android_surface] for information about how to get the surface so that your application can draw to it.
107
[b]Note:[/b] This will only work in Android builds.
108
</member>
109
</members>
110
<constants>
111
<constant name="FILTER_NEAREST" value="0" enum="Filter">
112
Perform nearest-neighbor filtering when sampling the texture.
113
</constant>
114
<constant name="FILTER_LINEAR" value="1" enum="Filter">
115
Perform linear filtering when sampling the texture.
116
</constant>
117
<constant name="FILTER_CUBIC" value="2" enum="Filter">
118
Perform cubic filtering when sampling the texture.
119
</constant>
120
<constant name="MIPMAP_MODE_DISABLED" value="0" enum="MipmapMode">
121
Disable mipmapping.
122
[b]Note:[/b] Mipmapping can only be disabled in the Compatibility renderer.
123
</constant>
124
<constant name="MIPMAP_MODE_NEAREST" value="1" enum="MipmapMode">
125
Use the mipmap of the nearest resolution.
126
</constant>
127
<constant name="MIPMAP_MODE_LINEAR" value="2" enum="MipmapMode">
128
Use linear interpolation of the two mipmaps of the nearest resolution.
129
</constant>
130
<constant name="WRAP_CLAMP_TO_BORDER" value="0" enum="Wrap">
131
Clamp the texture to its specified border color.
132
</constant>
133
<constant name="WRAP_CLAMP_TO_EDGE" value="1" enum="Wrap">
134
Clamp the texture to its edge color.
135
</constant>
136
<constant name="WRAP_REPEAT" value="2" enum="Wrap">
137
Repeat the texture infinitely.
138
</constant>
139
<constant name="WRAP_MIRRORED_REPEAT" value="3" enum="Wrap">
140
Repeat the texture infinitely, mirroring it on each repeat.
141
</constant>
142
<constant name="WRAP_MIRROR_CLAMP_TO_EDGE" value="4" enum="Wrap">
143
Mirror the texture once and then clamp the texture to its edge color.
144
[b]Note:[/b] This wrap mode is not available in the Compatibility renderer.
145
</constant>
146
<constant name="SWIZZLE_RED" value="0" enum="Swizzle">
147
Maps a color channel to the value of the red channel.
148
</constant>
149
<constant name="SWIZZLE_GREEN" value="1" enum="Swizzle">
150
Maps a color channel to the value of the green channel.
151
</constant>
152
<constant name="SWIZZLE_BLUE" value="2" enum="Swizzle">
153
Maps a color channel to the value of the blue channel.
154
</constant>
155
<constant name="SWIZZLE_ALPHA" value="3" enum="Swizzle">
156
Maps a color channel to the value of the alpha channel.
157
</constant>
158
<constant name="SWIZZLE_ZERO" value="4" enum="Swizzle">
159
Maps a color channel to the value of zero.
160
</constant>
161
<constant name="SWIZZLE_ONE" value="5" enum="Swizzle">
162
Maps a color channel to the value of one.
163
</constant>
164
</constants>
165
</class>
166
167