-
Notifications
You must be signed in to change notification settings - Fork 19
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
Make it possible/easier to determine a suitable resolution for equirects, cylinders, (cubemaps?) and quads #238
Comments
Video layers don't have an inherent pixel width and height. The spec is currently silent at what resolution they are rendered. Inside the Oculus browser, the layer is allocated at the pixel width and height of the video. Also, we should specify what happens if the video source changes. Likely during the next Raf call, the underlying video layer texture should be reallocated.
DOM layers would inherit all this from the regular 2D world. The spec would have to define how the size of the layer would translate to CSS pixels.
How would you envision that this is specced? We would have to add a note that changing the dimensions after creation, will not reallocate the texture. |
It seems to the author that they do. See my first paragraph about XRLayerInit requiring viewPixelWidth and viewPixelHeight.
Agreed. I was wondering what happens if the aspect ratio of the content changes.
Images are special because they have an intrinsic aspect ratio, right? So say I want to put an image on a quad, making me determine the image's aspect ratio and specify it for a quad seems inconvenient. But for DOM content in general, sure, having me specify the aspect ratio of a quad or equirect seems reasonable.
Seems reasonable! And it would be splendid, like #224, if I did not have to wait for a frame to find out the resolution. |
Video layers use a different structure. See here
The spec already defines how the aspect ratio is calculated. The new spec text will refer to that.
That is true. Are there enough arguments to add support?
Yes, that should be possible. We need to hear from other UAs if they can return pixel information right away. |
@dominiccooney I marked it as "future enhancement". Please let me know if you feel strongly that this needs to be in the initial version of the spec. |
The layer types with XR*LayerInit : XRLayerInit require authors to specify
viewPixelWidth
andviewPixelHeight
. Working out effective values for these seems difficult.I have my source media (environment map/photo/video/etc.) available in multiple resolutions. How do I work out what resolution will be effective for the device that is rendering the layer? Similar to issue #224, I need to pump a frame to find out views and work out a field of view from that; and I guess I need to create a projection layer, and fetch the subimage to work out its width and height, and throw that layer away to then calculate pixels per degree and pick media based on that.
That seems like a lot of work for what I think is a pretty common use case. In 2D media we have srcset, source and media queries for selecting media and, worst case, clientWidth/clientHeight and devicePixelRatio I can work out the size of a video element and pick suitable media. But if I take that same video and put it on a quad layer I need to specify pixel sizes and break that whole pipeline.
I have a few ideas how this might be improved:
<source>
,srcset
, etc. Why can't that just continue to operate when the video is bound to a layer?The text was updated successfully, but these errors were encountered: