Class XRCompositionLayer
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalXRCompositionLayer interface of the WebXR Device API is a base class that defines a set of common properties and behaviors for WebXR layer types. It is not constructable on its own.
[Value("XRCompositionLayer")]
public class XRCompositionLayer : XRLayer
- Inheritance
-
XRCompositionLayer
- Derived
- Inherited Members
Remarks
Several layer types inherit from XRCompositionLayer:
XRCompositionLayer itself inherits from the general XRLayer class (which inherits from EventTarget).
-XRLayer
-EventTarget
-XREquirectLayer
-XRCubeLayer
-XRCylinderLayer
-XRProjectionLayer
-XRQuadLayer
Constructors
XRCompositionLayer()
public XRCompositionLayer()
Properties
BlendTextureSourceAlpha
NOTE
ExperimentalblendTextureSourceAlpha property of the XRCompositionLayer interface is a boolean enabling the layer's texture {{Glossary("Alpha", "alpha channel")}}.
[Value("blendTextureSourceAlpha")]
public bool BlendTextureSourceAlpha { get; set; }
Property Value
- bool
A boolean.
trueenables the alpha channel,falsedisables it.
Remarks
ForceMonoPresentation
[Value("forceMonoPresentation")]
public bool ForceMonoPresentation { get; set; }
Property Value
Layout
NOTE
Experimentallayout property of the XRCompositionLayer interface is the layout type of the layer.
[Value("layout")]
public XRLayerLayout Layout { get; }
Property Value
- XRLayerLayout
A string. Possible values:
Remarks
To specify the layout type of a layer, use one of the layer creation methods and their layout option:
-XRSubImage
-CreateQuadLayer(XRQuadLayerInit)
-CreateCylinderLayer(XRCylinderLayerInit)
-CreateEquirectLayer(XREquirectLayerInit)
-CreateCubeLayer(XRCubeLayerInit)
MipLevels
NOTE
ExperimentalmipLevels property of the XRCompositionLayer interface is a layer's number of mip levels in the color and texture data. See also Mipmap on Wikipedia.
[Value("mipLevels")]
public ulong MipLevels { get; }
Property Value
- ulong
A number equal or smaller to the requested mip levels when a layer has been created.
Remarks
The desired number of mip levels can be specified when creating layers. However, if the user agent can't create the requested number, it can create less. Use mipLevels to determine the actual number of mip levels for a layer.
The viewPixelWidth and viewPixelHeight need to be powers of two as they get successively halved at each mip level.
-Mipmap on Wikipedia
NeedsRedraw
NOTE
ExperimentalneedsRedraw property of the XRCompositionLayer interface is a boolean signaling that the layer should be re-rendered in the next frame.
[Value("needsRedraw")]
public bool NeedsRedraw { get; }
Property Value
- bool
A boolean.
trueindicates a rerendering is needed in the next frame,falseindicates no re-rendering is needed.
Remarks
The need for redrawing can occur when the underlying resources of a layer are lost due to textures that might have been freed by the compositor under the hood. This might happen when the device falls asleep or when the browser switches context (to an operating system dialog or similar) and then comes back.
Redrawing is not a problem for layers which are updated with every frame. However, for layers updated infrequently, or for static layers (where you can only draw once after creation or after a redraw event), the layer's content might be lost and need to be redrawn. If the layer's resources are lost, the needsRedraw property will be true and a redraw event is fired on the layer.
-XREquirectLayer: XREquirectLayer.Redraw event
-XRCubeLayer: XRCubeLayer.Redraw event
-XRCylinderLayer: XRCylinderLayer.Redraw event
-XRQuadLayer: XRQuadLayer.Redraw event
Opacity
[Value("opacity")]
public Number Opacity { get; set; }
Property Value
Quality
[Value("quality")]
public XRLayerQuality Quality { get; set; }
Property Value
Methods
Destroy()
NOTE
Experimentaldestroy() method of the XRCompositionLayer interface deletes the references to the underlying graphics library for the layer. It also sets the color textures and depth stencil texture arrays to an empty array.
[Value("destroy")]
public GlobalObject.Undefined Destroy()