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

Need FOV angles for interop between WebXR and OpenVR #1370

Closed
ognkrmms opened this issue May 23, 2024 · 1 comment
Closed

Need FOV angles for interop between WebXR and OpenVR #1370

ognkrmms opened this issue May 23, 2024 · 1 comment

Comments

@ognkrmms
Copy link

Hi,
I am developing an application written with OpenVR that video streams to WebXR frontend. I know projectionMatrix must not be decomposed into raw angles as mentioned in #461 and #575. But to the best of my knowledge, OpenVR works directly with FOV angles (SetDisplayProjectionRaw). How can I circumvent the limitation?

@toji
Copy link
Member

toji commented May 23, 2024

To clarify: Are you taking values from OpenVR and pushing then to WebXR? Because there shouldn't be any conflict in that case, you can simply compute the projection matrix from the FOV angles. Chrome did this for a while, before we fully switched to an OpenXR backend. (The spec text is to warn developers using WebXR to not decompose the matrix. WebXR implementations are free to determine the matrix however they see fit.)

If it's the other way around, though, and you're feeding values from WebXR into OpenVR (which I'd like to know more about! I'm not sure how that would work) then you're probably stuck decomposing the matrix anyway, despite the warnings in the spec. The logic being that the primary reason for not decomposing into angles is that the matrix may contain shearing, but if it does then that headset is fundamentally incompatible with OpenVR anyway. (Or at the very least cannot accurately describe it's projection to the API. How disruptive that will be depends on the hardware/optics.)

So decomposing the matrix is the most correct thing you can do for interop between the two APIs, and should work well on a large number of devices, but is not guaranteed to work universally.

@toji toji closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants