XRWebGLLayerInit.alpha - Web APIs 编辑
Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The alpha
property is a Boolean value which, if present and set to true
in the XRWebGLLayerInit
dictionary passed into the XRWebGLLayer()
constructor, specifies that the new layer's color buffer is to include an alpha channel. Otherwise, the color buffer won't have an alpha channel. The default is true
.
Syntax
let layerInit = { alpha: boolValue }; let glLayer = new XRWebGLLayer(xrSession, gl, layerInit); let glLayer = new XRWebGLLayer(xrSession, gl, { alpha: boolValue });
Value
A Boolean which can be set to true
to request that the new WebGL layer for rendering the WebXR scene is to have an alpha channel.
Example
In this example, a new XRWebGLLayer
is created for a WebXR session, xrSession
, without an alpha channel.
xrSession.updateRenderState({
baseLayer: new XRWebGLLayer(xrSession, gl, {
alpha: false
});
});
Specifications
Specification | Status | Comment |
---|---|---|
WebXR Device API The definition of 'XRWebGLLayerInit.alpha' in that specification. | Working Draft | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论