P
P
pavelkolodin2016-02-09 19:05:15
Canvas
pavelkolodin, 2016-02-09 19:05:15

How to optimize animation on canvas?

In the toy fintank.ru , the screen (canvas) is redrawn at 20 fps. Each frame is drawn with several putImageData() calls, which, like Google maps, make up a picture from square fragments. The fragments are converted to ImageData and are in the cache. Each fragment can sometimes be changed by the server (put/removed a game object). The modified fragment is rendered in ImageData and replaces the old version in the cache.
How can this architecture be changed so that 60fps is achievable and the CPU doesn't run hot as hell? Forget about these dances with a tambourine putImageData () and move to WebGL?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SnowElephant, 2016-02-18
@SnowElephant

putImageData заменить на drawImage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question