The requestAnimationFrame Function

The requestAnimationFrame function is available in all WebGL-enabled browsers. One of the advantages of leveraging this function is that it is designed to call the rendering function (whatever function we indicate) only when the browser/tab window is in focus. Otherwise, there is no call. This saves precious CPU, GPU, and memory resources. By using the requestAnimationFrame function, we can obtain a rendering cycle that is in sync with hardware capabilities and one that will automatically suspend itself when the window is out of focus.

requestAnimationFrame

To check out the status of requestAnimationFrame in your browser, visit https://caniuse.com/#search=requestanimationframe.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.191.22