Created
May 6, 2016 08:37
-
-
Save spite/fe9ed4d06646c6c22f4a04757c8e5bb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hashRenderParams() { | |
var hash; | |
// hash your render values | |
//e.g, camera parameters: camera.position.x + '|' + camera.position.y + '|' + camera.position.z | |
return hash; | |
} | |
var hash = ''; | |
function render() { | |
requestAnimationFrame( render ); | |
// update render params | |
// e.g. ease camera position | |
var h = hashRenderParams(); | |
if( h !== hash ) { | |
// frame invalidated, redraw | |
} | |
hash = h; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment