In chapter 15 when you start applying triple buffering we have to place the following code in the update(deltaTime) function.
uniforms[currentUniformIndex].projectionMatrix = camera.projectionMatrix
uniforms[currentUniformIndex].viewMatrix = camera.viewMatrix
currentUniformIndex = (currentUniformIndex + 1) % Scene.buffersInFlight
after this we change our call to terrain.update() to
terrain.update(viewMatrix: uniforms[currentUniformIndex].viewMatrix)
but then our currentUniformIndex is already updated to a new value so I don’t think we access the correct viewMatrix as it’s lagging one uniforms entry behind.