Skip to main content

XR8.GlTextureRenderer.setTextureProvider()

XR8.GlTextureRenderer.setTextureProvider(({ frameStartResult, processGpuResult, processCpuResult }) => {} )

Description

Sets a provider that passes the texture to draw. This should be a function that take the same inputs as cameraPipelineModule.onUpdate.

Parameters

setTextureProvider() takes a function with the following parameters:

ParameterTypeDescription
frameStartResultObjectThe data that was provided at the beginning of a frame.
processGpuResultObjectData returned by all installed modules during onProcessGpu.
processCpuResultObjectData returned by all installed modules during onProcessCpu.

The function should return a WebGLTexture to draw.

Returns

None

Example

XR8.GlTextureRenderer.setTextureProvider(
({processGpuResult}) => {
return processGpuResult.camerapixelarray ? processGpuResult.camerapixelarray.srcTex : null
})