docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Use dynamic foveation

    Let a supporting device vary the amount of foveation it applies, up to the foveation level you set.

    With dynamic foveation, a supporting XR device varies the amount of foveation it applies while your application runs. This behavior can improve performance when your application presents a scene that contains a large amount of content.

    Dynamic foveation doesn't set the amount of foveation itself. You control the amount with the foveation level, which you set through the scriptable render pipeline (SRP) foveation API. Assign the level to XRDisplaySubsystem.foveatedRenderingLevel, as described in Use the SRP foveation API. When you disable dynamic foveation, the device applies that level constantly. When you enable dynamic foveation, the level becomes a maximum. The device applies less foveation when the GPU has available capacity, and increases foveation up to the level you set when GPU load rises. The runtime determines this behavior, so the exact conditions vary by device.

    Important

    Because the foveation level acts as a maximum, dynamic foveation has no effect while the foveation level is 0, which is the default. Set a foveation level greater than 0 for dynamic foveation to have an effect.

    Dynamic foveation is independent of gaze-based foveated rendering. Use Eye Tracking doesn't enable dynamic foveation, so enable each one separately. You can use both at the same time. The amount of foveation then adjusts to the current GPU load while the high-resolution area follows the user's gaze.

    Prerequisites

    Ensure your project meets the requirements outlined in Dynamic foveation requirements.

    Configure the SRP foveation method before you begin, as described in Use the SRP foveation API.

    Enable dynamic foveation

    To enable dynamic foveation in your Unity project:

    1. Open the Project Settings window.
    2. Under XR Plug-in Management, select the OpenXR settings.
    3. Select the tab for the platform you want to configure.
    4. In the list of OpenXR Feature Groups, select All Features.
    5. Under OpenXR Feature Groups, enable the Foveated Rendering feature.
    6. Under OpenXR Feature Groups, select the gear icon next to the Foveated Rendering feature.
    7. Enable the Dynamic Foveation (Vulkan) setting.

    Settings to enable dynamic foveation
    Dynamic foveation settings.

    Unity applies this setting when the OpenXR session starts. You can also enable or disable dynamic foveation at runtime with FoveatedRenderingFeature.DynamicFoveationEnabled, which overrides the project setting for the rest of the session.

    The following code example sets a foveation level and then enables dynamic foveation, so that the device can vary the amount of foveation it applies up to that level:

    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR;
    using UnityEngine.XR.OpenXR;
    using UnityEngine.XR.OpenXR.Features;
    
    namespace UnityEngine.XR.OpenXR.CodeSamples.Editor.Tests
    {
        public class DynamicFoveationStarter : MonoBehaviour
        {
            List<XRDisplaySubsystem> xrDisplays = new List<XRDisplaySubsystem>();
    
            void Start()
            {
                var foveatedRendering = OpenXRSettings.Instance.GetFeature<FoveatedRenderingFeature>();
                if (foveatedRendering == null || !foveatedRendering.enabled)
                {
                    Debug.LogWarning("The Foveated Rendering feature is not enabled.");
                    return;
                }
    
                // Dynamic foveation has no effect while the foveation level is 0, which is the
                // default, so set a level first. The device treats it as the maximum amount of
                // foveation it can apply.
                SubsystemManager.GetSubsystems(xrDisplays);
                if (xrDisplays.Count == 1)
                {
                    xrDisplays[0].foveatedRenderingLevel = 0.7f;
                }
    
                // The device can now apply less foveation than the level set above whenever it
                // has GPU capacity to spare.
                foveatedRendering.DynamicFoveationEnabled = true;
            }
        }
    }
    

    Additional resources

    • Foveated rendering requirements reference
    • Use the SRP foveation API
    • Configure gaze-based foveated rendering
    • OpenXR settings reference
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)