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

Alpha property for XRCompositionLayer #283

Closed
eXponenta opened this issue Jun 9, 2022 · 5 comments
Closed

Alpha property for XRCompositionLayer #283

eXponenta opened this issue Jun 9, 2022 · 5 comments

Comments

@eXponenta
Copy link

eXponenta commented Jun 9, 2022

Should be way to set alpha state to layer same as width/height or transform.

Reasons:

  1. Native support for alpha fading for some effects without overheads. Because layers already has alpha blending by content alpha this is not a problem for implementation.

  2. Optimisation. Due to that when we set alpha to 0 not needed draw a layer we can use this case for reduce calling updateRenderState for temporary layer disabling.

Alpha fading can be implemented in current version only for non-media layers, because without fading layers can't be used in production code due to bad UX.

For regular layers need to use a middleware for each animation frame - draw content to canvas or framebuffer, apply alpha and upload it to layer, what is catastrophically slow for media layer emulatation when video is too large.

@cabanier
Copy link
Member

cabanier commented Jun 9, 2022

/agenda allow author to control alpha on a layer

@probot-label probot-label bot added the agenda label Jun 9, 2022
@cabanier
Copy link
Member

cabanier commented Jun 9, 2022

Looking around other web APIs they seem to favor opacity over alpha.
We already have a blendTextureSourceAlpha attribute so maybe alpha is fine.

@cabanier
Copy link
Member

cabanier commented Jun 9, 2022

OpenXR also has support for color scaling: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_composition_layer_color_scale_bias

Would it make sense to allow that in WebXR?

@eXponenta
Copy link
Author

eXponenta commented Jun 9, 2022

Hm, because color scale already apply alpha, in openXR it is right way for implementation.

@eXponenta
Copy link
Author

#284

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

3 participants