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:
Parameter | Type | Description |
---|---|---|
frameStartResult | Object | The data that was provided at the beginning of a frame. |
processGpuResult | Object | Data returned by all installed modules during onProcessGpu . |
processCpuResult | Object | Data 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
})