diff --git a/public/index.html b/public/index.html
index 6651dc4183a0b5ec63bb137a0f7b078a04185557..aec9a1dccf2f1d6407cb77b7c375a61f3e02a3cf 100644
--- a/public/index.html
+++ b/public/index.html
@@ -38,6 +38,21 @@ async function activateXR() {
   cube.position.set(1, 1, 1);
   scene.add(cube);
 
+  // Set up the WebGLRenderer, which handles rendering to the session's base layer.
+  const renderer = new THREE.WebGLRenderer({
+    alpha: true,
+    preserveDrawingBuffer: true,
+    canvas: canvas,
+    context: gl
+  });
+  renderer.autoClear = false;
+
+  // The API directly updates the camera matrices.
+  // Disable matrix auto updates so three.js doesn't attempt
+  // to handle the matrices independently.
+  const camera = new THREE.PerspectiveCamera();
+  camera.matrixAutoUpdate = false;
+
 }
 </script>
 </body>