diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index ddcef3340e..0eb92fd3ce 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -3627,11 +3627,14 @@ If [code]true[/code] and foveation is supported, will automatically adjust foveation level based on framerate up to the level set on [member xr/openxr/foveation_level]. + + If [code]true[/code] and foveation level is set to anything other than "Disabled", eye-tracked foveation will be used, so long as it's supported by the headset. + Applied foveation level if supported. [b]Note:[/b] On platforms other than Android, if [member rendering/anti_aliasing/quality/msaa_3d] is enabled, this feature will be disabled. - + If [code]true[/code] and foveation is also enabled, subsampled images will be used on Vulkan. This can improve the performance gain from foveated rendering, especially when using high foveation levels. [b]Note:[/b]: Using subsampled images is incompatible with many screen-space rendering features or post-processing effects like FXAA or glow. If any such effects are enabled, subsampled images will automatically be disabled and a warning shown in the log. diff --git a/main/main.cpp b/main/main.cpp index 97f88117fd..b9ad6c4b55 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2833,7 +2833,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/environment_blend_mode", PROPERTY_HINT_ENUM, "Opaque,Additive,Alpha"), "0"); GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/foveation_level", PROPERTY_HINT_ENUM, "Off,Low,Medium,High"), "0"); GLOBAL_DEF_BASIC("xr/openxr/foveation_dynamic", false); - GLOBAL_DEF_BASIC("xr/openxr/foveation_with_subsampled_images", false); + GLOBAL_DEF_BASIC("xr/openxr/foveation_eye_tracked", true); + GLOBAL_DEF_BASIC("xr/openxr/foveation_with_subsampled_images", true); GLOBAL_DEF_BASIC("xr/openxr/submit_depth_buffer", false); GLOBAL_DEF_BASIC("xr/openxr/startup_alert", true); diff --git a/modules/openxr/extensions/openxr_fb_foveation_extension.cpp b/modules/openxr/extensions/openxr_fb_foveation_extension.cpp index 04820291d2..d156e6e494 100644 --- a/modules/openxr/extensions/openxr_fb_foveation_extension.cpp +++ b/modules/openxr/extensions/openxr_fb_foveation_extension.cpp @@ -98,8 +98,12 @@ HashMap OpenXRFBFoveationExtension::get_requested_extensions(XrV #ifdef XR_USE_GRAPHICS_API_VULKAN if (rendering_driver == "vulkan") { request_extensions[XR_FB_FOVEATION_VULKAN_EXTENSION_NAME] = &fb_foveation_vulkan_ext; - request_extensions[XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME] = &meta_foveation_eye_tracked_ext; request_extensions[XR_META_VULKAN_SWAPCHAIN_CREATE_INFO_EXTENSION_NAME] = &meta_vulkan_swapchain_create_info_ext; + + bool fov_eye_tracked = GLOBAL_GET("xr/openxr/foveation_eye_tracked"); + if (fov_eye_tracked) { + request_extensions[XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME] = &meta_foveation_eye_tracked_ext; + } } #endif // XR_USE_GRAPHICS_API_VULKAN