Jump to content

Using different textures or scaling?


Recommended Posts

I've read about performance issues if you try and scale all your assets on the fly, but what about texture packer's scale option? I'm guessing it just scales the entire atlas before the game begins so there's no performance issues after the preload, is that correct?

As of now I'm using different atlas's based on the pixel ratio. But if the pixel ratio is something like 1.5, then this solution wouldn't work. Any tips on the most performant way?

if(window.devicePixelRatio >= 3) {
  this.game.load.atlasJSONHash('testAtlas2', 'testAtlas2.png', 'testAtlas2.json');
} else if(window.devicePixelRatio >= 2) {
  this.game.load.atlasJSONHash('testAtlas', 'testAtlas.png', 'testAtlas.json');
Link to comment
Share on other sites

55 minutes ago, drhayes said:

Are you seeing measurable performance issues that you're trying to correct?

Nope, with the scale of the game I'm making now, anything would work without performance issues. I'm just wondering what the most performant way is since I'm focusing on mobile. I'm trying learn how to optimize everything while the scope of my project is small, so I don't run into too many problems in my future projects.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...