Jump to content

Separate canvas for background image.


opd
 Share

Recommended Posts

Hi,

I'm finishing up my first Pixi project and am thinking about performance.  

I'm using the PIXI.Application class which creates the canvas, renderer, ticker and then updates the canvas every frame.  As I understand it, this means that the whole canvas gets redrawn every frame.

Would it be a good idea to put the background image into a separate canvas below the app, so it doesn't have to be redrawn each time? 

Also, is it best practice to manually handle updating the canvas and to only redraw the parts that change?

Link to comment
Share on other sites

For older mobiles - yes.

is it best practice to manually handle updating the canvas and to only redraw the parts that change?

Only if you have many filters and you know how to use renderTexture to cache those parts. Otherwise, its very bothersome. Also, there's no guarantee that canvas contents are preserved between frames, so trying to update only certain regions will certainly fail in webgl.

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