jrheard / voke

a roguelite in clojurescript
MIT License
32 stars 2 forks source link

pixi performance pass #45

Open jrheard opened 8 years ago

jrheard commented 8 years ago

advice from chad in gitter:

Note that things you draw within a single Graphics object are batched, but multiple graphics objects are not batched together are the rectangles uniform? because you can draw one, generate a texture, then create a bunch of sprites (one-per-rect) if the sprites share a texture they will be batched http://pixijs.download/v4.1.1/docs/PIXI.WebGLRenderer.html#generateTexture if you have many different shapes you can draw them to a canvas, use the canvas as a texture "spritesheet" and then make all the sprites you need and since they all share 1 base texture (the canvas) it will batch