-
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
Communicate projection layer texture size outside the frame loop #224
Comments
I prefer option 1. Projection layers will always have an pixel size so there's no need to have a helper method. |
The How about calling it |
Good point. @toji , was this attribute meant to indicate the number of textures in the texture array, or the number of textures in the internal array or both? |
My intent was to indicate the number of textures in the texture array. (The texture "depth") |
Would a better name be |
|
Brought up in discussion on #223
Most layer types accept a user-specified texture size, but projection layers only accept a scalar and the final size is determined by the UA/hardware. Currently this size is only reported in the
XRSubImage
, which can only be accessed inside the frame loop.The problem is that currently if the application wants to manage their own depth buffer (which will be necessary for WebGL 1 apps that aren't using the
WEBGL_depth_texture
extension or that don't want their depth buffer to be used by the compositor), or any other supplemental buffers, it would have to wait until the first frame after layer creation to determine the required dimensions for those buffers. Ideally that allocation could happen outside of the frame loop, probably immediately after the layer creation.I can think of one of two ways to approach this:
XRProjectionLayer
directly. (This would likely be ONLY for the projection layer, since other layer types may be used with things likeXRMediaBinding
and the sizes would be moot.) In order for applications to allocate a matching buffer we'd want to report both the size and layer count for array textures.XRMediaBinding
we could also make it a query onXRWebGLBinding
, similar togetSubImage()
but without the frame requirements:The text was updated successfully, but these errors were encountered: