diff options
Diffstat (limited to 'src/webGLWorker.js')
-rw-r--r-- | src/webGLWorker.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/webGLWorker.js b/src/webGLWorker.js index 37b844b6..4ccc8d55 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -609,7 +609,10 @@ function WebGLWorker() { Module['postMainLoop'] = function() { if (postMainLoop) postMainLoop(); // frame complete, send the command buffer - postMessage({ target: 'gl', op: 'render', commandBuffer: commandBuffer }); + if (Math.abs(frameId - clientFrameId) <= 3) { + // only send if not throttling + postMessage({ target: 'gl', op: 'render', commandBuffer: commandBuffer }); + } commandBuffer = []; }; } |