Jonny Shaw

ParticleContainer & Particle blendModes

Recommended Posts

23 minutes ago, ivan.popelyshev said:

https://github.com/pixijs/pixi.js/blob/v4.x/src/particles/webgl/ParticleRenderer.js#L150

It works, but you have to specify one blendMode for all container, individual sprite blendModes are not important.

Brilliant thanks!  Guess that's what I must have been doing previously.

One thing with this effect though is I have two emitters, a fire and smoke effect, whereby only the fire needs add, so it wouldn't work in this case.

So do you think it would be better to have 2 particlecontainers with just the fire particlecontainer set to add or...

just use one normal container for both?

Share this post


Link to post
Share on other sites

Yeah, its possible but it requires some knowledge, and I wont make all the code for you because I don't need that functionality. If you succeed, then maybe i'll make PR to add that feature to pixi v5 :)

To use ADD at the same time as NORMAL, you have to either

1. bake alpha=0 to the texture (hard way)

2. change "tint" handling in ParticleRenderer that way it sets tint alpha to zero but leaves colors not changed.

 

Share this post


Link to post
Share on other sites
12 minutes ago, ivan.popelyshev said:

that's awesome thanks Ivan, will take a look at trying that out once this project is done, but might have to hold on for that one as I'm a bit behind already.

For the moment I can either have 1 normal container for both emitters, or use 2 particle containers for each with one set to add.  For now any idea on which of the two options may give better performance?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.