-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
Description
When rendering stereo views with WebXR the camera is updated and managed by the WebXRManager. With #26041 it's no longer possible to suppress this update logic or get access to the underlying xr camera. There are situations where one might want to manually change certain aspects of these cameras, like their position, orientation or projectionMatrix. Examples where I've used this include:
- Rendering mirror views (second
rendercall with adjusted projection matrices to align clipping plane with mirror surface) - Rendering portals where one eye might already be through the portal (different world matrix)
- Monoscopic 3DoF rendering
I can see how this might not have been the intended use-case of renderer.xr.cameraAutoUpdate = false, but it did fit these use-cases nicely, hence a feature request in hopes of re-introducing something comparable.
Solution
The easiest solution would be to revert parts of #26041 and provide clearer naming and/or documentation stating how to use it. Most use-cases I can think of will base the adjusted cameras on the "would-be" cameras, so having access to cameraXR managed by WebXRManager is needed as well. Otherwise user-code would even have to retrieve viewer pose information from the WebXR session manually (and redundantly).
Alternatives
An alternative could be to allow the user to pass an "XR" ArrayCamera into the render method that would be used instead. Even then, it would still be needed to have access to the "would-be" XR camera, mainly for the WebXR viewer pose information.
Additional context
No response