Render Loop

Passing render textures to the SDK

Once the scene and the cameras are setup, in your render loop , you'll have to pass the render textures of the cameras to the SDK. This render texture passing logic has to run every frame , so this has to be part of the render loop.

render() {
/* cameras - cams setup using SDK positions and projection matrices,
rtWidth and rtHeight - render texture width and height taken from the SDK */
const tempBuffer = new Uint8Array(rtWidth * rtHeight * 4);
cameras.forEach((camera,index) =>
renderer.render(scene, camera);
renderer.readRenderTargetPixels(renderTarget, 0, 0, rtWidth, rtHeight, tempBuffer);
RenderController.saveTexture(tempBuffer, index, rtWidth, rtHeight, gl);

Once the render textures are passed onto the SDK using RenderController.saveTexture(...), The update method from the Render Controller has to be called to process and render the final output onto the canvas specified.

render() {