Back to Content

XRCompositionLayer: blendTextureSourceAlpha property

files/en-us/web/api/xrcompositionlayer/blendtexturesourcealpha/index.md

latest635 B
Original Source

{{APIRef("WebXR Device API")}}{{SeeCompatTable}}

The blendTextureSourceAlpha property of the {{domxref("XRCompositionLayer")}} interface is a boolean enabling the layer's texture {{Glossary("Alpha", "alpha channel")}}.

Value

A boolean. true enables the alpha channel, false disables it.

Examples

Setting a layer's texture alpha channel

The following code snippet toggles a layer to opaque and back.

js
myLayer.blendTextureSourceAlpha = !myLayer.blendTextureSourceAlpha;

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{Glossary("Alpha", "Alpha channel")}}