XRWebGLLayer: fixedFoveation property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The fixedFoveation property of the XRWebGLLayer interface is a number indicating the amount of foveation used by the XR compositor. Fixed Foveated Rendering (FFR) renders the edges of the eye textures at a lower resolution than the center and reduces the GPU load.

It is most useful for low contrast textures, such as background images but less for high contrast ones such as text or detailed images. Authors can adjust the level on a per frame basis to achieve the best tradeoff between performance and visual quality.

Value

A number between 0 and 1.

  • The minimum amount of foveation is indicated by 0 (full resolution).
  • The maximum amount of foveation is indicated by 1 (the edges render at lower resolution).

It's up to the user agent how to interpret the numbers in this range. When changing the foveation level, the effect will visible in the next XRFrame.

Note that some user agents might implement certain levels of foveation, so you might need to adjust the foveation level in large increments to see an effect. Example levels:

  • 0: no foveation
  • 1/3: low foveation
  • 2/3: medium foveation
  • 1.0: maximum foveation

Some devices don't support foveated rendering. In that case fixedFoveation is null and setting it will not do anything.

Examples

Dynamically setting the level of fixed foveation rendering

The fixedFoveation property allows you to set the level of foveation at runtime and for each frame. To set the maximum foveation for a given XRWebGLLayer, use a value of 1.

js
let glLayer = xrSession.renderState.baseLayer;
glLayer.fixedFoveation = 1; // maximum foveation

Specifications

Specification
WebXR Device API
# dom-xrwebgllayer-fixedfoveation

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
fixedFoveation
Experimental
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – No support
Firefox
footnote No support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

No support
No support
Experimental. Expect behavior to change in the future.

See also