setTexturePriority

Hello

By following this tutorial I try to optimize my game :

I followed all the steps, I am well in multiTexture in WebGL, but when I try to define the setTexturePriority, I have an error in my console:
this.game.renderer.setTexturePriority is not a function

In my Scene.js file :
create()
{
this.game.renderer.setTexturePriority([ ‘rooms-atlas’, ‘tiles’ ])
}

i tried this.renderer.setTexturePriority / this.textures.setTexturePriority but nothing to do.
Has the name of the method changed or been moved?

I am in Phaser 3.21.

Thank you

That tutorial is for Phaser 2 / CE. Phaser 3 does not support multi-texture batching.

Thank you for the answer.

Does that mean that phaser 3 has regressed on this point?

Or does he no longer need it because he has different solutions?

Personally, I’d say it whether it’s a regression depends on your needs. Multi-texture batching can sometimes be replaced by spritesheets or atlases. While it’s easier to use just multiple textures, on low-end devices the increased complexity of the shader can supposedly hurt performance instead of helping it. YMMV.

Anyhow, it’s best to avoid digging too deep into optimization unless you have a reason for it. If you do have performance issues, I’d start by first identifying the cause.

1 Like