XR demos: Add check for VRS/foveation in start vr script, and enable foveation in project settings (#1022)

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
This commit is contained in:
Bastiaan Olij
2024-04-13 07:16:23 +10:00
committed by GitHub
parent b2ed2d6f6d
commit 035e905a3e
10 changed files with 18 additions and 12 deletions

View File

@@ -1,2 +0,0 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

View File

@@ -1,5 +1,2 @@
# Godot 4+ specific ignores
.godot/
# Ignore our Android build folder, should be installed by user if needed
android/

View File

@@ -5,7 +5,7 @@ This is based on the [Character body centric solution as explained in the room s
Language: GDScript
Renderer: compatibility
Renderer: Compatibility
## How does it work?

View File

@@ -24,4 +24,6 @@ textures/vram_compression/import_etc2_astc=true
[xr]
openxr/enabled=true
openxr/foveation_level=3
openxr/foveation_dynamic=true
shaders/enabled=true

View File

@@ -23,6 +23,12 @@ func _ready():
# Make sure v-sync is off, v-sync is handled by OpenXR
DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED)
# Enable VRS
if RenderingServer.get_rendering_device():
vp.vrs_mode = Viewport.VRS_XR
elif int(ProjectSettings.get_setting("xr/openxr/foveation_level")) == 0:
push_warning("OpenXR: Recommend setting Foveation level to High in Project Settings")
# Connect the OpenXR events
xr_interface.session_begun.connect(_on_openxr_session_begun)
xr_interface.session_visible.connect(_on_openxr_visible_state)

View File

@@ -1,2 +0,0 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

View File

@@ -1,5 +1,2 @@
# Godot 4+ specific ignores
.godot/
# Ignore our Android build folder, should be installed by user if needed
android/

View File

@@ -5,7 +5,7 @@ This is based on the [Origin centric solution as explained in the room scale man
Language: GDScript
Renderer: compatibility
Renderer: Compatibility
## How does it work?

View File

@@ -24,4 +24,6 @@ textures/vram_compression/import_etc2_astc=true
[xr]
openxr/enabled=true
openxr/foveation_level=3
openxr/foveation_dynamic=true
shaders/enabled=true

View File

@@ -23,6 +23,12 @@ func _ready():
# Make sure v-sync is off, v-sync is handled by OpenXR
DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED)
# Enable VRS
if RenderingServer.get_rendering_device():
vp.vrs_mode = Viewport.VRS_XR
elif int(ProjectSettings.get_setting("xr/openxr/foveation_level")) == 0:
push_warning("OpenXR: Recommend setting Foveation level to High in Project Settings")
# Connect the OpenXR events
xr_interface.session_begun.connect(_on_openxr_session_begun)
xr_interface.session_visible.connect(_on_openxr_visible_state)