Skip to content

Commit 796190c

Browse files
committed
Add support for the composition layer extensions to the main projection layer
- Add support for enabling `XR_FB_composition_layer_depth_test` on the projection layer - Add support for enabling `XR_FB_composition_layer_image_layout` on the projection layer - Add support for enabling `XR_FB_composition_layer_secure_content` on the projection layer - Add support for enabling `XR_FB_composition_layer_alpha_blend` on the projection layer - Add support for enabling `XR_FB_composition_layer_settings` on the projection layer
1 parent 5c8edaf commit 796190c

21 files changed

+186667
-182749
lines changed

.github/workflows/build-addon-on-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ jobs:
325325
needs: build
326326

327327
env:
328-
GODOT_VERSION: "4.6-stable"
328+
GODOT_VERSION: "4.7-stable"
329329
XRSIM_VERSION: "65.0.0"
330330

331331
steps:

doc_classes/OpenXRFbCompositionLayerAlphaBlendExtension.xml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,37 @@
88
</description>
99
<tutorials>
1010
</tutorials>
11+
<methods>
12+
<method name="is_enabled" qualifiers="const">
13+
<return type="bool" />
14+
<description>
15+
Checks if the extension is enabled or not.
16+
</description>
17+
</method>
18+
</methods>
19+
<members>
20+
<member name="projection_layer_alpha_blend_enabled" type="bool" setter="set_projection_layer_alpha_blend_enabled" getter="is_projection_layer_alpha_blend_enabled">
21+
Enables alpha blending for the projection layer.
22+
</member>
23+
<member name="projection_layer_destination_alpha_blend_factor" type="int" setter="set_projection_layer_destination_alpha_blend_factor" getter="get_projection_layer_destination_alpha_blend_factor" enum="OpenXRFbCompositionLayerAlphaBlendExtension.BlendFactor" default="0">
24+
Determines the destination's contribution to the alpha blending.
25+
</member>
26+
<member name="projection_layer_destination_color_blend_factor" type="int" setter="set_projection_layer_destination_color_blend_factor" getter="get_projection_layer_destination_color_blend_factor" enum="OpenXRFbCompositionLayerAlphaBlendExtension.BlendFactor" default="0">
27+
Determines the destination's contribution to the color blending.
28+
</member>
29+
<member name="projection_layer_source_alpha_blend_factor" type="int" setter="set_projection_layer_source_alpha_blend_factor" getter="get_projection_layer_source_alpha_blend_factor" enum="OpenXRFbCompositionLayerAlphaBlendExtension.BlendFactor" default="1">
30+
Determines the source's contribution to the alpha blending.
31+
</member>
32+
<member name="projection_layer_source_color_blend_factor" type="int" setter="set_projection_layer_source_color_blend_factor" getter="get_projection_layer_source_color_blend_factor" enum="OpenXRFbCompositionLayerAlphaBlendExtension.BlendFactor" default="1">
33+
Determines the source's contribution to the color blending.
34+
</member>
35+
</members>
1136
<constants>
1237
<constant name="BLEND_FACTOR_ZERO" value="0" enum="BlendFactor">
13-
Blending factor set to zero, resulting in no contribution from the source.
38+
Blending factor set to zero, resulting in no contribution.
1439
</constant>
1540
<constant name="BLEND_FACTOR_ONE" value="1" enum="BlendFactor">
16-
Blending factor set to one, resulting in full contribution from the source.
41+
Blending factor set to one, resulting in full contribution.
1742
</constant>
1843
<constant name="BLEND_FACTOR_SRC_ALPHA" value="2" enum="BlendFactor">
1944
Blending factor using the source alpha value.

doc_classes/OpenXRFbCompositionLayerDepthTestExtension.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,18 @@
88
</description>
99
<tutorials>
1010
</tutorials>
11+
<methods>
12+
<method name="is_enabled">
13+
<return type="bool" />
14+
<description>
15+
Checks if the extension is enabled or not.
16+
</description>
17+
</method>
18+
</methods>
19+
<members>
20+
<member name="projection_layer_depth_test_enabled" type="bool" setter="set_projection_layer_depth_test_enabled" getter="is_projection_layer_depth_test_enabled">
21+
Enables depth testing for the projection layer.
22+
[b]Note:[/b] The [code]xr/openxr/submit_depth_buffer[/code] project setting must be enabled for this to take effect.
23+
</member>
24+
</members>
1125
</class>

doc_classes/OpenXRFbCompositionLayerImageLayoutExtension.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,17 @@
88
</description>
99
<tutorials>
1010
</tutorials>
11+
<methods>
12+
<method name="is_enabled" qualifiers="const">
13+
<return type="bool" />
14+
<description>
15+
Checks if the extension is enabled or not.
16+
</description>
17+
</method>
18+
</methods>
19+
<members>
20+
<member name="projection_layer_vertical_flip" type="bool" setter="set_projection_layer_vertical_flip" getter="get_projection_layer_vertical_flip">
21+
Vertically flips the projection layer.
22+
</member>
23+
</members>
1124
</class>

doc_classes/OpenXRFbCompositionLayerSecureContentExtension.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,28 @@
88
</description>
99
<tutorials>
1010
</tutorials>
11+
<methods>
12+
<method name="is_enabled" qualifiers="const">
13+
<return type="bool" />
14+
<description>
15+
Checks if the extension is enabled or not.
16+
</description>
17+
</method>
18+
</methods>
19+
<members>
20+
<member name="projection_layer_external_output" type="int" setter="set_projection_layer_external_output" getter="get_projection_layer_external_output" enum="OpenXRFbCompositionLayerSecureContentExtension.ExternalOutput" default="0">
21+
Specifies how the projection layer should be rendered to external outputs. This setting will have [b]no effect[/b] on the projection layer when viewed from inside the device, but will take effect when casting to another device.
22+
</member>
23+
</members>
24+
<constants>
25+
<constant name="EXTERNAL_OUTPUT_DISPLAY" value="0" enum="ExternalOutput">
26+
Display the content without any changes to external outputs.
27+
</constant>
28+
<constant name="EXTERNAL_OUTPUT_EXCLUDE" value="1" enum="ExternalOutput">
29+
Hide this composition layer from external outputs, revealing content behind it.
30+
</constant>
31+
<constant name="EXTERNAL_OUTPUT_REPLACE" value="2" enum="ExternalOutput">
32+
Replace the content on this composition layer with a black screen.
33+
</constant>
34+
</constants>
1135
</class>

doc_classes/OpenXRFbCompositionLayerSettingsExtension.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@
88
</description>
99
<tutorials>
1010
</tutorials>
11+
<methods>
12+
<method name="is_enabled" qualifiers="const">
13+
<return type="bool" />
14+
<description>
15+
Checks if the extension is enabled or not.
16+
</description>
17+
</method>
18+
</methods>
19+
<members>
20+
<member name="projection_layer_auto_filter_enabled" type="bool" setter="set_projection_layer_auto_filter_enabled" getter="is_projection_layer_auto_filter_enabled" default="false">
21+
Enables the runtime's automatic layer filtering. The runtime will switch between disabled sharpening / supersampling and the modes indicated by [member projection_layer_sharpening_mode] and [member projection_layer_supersampling_mode].
22+
</member>
23+
<member name="projection_layer_sharpening_mode" type="int" setter="set_projection_layer_sharpening_mode" getter="get_projection_layer_sharpening_mode" enum="OpenXRFbCompositionLayerSettingsExtension.SharpeningMode" default="0">
24+
Selects the sharpening mode for the projection layer.
25+
</member>
26+
<member name="projection_layer_supersampling_mode" type="int" setter="set_projection_layer_supersampling_mode" getter="get_projection_layer_supersampling_mode" enum="OpenXRFbCompositionLayerSettingsExtension.SupersamplingMode" default="0">
27+
Selects the supersampling mode for the projection layer.
28+
</member>
29+
</members>
1130
<constants>
1231
<constant name="SUPERSAMPLING_MODE_DISABLED" value="0" enum="SupersamplingMode">
1332
Disable supersampling.

0 commit comments

Comments
 (0)