OpenXR: Add eye-tracked foveation setting, and enable subsampled images by default

This commit is contained in:
David Snopek committed 2026-03-26 12:06:23 -05:00
1 parent a1aa0fa2fa
commit e4703603b4
3 files changed
+11 -3

No files matched your search

+4 -1
View File
@@ -3627,11 +3627,14 @@
<member name="xr/openxr/foveation_dynamic" type="bool" setter="" getter="" default="false">
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].
</member>
<member name="xr/openxr/foveation_eye_tracked" type="bool" setter="" getter="" default="true">
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.
</member>
<member name="xr/openxr/foveation_level" type="int" setter="" getter="" default="&quot;0&quot;">
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.
</member>
<member name="xr/openxr/foveation_with_subsampled_images" type="bool" setter="" getter="" default="false">
<member name="xr/openxr/foveation_with_subsampled_images" type="bool" setter="" getter="" default="true">
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.
</member>
+2 -1
View File
@@ -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);
@@ -98,8 +98,12 @@ HashMap<String, bool *> 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