About the SpriteBatchNode in Html5 with no-WebGL support

About the SpriteBatchNode in Html5 with no-WebGL support
0.0 0


When i used SpriteBatchNode to show 100 sprites in no-WebGl browser, i found the top number stats showed 100, but when switched to WebGL browser, it showed 1.

Then, if there is no performance promotion on no-WebGl browser with SpriteBatchNode?



Hi, @longyangxi

Indeed, on canvas mode, there is no batch rendering like WebGL, so your sprite has been rendered one after another in 100 draw calls.
But there is still performance promotion on canvas mode with sprite batch node.

Imagine we have two type of sprite, A and B, each type have 100 nodes on the scene. Compare two rendering process:

  1. Draw some A and then some B, then some A … till all sprites have been rendered
  2. Draw all A sprites then draw all B sprites

The second process is much quicker than the first process.
So we still encourage developers to use SpriteBatchNode when it’s possible, no matter which render mode you use.




That’s very clear, great thanks!


Very informative.