Question about official advanced rendering tutorial

Hi everyone,

I have just read this tutorial (Advanced Rendering Tutorial: Part 2 - Multi Texture Batching - Learn - Phaser) on how you can easily mess up performance in how you handle your sprites.

It says:

“[…how sprites have been] created in the display list the WebGL Sprite Batching is utterly unable to benefit from what it does. Remember that sprite batching needs consecutive sprites to share the same texture…Very often developers group the assets in their texture atlases based on the type of game element it is, rather than where it appears in the display list.”

So how exactly do I cause the order of the display list? Is it whenever I create an object with a texture (sprite, image, etc.) that this pushes the object onto the display list array?

If so, and in more practical terms, in the create function of a scene, should I load all objects ordered by their texture name?

If you don’t mind, please disregard Multi-Texturing for the moment.

Regards
Joe

I think the point is to optimize the texture atlases, not the display list :smile:
So try to group the atlas by what’s going to be on screen, instead of by asset type.
Let’s say you have all bosses in 1 atlas. That’s useless, since you are only ever going to use 1 per level…

1 Like

Yes.

Yes. And you should organize your spritesheets/atlases to allow this.