Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebXR Fixed Foveation #6078

Merged
merged 3 commits into from Feb 22, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/framework/xr/xr-manager.js
Expand Up @@ -1018,6 +1018,30 @@ class XrManager extends EventHandler {
return this._framebufferScaleFactor;
}

/**
* Set fixed foveation to the value between 0 and 1. Where 0 - no foveation, and 1 - highest
* foveation. It only can be set during an active XR session.
* Fixed foveation will reduce the resolution of the back buffer at the edges of the sceen,
* which can improve rendering performance.
*
* @type {number}
*/
set fixedFoveation(value) {
if ((this._baseLayer?.fixedFoveation ?? null) !== null) {
this._baseLayer.fixedFoveation = value;
Maksims marked this conversation as resolved.
Show resolved Hide resolved
}
}

/**
* Current fixed foveation level, which is between 0 and 1. 0 - no forveation, and 1 - highest
* foveation. If fixed foveation is not supported, this value returns null.
*
* @type {number|null}
*/
get fixedFoveation() {
return this._baseLayer?.fixedFoveation ?? null;
}

/**
* Active camera for which XR session is running or null.
*
Expand Down