Jump to content

Is scaling an image an expensive process?


Travis
 Share

Recommended Posts

The difference is probably negligible on a hardware-accelerated canvas/WebGL. The larger image will use more memory though, and the 1px image might have stretch artefacts (e.g. a gradient style edge). Generally there are much more important performance issues to worry about. Also on some systems it will take the CPU longer to issue the draw call to the GPU than it takes the GPU to complete the actual rendering.

Link to comment
Share on other sites

I think my original answer might be wrong when it comes to mobile actually! Some mobile devices have a very limited fill rate, and can only write every pixel on-screen 3-5 times a frame and still get 30 FPS. Usually you have to have at least one clear/background image every frame which doesn't leave you with very much. A sprite resized very large will use lots more fill rate than a small one. So you should probably avoid having lots of very large sprites on mobile.

 

On desktop generally the GPUs can be so ridiculously powerful that the time it takes for the CPU to tell the GPU what to draw is longer than the time it takes the GPU to draw it, so there genuinely is no 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...