8000 Specified that XRWebGLLayer framebuffers always use premultiplied alpha by toji · Pull Request #840 · immersive-web/webxr · GitHub
[go: up one dir, main page]

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

Specified that XRWebGLLayer framebuffers always use premultiplied alpha #840

Merged
merged 1 commit into from
Sep 19, 2019

Conversation

toji
Copy link
Member
@toji toji commented Sep 12, 2019

Not intended for merge until discussed at TPAC /facetoface

Would fix #837 and #838 if the working group's decision is that XRWebGLLayers are always treated as using premultiplied alpha regardless of the source context's flags. Preparing this for easy approval should that be the case.

@@ -1684,6 +1684,7 @@ An <dfn>opaque framebuffer</dfn> functions identically to a standard {{WebGLFram
- An [=opaque framebuffer=] initialized with {{XRWebGLLayerInit/depth}} <code>false</code> will not have an attached depth buffer.
- An [=opaque framebuffer=] initialized with {{XRWebGLLayerInit/stencil}} <code>false</code> will not have an attached stencil buffer.
- An [=opaque framebuffer=]'s color buffer will have an alpha channel if and only if {{XRWebGLLayerInit/alpha}} is <code>true</code>.
- The [=XR Compositor=] will assume the [=opaque framebuffer=] contains colors with premultiplied alpha. This is true regardless of the {{WebGLContextAttributes|premultipliedAlpha}} value set in the {{XRWebGLLayer/context}}'s [=actual context parameters=].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this we should probably also recommend a warning be displayed in this situation to properly fix #837

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered about that, but it seems like recommending that the UA output a warning to the console falls outside of what specs typically dictate. At best we could put a non-normative note in that suggests it, but I'm not sure if the group feels like that's necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, a non normative note is what I meant. "UAs may want to show a warning to the console when a context created with premultipliedAlpha: false is passed to new XRWebGLLayer()"

We can also make it a hard error, but that might be too large a hammer.

@toji toji marked this pull request as ready for review September 16, 2019 08:21
@NellWaliczek NellWaliczek added this to the September 2019 milestone Sep 19, 2019
@Manishearth Manishearth self-assigned this Sep 19, 2019
@toji toji merged commit 57a585a into master Sep 19, 2019
@toji toji deleted the premultiplied branch September 19, 2019 08:43
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

Successfully merging this pull request may close these issues.

Clarify what happens if a premultipliedAlpha: false context is used
4 participants
0