Jump to content

[Static and Moving Textures] - Best practice


IncToast
 Share

Recommended Posts

Hi,

I wonder what would be the best choice to manage multiple layers  (some are mainly static, some are moving each frame). The layers are in fact the z index. Each layer contains approximatly 1k to 2k textures

Example :

  1. [Z index 0] Background (Static)
  2. [Z index 1] Elements (Moving)
  3. [Z index 3] Foreground (Static)
  4. [Z index 4] Elements (Moving)
  5. ... more and more



I have two options but can't find exactly which one would be the best. The goal is to be the most efficient for the client rendering action. I'm pretty new to Pixi and i maybe missed a magic component for my need ?

  • Solution 1 :  Each z index is on a container and the stage renders all containers each frame
  • Solution 2 : Manage multiple canvas and each canvas refers to a specific z index. Only edited stages are rendered each frame
  • Solution 3 : Any other solution ? ?

 

Thank you

Link to comment
Share on other sites

Solution 2, separating to two-three canvases and updating only moved ones, using css-translate on background helps for very old mobile devices that have problem with layering < 2014 year.

Texture size is not important at all, what is important - how many pixels are you filling (including those several times)? :) That's the bottleneck.

Edited by ivan.popelyshev
Link to comment
Share on other sites

2 hours ago, ivan.popelyshev said:

Solution 2, separating to two-three canvases [...]

Thanks for the answer. If i'm right :               X canvas means X PIXI.App ??

_______________________________________________________________________________

1 hour ago, ivan.popelyshev said:

I know its difficult to "draw the rest of the hecking owl", [...]

Wow, thank you VM for this huge example. I have never heard anything about PIXI.Runners. They look insane. It requires me to modify my global algorythm, but will for sure give me better comprehension of the code.
I have a question about PIXI.runners. It says "A Runner is a highly performant and simple alternative to signals". 

How do they really work in an app. Are they something like WebWorkers ? How are they so "highly performant" ?

Edited by IncToast
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...