mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-31 09:49:06 +03:00
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:
@@ -1,2 +0,0 @@
|
||||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
@@ -1,5 +1,2 @@
|
||||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
|
||||
# Ignore our Android build folder, should be installed by user if needed
|
||||
android/
|
||||
|
||||
@@ -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?
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
3
xr/openxr_origin_centric_movement/.gitignore
vendored
3
xr/openxr_origin_centric_movement/.gitignore
vendored
@@ -1,5 +1,2 @@
|
||||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
|
||||
# Ignore our Android build folder, should be installed by user if needed
|
||||
android/
|
||||
|
||||
@@ -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?
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user