Table of Contents

Class XRProjectionLayer

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The XRProjectionLayer interface of the WebXR Device API is a layer that fills the entire view of the observer and is refreshed close to the device's native frame rate.
[Value("XRProjectionLayer")]
public class XRProjectionLayer : XRCompositionLayer
Inheritance
XRProjectionLayer
Inherited Members

Remarks

XRProjectionLayer is supported by all XRSession objects (no layers feature descriptor is needed).

To create a new XRProjectionLayer, call CreateProjectionLayer(XRProjectionLayerInit).
To present layers to the XR device, add them to the layers render state using UpdateRenderState(XRRenderStateInit).

XRProjectionLayer objects don't have an associated XRSpace, because they render to the full frame.

-XRLayer
-EventTarget
-XRCompositionLayer
-XREquirectLayer
-XRCubeLayer
-XRCylinderLayer
-XRQuadLayer

See also on MDN

Constructors

XRProjectionLayer()

public XRProjectionLayer()

Properties

DeltaPose

[Value("deltaPose")]
public XRRigidTransform? DeltaPose { get; set; }

Property Value

XRRigidTransform

FixedFoveation

NOTE
Experimental
The fixedFoveation property of the XRProjectionLayer interface is a number indicating the amount of foveation used by the XR compositor for the layer. Fixed Foveated Rendering (FFR) renders the edges of the eye textures at a lower resolution than the center and reduces the GPU load.
[Value("fixedFoveation")]
public Number? FixedFoveation { get; set; }

Property Value

Number

A number between 0 and 1.It's up to the user agent how to interpret the numbers in this range. When changing the foveation level, the effect will visible in the next XRFrame.Note that some user agents might implement certain levels of foveation, so you might need to adjust the foveation level in large increments to see an effect. Example levels:Some devices don't support foveated rendering. In that case fixedFoveation is null and setting it will not do anything.

Remarks

It is most useful for low-contrast textures such as background images, but less for high-contrast ones such as text or detailed images. Authors can adjust the level on a per-frame basis to achieve the best tradeoff between performance and visual quality.

-Foveated rendering

See also on MDN

IgnoreDepthValues

NOTE
Experimental
The read-only ignoreDepthValues property of the XRProjectionLayer interface is a boolean indicating if the XR compositor is not making use of depth buffer values when rendering the layer.
[Value("ignoreDepthValues")]
public bool IgnoreDepthValues { get; }

Property Value

bool

A boolean. true indicates the XR compositor doesn't make use of depth buffer values; false indicates the content of the depth buffer will be used when rendering the layer.

Remarks

TextureArrayLength

NOTE
Experimental
The read-only textureArrayLength property of the XRProjectionLayer interface indicates layer's layer count for array textures when using texture-array as the textureType.
[Value("textureArrayLength")]
public ulong TextureArrayLength { get; }

Property Value

ulong

A number indicating the number of layers of the color textures when using texture-array as the textureType. Otherwise it will be 1.

Remarks

The projection layer's layer count for array textures is determined by the user agent or the device. It is reported in the XRSubImage, which can only be accessed inside the frame loop. If you want to manage your own depth buffers and don't want to wait for first frame after layer creation to determine the required dimensions for those buffers, the textureArrayLength property allows access to layer count for array textures outside the frame loop. Allocation of these buffers can happen directly after layer creation.

-XRSubImage

See also on MDN

TextureHeight

NOTE
Experimental
The read-only textureHeight property of the XRProjectionLayer interface indicates the height in pixels of the color textures of this layer.
[Value("textureHeight")]
public ulong TextureHeight { get; }

Property Value

ulong

A number indicating the height in pixels.

Remarks

The projection layer's texture height is determined by the user agent or the device. It is reported in the XRSubImage, which can only be accessed inside the frame loop. If you want to manage your own depth buffers and don't want to wait for first frame after layer creation to determine the required dimensions for those buffers, the textureHeight property allows access to layer texture height outside the frame loop. Allocation of these buffers can happen directly after layer creation.

-CreateProjectionLayer(XRProjectionLayerInit)
-WebGL2RenderingContext.RenderbufferStorageMultisample
-XRSubImage

See also on MDN

TextureWidth

NOTE
Experimental
The read-only textureWidth property of the XRProjectionLayer interface indicates the width in pixels of the color textures of this layer.
[Value("textureWidth")]
public ulong TextureWidth { get; }

Property Value

ulong

A number indicating the width in pixels.

Remarks

The projection layer's texture width is determined by the user agent or the device. It is reported in the XRSubImage, which can only be accessed inside the frame loop. If you want to manage your own depth buffers and don't want to wait for first frame after layer creation to determine the required dimensions for those buffers, the textureWidth property allows access to layer texture width outside the frame loop. Allocation of these buffers can happen directly after layer creation.

-CreateProjectionLayer(XRProjectionLayerInit)
-WebGL2RenderingContext.RenderbufferStorageMultisample
-XRSubImage

See also on MDN