lundi 17 novembre 2014

getImageData Performance on Chrome cast seems awful. Any quick fixes?


Vote count:

0




So, I have been playing around with the idea of making a chromecast game.


In the process, I have run into a simple problem. My test machine runs the game at about 5ms per frame. The chromecast rarely pushes more than a frame per second. I was expecting some slowdown from the full desktop browser to the chromecast, but not that much.


I profiled the thing and discovered that if I have an awful frame rate I am spending between 50% and 80% of my time in getImageData(x,y,1,1); This is pulling the image data for a single pixel from a canvas. This appears to be working at a rate of about ~50 pixels per second. I have an object in motion and am checking to see if it has collided with the terrain and am doing so by simply checking if the color on the terrain canvas is not black.


Any thoughts about increasing the speed on getImageData?


I am not really expecting a silver bullet here, but figured I would ask out of a sort of fatalistic sense of completeness while I try out a few other things designed to limit calls to getImageData



asked 43 secs ago

Lee

1






getImageData Performance on Chrome cast seems awful. Any quick fixes?

Aucun commentaire:

Enregistrer un commentaire