-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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: Provide way to get XR viewport resolution when presenting #21188
Comments
Is the framebuffer resolution useful there, that's a documented property of the baseLayer? (At least in the webxr api, if not in the three xrframe? I haven't looked since that was added.)
A couple other non documented routes: Stash the XRFrame, which is the second arg to setAnimationLoop when xr is presenting, and use getViewerPose / reference spaces to read the viewports from there :| Another is hackily checking in a scene.onBeforeRender whether the camera is an ArrayCamera && xr.isPresenting and reading them from there heh. |
This will need to be re-opened unless you pick changes to |
It would be great if you could file a separate PR with the code related to this issue. |
Is your feature request related to a problem? Please describe.
The 3DTilesRenderJS project requires information about the screen resolution in order to derive screen error and determine which 3d tiles data to render. Right now
WebGLRenderer.getResolution
andWebGLRenderer.getViewport
both provide the resolution of the canvas rather than the render resolution of the VR device.Describe the solution you'd like
I would like a supported way to read the viewport or resolution of the XR device when XRManager is presenting or for
WebGLRenderer.getResolution
to return the resolution of the XR device when presenting. This information is already available on the camera.viewport vector for each eye camera but is not exposed in any documented way.Describe alternatives you've considered
Related to #21002 to work around this I use the undocumented
WebXRManager.getCamera( camera )
and wait until the list of cameras is populated in order to read the viewport of one of the eye cameras. The viewport is not available for the first frame after beginning presenting.The text was updated successfully, but these errors were encountered: