filbs111 / box2d-learning

0 stars 0 forks source link

smooth scrolling #7

Closed filbs111 closed 7 years ago

filbs111 commented 8 years ago

scrolling is super janky in firefox but not in chrome not clear why this is. maybe interpolation of player position when drawing will cure problem. if chrome is drawing at 100fps (same as mechanics rate) then should work well. maybe firefox is dropping frames. maybe reducing physics accuracy will help (reducing time spent doing mechanics) profiling may be informative moving mechanics to web worker could help things. maybe restarting browser? should add stats.js . maybe own funcs to look at how variable framerate is.

filbs111 commented 8 years ago

added stats.js. turns out framerate was crap on firefox until i restarted it. should still add interpolation, which will make a difference when the monitor refresh rate doesn't happen to equal the mechanics rate (currently 100fps). if i set the mechanics rate to 60fps on my 100fps monitor, result is not jerky - result is double vision effect for moving objects. web worker can wait.