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 FrameRate #6077

Merged
merged 5 commits into from Feb 21, 2024
Merged

WebXR FrameRate #6077

merged 5 commits into from Feb 21, 2024

Conversation

Maksims
Copy link
Contributor

@Maksims Maksims commented Feb 21, 2024

The developer will be able to control the target frame rate of an XR session based on a provided list of supported frame rates.

XR device can change framerate based on its underlying mechanics, but the user has control over it also. For example, Quest 3 provides these supported frame rates: [ 72, 80, 90, 120 ], and by default it will use 90 Hz. But you can ask it to render with 120 Hz if your app can manage such performance.

New APIs:

// pc.XrManager
xr.frameRate // (number|null) a target frame rate of the current session, or null if not supported or no XR session is available
xr.supportedFrameRates // (number[]|null) list of supported frame rates, or null if not supported or no XR session is available
xr.updateTargetFrameRate(frameRate: number, (err) => { }); // async method to update frame rate based on list of supported values
xr.on('frameratechange', (frameRate: number) => { }); // event when framerate has been changed 

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@mvaligursky mvaligursky merged commit 6a81133 into playcanvas:main Feb 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants