Skip to content

Class: DepthTextures

Defined in: packages/core/src/depth/depth-textures.ts:21

Manages depth textures from WebXR depth sensing. Supports both CPU-optimized (DataArrayTexture) and GPU-optimized (ExternalTexture) depth data.

Constructors

Constructor

new DepthTextures(useFloat32): DepthTextures

Defined in: packages/core/src/depth/depth-textures.ts:26

Parameters

useFloat32

boolean

Returns

DepthTextures

Methods

dispose()

dispose(): void

Defined in: packages/core/src/depth/depth-textures.ts:136

Dispose of all depth textures.

Returns

void


getDataArrayTexture()

getDataArrayTexture(): DataArrayTexture

Defined in: packages/core/src/depth/depth-textures.ts:129

Get the CPU depth data as a DataArrayTexture. Contains per-view depth packed into layers; the shader uses VIEW_ID to select the layer.

Returns

DataArrayTexture


getNativeTexture()

getNativeTexture(): ExternalTexture

Defined in: packages/core/src/depth/depth-textures.ts:121

Get the native GPU depth texture array. Contains both eyes' depth data; the shader uses VIEW_ID to select the layer.

Returns

ExternalTexture


updateData()

updateData(depthData, viewId): void

Defined in: packages/core/src/depth/depth-textures.ts:69

Update the depth texture with new CPU depth data. Copies per-view data into the correct layer of the DataArrayTexture.

Parameters

depthData

XRCPUDepthInformation

The CPU depth information from WebXR.

viewId

number

The view index (0 for left eye, 1 for right eye).

Returns

void


updateNativeTexture()

updateNativeTexture(depthData, renderer): void

Defined in: packages/core/src/depth/depth-textures.ts:99

Update the depth texture with native GPU texture from WebXR. The native texture is a texture array containing both eyes' depth data.

Parameters

depthData

XRWebGLDepthInformation

The GPU depth information from WebXR.

renderer

WebGLRenderer

The WebGL renderer.

Returns

void

Privacy | Terms