-
Notifications
You must be signed in to change notification settings - Fork 63
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
XR_KHR_composition_layer_equirect2 ambiguities #130
Comments
An issue (number 1793) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#1793 ), to facilitate working group processes. This GitHub issue will continue to be the main site of discussion. |
The equirect sphere is at the origin of its local space with vertical angles of pi/2 and -pi/2 on the y axis. At the vertical angle 0, the zero horizontal angle is on the -z axis, just like for the cylinder layer. |
The above is in the space of the sphere. The pose member of this layer is used to position and orient the sphere relative to some other space. |
thanks @casseveritt Its worth noting too that the original equirect extension is similarly ambiguous. I presume the scale applies before the bias, and that resulting texture coordinates outside of the subimage are clipped. Given the two extensions are supposed to be roughly functionally equivalent I presume a mapping between them would be something like this?
or maybe for OpenGL this?
As far as I'm concerned its also ambiguous how the V texture coordinate is interpreted. Sorry to be so pedantic! |
Hmm, sorry, I think I've got that mapping backwards, and scale should be the inverse. Maybe somebody who knows can specify the mapping between equirect and equirect2 and how the bias and scale are applied to what ranges of 2d coordinates. |
Mapping eqr2 back to eqr parameterization would be:
The OpenGL ES layout of these textures does introduce a "y flip" issue if you're rendering to them. This is one of those cases where the original content often came from image sources (e.g. video decoders) where the origin was already upper left. To accommodate different source conventions, we added FB_composition_layer_image_layout. |
Also to your question:
The angle parameters define where the layer exists. Regions outside those angles should not map to anything visible. The subimage only defines which portion of a swapchain maps to that region. The image rect corners correspond to the angle corners in the sphere's parameter space. |
Thanks @casseveritt, I think that clears up most of it. |
Scaled and biased coordinates outside the imageRect are treated as invisible in the original equirect extension. If your image rect was the whole image, then yes, outside that range would be invisible. But if you were only using part of the texture image, outside of that rect would be invisible. |
The mapping of the swapchain subimage to the inside surface of the partial sphere by XR_KHR_composition_layer_equirect2 is ambiguous. It could benefit from a diagram as provided for XR_KHR_composition_layer_cylinder.
For example, some questions:
Monado currently doesn't scale, position or orient the partial sphere or the texture mapping at all (and the points on the partial sphere map directly to the subimage based on the direction rather than the angle within the partial sphere), so I'm left guessing what the correct behaviour was intended to be.
The text was updated successfully, but these errors were encountered: