Skip to content

Commit 2062dff

Browse files
authored
Merge pull request #10510 from skyace65/Setup-XR
Update setting up XR for Godot 4.3
2 parents 8996cc1 + 6858161 commit 2062dff

8 files changed

+31
-33
lines changed

tutorials/xr/img/openxr_settings.webp

-19.7 KB
Binary file not shown.

tutorials/xr/img/xr_basic_scene.webp

5.74 KB
Binary file not shown.

tutorials/xr/img/xr_left_hand.webp

7.11 KB
Binary file not shown.

tutorials/xr/img/xr_right_hand.webp

7.32 KB
Binary file not shown.

tutorials/xr/img/xr_shaders.webp

7.09 KB
Binary file not shown.

tutorials/xr/openxr_settings.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ OpenXR has its own set of settings that are applied when OpenXR starts.
77
While it is possible for OpenXR extensions implemented through Godot plugins to add additional settings,
88
we will only discuss the settings in the core of Godot here.
99

10-
.. image:: img/openxr_settings.png
10+
.. image:: img/openxr_settings.webp
1111

1212
Enabled
1313
-------

tutorials/xr/setting_up_xr.rst

+29-31
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,14 @@ There are three XR specific node types that you will find in nearly all XR appli
2828

2929
There are other XR related nodes and there is much more to say about these three nodes, but we'll get into that later on.
3030

31-
Prerequisites for XR in Godot 4
32-
-------------------------------
31+
Which Renderer to use
32+
---------------------
3333

34-
While in Godot 3 most things worked out of the box, Godot 4 needs a little more
35-
setup. This is mainly due to the more advanced nature of the Vulkan renderer.
36-
There are many rendering features in Vulkan the XR system uses that aren't
37-
enabled by default. To turn them on, open up your project settings and tick
38-
:ref:`XR > Shaders > Enabled <class_ProjectSettings_property_xr/shaders/enabled>`:
39-
40-
.. image:: img/xr_shaders.png
41-
42-
.. UPDATE: Not supported yet. When all or most post process effects work in
43-
.. stereoscopic rendering, remove or update this note.
44-
45-
.. warning::
46-
As Godot 4 is still in development, many post process effects have not yet been updated to support stereoscopic rendering. Using these will have adverse effects.
47-
48-
.. UPDATE: Recommended renderer may change. If the Mobile renderer (or any other
49-
.. renderer) is recommended for all XR projects, update this note.
50-
51-
.. note::
52-
Godot 4 has 3 renderer options, Compatibility, Mobile, and Forward+. In the future XR desktop projects should use Forward+, and projects for standalone headsets
53-
should use Mobile. Currently Compatibility is the recommended renderer for standalone headsets, and ironically Mobile is the recommended renderer for desktop.
54-
This is based on current XR performance on the different devices with each renderer.
34+
Godot has 3 renderer options for projects: Compatibility, Mobile, and Forward+.
35+
The current recommendation is to use the Mobile renderer for any desktop VR project,
36+
and use the Compatibility renderer for any project running on a standalone headset
37+
like the Meta Quest 3. XR projects will run with the Forward+ renderer, but it isn't
38+
well optimized for XR right now compared to the other two.
5539

5640
OpenXR
5741
------
@@ -60,27 +44,41 @@ OpenXR is a new industry standard that allows different XR platforms to present
6044

6145
The Vulkan implementation of OpenXR is closely integrated with Vulkan, taking over part of the Vulkan system. This requires tight integration of certain core graphics features in the Vulkan renderer which are needed before the XR system is setup. This was one of the main deciding factors to include OpenXR as a core interface.
6246

63-
This also means OpenXR needs to be enabled when Godot starts in order to set things up correctly. The required setting can be found in your project settings:
47+
This also means OpenXR needs to be enabled when Godot starts in order to set things
48+
up correctly. Check the :ref:`Enabled<class_ProjectSettings_property_xr/openxr/enabled>`
49+
setting in your project settings under **XR > OpenXR**.
50+
51+
.. image:: img/openxr_settings.webp
52+
53+
You can find several other settings related to OpenXR here as well. These can't be
54+
changed while your application is running. The default settings will get us started,
55+
but for more information on what's here see :ref:`doc_openxr_settings`.
6456

65-
.. image:: img/openxr_settings.png
57+
You'll also need to go to **XR > Shaders** in the project settings and check the
58+
:ref:`Enabled<class_ProjectSettings_property_xr/shaders/enabled>`
59+
box to enable them. Once you've done that click the **Save & Restart** button.
60+
61+
.. image:: img/xr_shaders.webp
62+
63+
.. warning::
64+
Many post process effects have not yet been updated to support stereoscopic rendering. Using these will have adverse effects.
6665

67-
As setup is brought forward with OpenXR you can find several other settings related to OpenXR here as well. These can't be changed while your application is running.
68-
The default settings will get us started and we will go into detail in another section of the documentation.
6966

7067
Setting up the XR scene
7168
-----------------------
7269

7370
Every XR application needs at least an :ref:`XROrigin3D <class_xrorigin3d>` and an :ref:`XRCamera3D <class_xrcamera3d>` node. Most will have two :ref:`XRController3D <class_xrcontroller3d>`, one for the left hand and one for the right. Keep in mind that the camera and controller nodes should be children of the origin node. Add these nodes to a new scene and rename the controller nodes to ``LeftHand`` and ``RightHand``, your scene should look something like this:
7471

75-
.. image:: img/xr_basic_scene.png
72+
.. image:: img/xr_basic_scene.webp
7673

77-
Next you need to configure the controllers, select the left hand and set it up as follows:
74+
The warning icons are expected and should go away after you configure the
75+
controllers. Select the left hand and set it up as follows:
7876

79-
.. image:: img/xr_left_hand.png
77+
.. image:: img/xr_left_hand.webp
8078

8179
And the right hand:
8280

83-
.. image:: img/xr_right_hand.png
81+
.. image:: img/xr_right_hand.webp
8482

8583
Right now all these nodes are on the floor, they will be positioned correctly in runtime. To help during development, it can be helpful to move the camera upwards so its ``y`` is set to ``1.7``, and move the controller nodes to ``-0.5, 1.0, -0.5`` and ``0.5, 1.0, -0.5`` for respectively the left and right hand.
8684

tutorials/xr/xr_action_map.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ and binding these to the actual inputs and outputs on your XR devices.
1717
As the XR action map is currently part of the OpenXR module, OpenXR needs to be enabled
1818
in your project settings to expose it:
1919

20-
.. image:: img/openxr_settings.png
20+
.. image:: img/openxr_settings.webp
2121

2222
You will then find the XR Action Map interface in the bottom of the screen:
2323

0 commit comments

Comments
 (0)