Skip to content

Commit

Permalink
XR demos: Add check for VRS/foveation in start vr script, and enable …
Browse files Browse the repository at this point in the history
…foveation in project settings (#1022)

Co-authored-by: Aaron Franke <[email protected]>
  • Loading branch information
BastiaanOlij and aaronfranke authored Apr 12, 2024
1 parent b2ed2d6 commit 035e905
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 12 deletions.
2 changes: 0 additions & 2 deletions xr/openxr_character_centric_movement/.gitattributes

This file was deleted.

3 changes: 0 additions & 3 deletions xr/openxr_character_centric_movement/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# Godot 4+ specific ignores
.godot/

# Ignore our Android build folder, should be installed by user if needed
android/
2 changes: 1 addition & 1 deletion xr/openxr_character_centric_movement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
2 changes: 2 additions & 0 deletions xr/openxr_character_centric_movement/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions xr/openxr_character_centric_movement/start_vr.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions xr/openxr_origin_centric_movement/.gitattributes

This file was deleted.

3 changes: 0 additions & 3 deletions xr/openxr_origin_centric_movement/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# Godot 4+ specific ignores
.godot/

# Ignore our Android build folder, should be installed by user if needed
android/
2 changes: 1 addition & 1 deletion xr/openxr_origin_centric_movement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
2 changes: 2 additions & 0 deletions xr/openxr_origin_centric_movement/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions xr/openxr_origin_centric_movement/start_vr.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 035e905

Please sign in to comment.