Table of Contents

Class XRWebGLBinding

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The XRWebGLBinding interface is used to create layers that have a GPU backend.
[Value("XRWebGLBinding")]
public class XRWebGLBinding
Inheritance
XRWebGLBinding
Inherited Members

Remarks

Constructors

XRWebGLBinding()

public XRWebGLBinding()

XRWebGLBinding(XRSession, Union235)

NOTE
Experimental
The XRWebGLBinding() constructor creates and
returns a new XRWebGLBinding object.
public XRWebGLBinding(XRSession session, Union235 context)

Parameters

session XRSession
context Union235

Remarks

-WebGLRenderingContext.MakeXRCompatible

See also on MDN

Properties

NativeProjectionScaleFactor

NOTE
Experimental
The read-only nativeProjectionScaleFactor property of the XRWebGLBinding interface represents the scaling factor by which the projection layer's resolution is multiplied by to get the native resolution of the WebXR device's frame buffer.
[Value("nativeProjectionScaleFactor")]
public Number NativeProjectionScaleFactor { get; }

Property Value

Number

A floating-point number representing by how much the device's native frame buffer size is scaled by.

Remarks

UsesDepthValues

[Value("usesDepthValues")]
public bool UsesDepthValues { get; }

Property Value

bool

Methods

CreateCubeLayer(XRCubeLayerInit)

NOTE
Experimental
The createCubeLayer() method of the XRWebGLBinding interface returns an XRCubeLayer object, which is a layer that renders directly from a cubemap, and projects it onto the inside faces of a cube.
[Value("createCubeLayer")]
public XRCubeLayer CreateCubeLayer(XRCubeLayerInit init = null)

Parameters

init XRCubeLayerInit

Returns

XRCubeLayer

An XRCubeLayer object.

Remarks

CreateCylinderLayer(XRCylinderLayerInit)

NOTE
Experimental
The createCylinderLayer() method of the XRWebGLBinding interface returns an XRCylinderLayer object, which is a layer that takes up a curved rectangular space in the virtual environment.
[Value("createCylinderLayer")]
public XRCylinderLayer CreateCylinderLayer(XRCylinderLayerInit init = null)

Parameters

init XRCylinderLayerInit

Returns

XRCylinderLayer

An XRCylinderLayer object.

Remarks

CreateEquirectLayer(XREquirectLayerInit)

NOTE
Experimental
The createEquirectLayer() method of the XRWebGLBinding interface returns an XREquirectLayer object, which is a layer that maps equirectangular coded data onto the inside of a sphere.
[Value("createEquirectLayer")]
public XREquirectLayer CreateEquirectLayer(XREquirectLayerInit init = null)

Parameters

init XREquirectLayerInit

Returns

XREquirectLayer

An XREquirectLayer object.

Remarks

CreateProjectionLayer(XRProjectionLayerInit)

NOTE
Experimental
The createProjectionLayer() method of the XRWebGLBinding interface returns an XRProjectionLayer object which is a layer that fills the entire view of the observer and is refreshed close to the device's native frame rate.
[Value("createProjectionLayer")]
public XRProjectionLayer CreateProjectionLayer(XRProjectionLayerInit init = null)

Parameters

init XRProjectionLayerInit

Returns

XRProjectionLayer

An XRProjectionLayer object.

Remarks

CreateQuadLayer(XRQuadLayerInit)

NOTE
Experimental
The createQuadLayer() method of the XRWebGLBinding interface returns an XRQuadLayer object which is a layer that takes up a flat rectangular space in the virtual environment.
[Value("createQuadLayer")]
public XRQuadLayer CreateQuadLayer(XRQuadLayerInit init = null)

Parameters

init XRQuadLayerInit

Returns

XRQuadLayer

An XRQuadLayer object.

Remarks

GetCameraImage(XRCamera)

[Value("getCameraImage")]
public WebGLTexture? GetCameraImage(XRCamera camera)

Parameters

camera XRCamera

Returns

WebGLTexture

GetDepthInformation(XRView)

NOTE
Experimental
The getDepthInformation() method of the XRWebGLBinding interface returns an XRWebGLDepthInformation object containing WebGL depth information.
[Value("getDepthInformation")]
public XRWebGLDepthInformation? GetDepthInformation(XRView view)

Parameters

view XRView

Returns

XRWebGLDepthInformation

An XRWebGLDepthInformation object.

Remarks

GetReflectionCubeMap(XRLightProbe)

NOTE
Experimental
The getReflectionCubeMap() method of the XRWebGLBinding interface returns a WebGLTexture object containing a reflection cube map texture.
[Value("getReflectionCubeMap")]
public WebGLTexture? GetReflectionCubeMap(XRLightProbe lightProbe)

Parameters

lightProbe XRLightProbe

Returns

WebGLTexture

A WebGLTexture object.

Remarks

The texture format is specified by the session's reflectionFormat. See the options parameter on RequestLightProbe(XRLightProbeInit) and PreferredReflectionFormat for more details. By default, the srgba8 format is used. When using a rgba16f format, you need to be within a WebGL 2.0 context or enable the OES_texture_half_float extension within WebGL 1.0 contexts.

-XRLightProbe
-OES_texture_half_float

See also on MDN

GetSubImage(XRCompositionLayer, XRFrame, XREye)

NOTE
Experimental
The getSubImage() method of the XRWebGLBinding interface returns a XRWebGLSubImage object representing the WebGL texture to render.
[Value("getSubImage")]
public XRWebGLSubImage GetSubImage(XRCompositionLayer layer, XRFrame frame, XREye eye = XREye.None)

Parameters

layer XRCompositionLayer
frame XRFrame
eye XREye

Returns

XRWebGLSubImage

A XRWebGLSubImage object.

Remarks

GetViewSubImage(XRProjectionLayer, XRView)

NOTE
Experimental
The getViewSubImage() method of the XRWebGLBinding interface returns a XRWebGLSubImage object representing the WebGL texture to render for a view.
[Value("getViewSubImage")]
public XRWebGLSubImage GetViewSubImage(XRProjectionLayer layer, XRView view)

Parameters

layer XRProjectionLayer
view XRView

Returns

XRWebGLSubImage

A XRWebGLSubImage object.

Remarks