Jump to content

Sprite size & performance


ecv
 Share

Recommended Posts

@ivan.popelyshev is pretty hot on all things relating to performance, he might be able to give you a good answer.

As always though, with all things concerning performance get yourself a reproducible measured test case, preferably in-situ (i.e. if this is for a game, try to test it against your game code) and crack through the different options.

Link to comment
Share on other sites

1 minute ago, Fatalist said:

Actually I found out that texture size does matter, bigger texture is more expensive to draw, even when drawing the same number of pixels. But you can avoid that performance penalty by using mipmaps.

You mean like downscaling a big texture into a little sprite?  :huh:

No idea what mipmaps are yet.

 

Will a low-end device handle a non-moving fullscreen sprite animation (24fps), say at VGA or 800x600?

Although I think I'm realizing the pointlessness of this thread, as I've been told, probably profiling is the only valid take on this.

Link to comment
Share on other sites

19 minutes ago, ecv said:

You mean like downscaling a big texture into a little sprite?

Yes. If you were asking about drawing non-scaled sprites - then bigger is always slower to draw, 2x bigger sprite => ~2x slower to draw.

 

24 minutes ago, ecv said:

Will a low-end device handle a non-moving fullscreen sprite animation (24fps), say at VGA or 800x600?

BTW moving sprites around is almost free.

They can probably handle that, but download size is gonna be pretty large. For fullscreen animations it might be better to use video files.

 

 

Link to comment
Share on other sites

I am missing some context here, but if you are using WebGL, then you can generate a mip-chain and use mipmaps, and the size of the source image doesn't matter in terms of performance. However:

  1. Your source texture must be a power of two
  2. A full mip chain uses 33% more memory than just the source texture
  3. It takes longer to load that texture to start with
  4. If using a spritesheet, you have to be careful, there may be artefacts near the edges of each sprite at lower mip levels

If you use a 2d canvas as opposed to WebGL, the image filtering is way more expensive than the hardware-accelerated filtering that you get with WebGL. As a result it looks much nicer with fewer artefacts, but it's also a lot slower and the source texture size will make a big difference.

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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