Appearance
@tmrw-realityos/charm / readDepthTexture
Function: readDepthTexture()
readDepthTexture(
context,depthTexture,pixelCoordinates,flipY):Promise<Float32Array<ArrayBufferLike>>
Defined in: packages/charm/src/graphics/WebGPU/WebGPUTextureTools.ts:131
Read pixel values from a depth texture
Parameters
context
Rendering context
depthTexture
GPUTexture
Depth texture to read from, must be created with GPUTextureUsage.TEXTURE_BINDING. Can be multisampled.
pixelCoordinates
Array of coordinates to read
vec3[] | vec2[] | [number, number][] | [number, number, number][]
flipY
boolean = false
Flip the y pixel coordinate
Returns
Promise<Float32Array<ArrayBufferLike>>
Array of length pixelCoordinates.length containing the depth texture values