安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
alpha
property is a Boolean value which, if present and set to
true
在
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
.
let layerInit = {
alpha: boolValue
};
let glLayer = new XRWebGLLayer(xrSession, gl, layerInit);
let glLayer = new XRWebGLLayer(xrSession, gl, { alpha: boolValue });
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.
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
});
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebXR 设备 API
The definition of 'XRWebGLLayerInit.alpha' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
alpha
|
Chrome 79 | Edge 79 | Firefox No | IE No | Opera No | Safari No | WebView Android 79 | Chrome Android 79 | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android 11.2 |
完整支持
不支持
XRWebGLLayerInit
Navigator.xr
WebGLRenderingContext.makeXRCompatible()
XR
XRBoundedReferenceSpace
XRFrame
XRInputSource
XRInputSourceArray
XRInputSourceEvent
XRInputSourcesChangeEvent
XRPose
XRReferenceSpace
XRReferenceSpaceEvent
XRRenderState
XRRigidTransform
XRSession
XRSessionEvent
XRSpace
XRView
XRViewerPose
XRViewport
XRWebGLLayer