Class XRProjectionLayer
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalXRProjectionLayer 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
Constructors
XRProjectionLayer()
public XRProjectionLayer()
Properties
DeltaPose
[Value("deltaPose")]
public XRRigidTransform? DeltaPose { get; set; }
Property Value
FixedFoveation
NOTE
ExperimentalfixedFoveation 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
fixedFoveationisnulland 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.
IgnoreDepthValues
NOTE
ExperimentalignoreDepthValues 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.
trueindicates the XR compositor doesn't make use of depth buffer values;falseindicates the content of the depth buffer will be used when rendering the layer.
Remarks
TextureArrayLength
NOTE
ExperimentaltextureArrayLength 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-arrayas thetextureType. Otherwise it will be1.
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.
TextureHeight
NOTE
ExperimentaltextureHeight 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
TextureWidth
NOTE
ExperimentaltextureWidth 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