Jump to content

Particle containers inside a regular container


Sharpleaf
 Share

Recommended Posts

I have a few particle containers that I wanted to add a filter to. Now, I know that this can't be done, I've tried :) And I understand why you can't.

 

So, my solution was to take those particle containers and add them to a regular container and then add my displacement filter to the regular (parent) container. 

 

My question is: does this defeat the purpose of the using the particle containers in the first place (performance)? I don't know if this "undoes" what particles containers "do".

 

Thanks!

Link to comment
Share on other sites

What classes/libs are you using exactly?

 

Hi Ivan!!

I have 2 PIXI.ParticleContainer's inside 1 PIXI.Container

Just curious if throwing those 2 particle containers inside a regular container defeats the purpose if the performance gains of the particle containers.

 

Thanks!

Link to comment
Share on other sites

Hi Ivan!!

I have 2 PIXI.ParticleContainer's inside 1 PIXI.Container

Just curious if throwing those 2 particle containers inside a regular container defeats the purpose if the performance gains of the particle containers.

 

Thanks!

 

Hey Sharpleaf!

 

Ok, I read the code.

 

Regular container's renderWebGL method deals with filters and masks, and then calls render method of childrens.

Particle container renderWebGL calls his older brother ParticleRenderer which is tracking childrens parameters.

 

These two behaviours are so different , that its better to stack two objects inside each other than try to inherit it and make SuperParticleContainer. And it only costs one extra updateTransform() call, which does not affect the performance.

 

Ivan.

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