Jonny Shaw Posted January 29, 2019 Share Posted January 29, 2019 Hi, I've just noticed that the ParticleContainer doesn't seem to support blendModes. I thought previously it had worked when the tint property had been set to true, but may have imagined it. This still a current limitation? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 29, 2019 Share Posted January 29, 2019 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. Jonny Shaw 1 Quote Link to comment Share on other sites More sharing options...
Jonny Shaw Posted January 29, 2019 Author Share Posted January 29, 2019 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? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 29, 2019 Share Posted January 29, 2019 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 29, 2019 Share Posted January 29, 2019 Here's the line you have to change: https://github.com/pixijs/pixi.js/blob/v4.x/src/particles/webgl/ParticleRenderer.js#L430 Good luck! Quote Link to comment Share on other sites More sharing options...
Jonny Shaw Posted January 29, 2019 Author Share Posted January 29, 2019 12 minutes ago, ivan.popelyshev said: Here's the line you have to change: https://github.com/pixijs/pixi.js/blob/v4.x/src/particles/webgl/ParticleRenderer.js#L430 Good luck! 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? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 29, 2019 Share Posted January 29, 2019 I have no idea. Theoretically, its the same. Jonny Shaw 1 Quote Link to comment Share on other sites More sharing options...
Jonny Shaw Posted January 29, 2019 Author Share Posted January 29, 2019 Just now, ivan.popelyshev said: I have no idea. Theoretically, its the same. perfect thanks, will stick to Container for now then, and try the other approach if I see any drops Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.