About performance of `indexBuffer` & `drawElements`.
See original GitHub issuerecently , I try to create some examples about shader (just for studying), so I don’t use PIXI.
I use a simple webgl wrapper igloojs
at https://github.com/skeeto/igloojs
And I found a strange thing :
When I just render thousands of sprite (use same texture , so they’re batch) ---- no motion , no animation, no transform, no shader ,no filter ,no any effect, just “stand & still” , the igloojs
is faster than pixi very much , very very very much , at least 3x.
Even I try to use PIXI.glCore directly to render texture (similar to http://dev.goodboydigital.com/client/goodboy/million/ , but no physics, no particles shader
), the igloojs
is still faster very much.
So I read the code , I found the biggest difference is that
igloojs
usedrawArrays(TRIANGLES...)
, and noindexBuffer
, I have to setthe 6 vert
manually.And I found use
drawArrays(gl.TRIANGLES...)
is faster thangl.drawElements(gl.TRIANGLES...)
.
Is indexBuffer
& drawElements
the hotspot of performance ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (5 by maintainers)
Top GitHub Comments
I refactor http://dev.goodboydigital.com/client/goodboy/million/ , create 2 new versions
with
drawElements
( 25 fps on my MacBookPro 2015) http://fatidol.com/million-bunnies/draw-elements.html(only support max 16384 sprites, Whatever set how many bunnies , it’s always less than 16384.)
with
drawArrays
( 40 fps on my MacBookPro 2015) http://fatidol.com/million-bunnies/draw-arrays.htmlYou could find
draw-arrays
is more fast thandraw-elements
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.