SKEmitterNode how to maintain same effect with blend mode "add" across different backgrounds
Asked Answered
U

1

6

I have a really cool effect that I like that I made using sks files in xcode and the blend mode 'add'. Now I didn't realize it at the time but after looking at the apple docs I saw that the effect is actually based off the background color, specifically:

Adds the pixel values of the particle and underlying images. Creates a white pixel if this value is greater than 1

Now, I want to have the same effect across every different background color but as far as I know the only way to do that is to use the "Alpha" blend effect. But this only gives me the option of having solid colors. This is the graphics that I want to apply across all different background colors:

enter image description here

How can I go about having this effect across all different background colors? I'm using the default spark particle file.

UPDATE:

I'm leaving this question unanswered until either apple comes up with a way to do what I want or someone else finds a way to do it.

Unthrone answered 6/11, 2016 at 0:29 Comment(0)
C
2

Due to the unique nature of particle systems AND the very limited masking facilities of SpriteKit, I don't think this can be done.

Availability of inversion masking, in an unnested way that's not the clusterfuck of masking in SpriteKit as we currently know it, would instantly solve this problem.

The way to do this, ordinarily without inversion masking, would be to have two instances of the exact same particle system, one acting as a mask to cut out the excess black, one the visual elements you see over the black, that's then composited (as a whole) over your background.

Here's KnightOfDragon suffering with the individuality of particle systems for another use case: Duplicating a particle emitter effect in Sprite Kit

Carlisle answered 6/11, 2016 at 3:4 Comment(5)
Are you sure there isn't a way? I don't see what the purpose of the 'add' effect is, if the particle effect changes based off the background. Seems entirely pointless to have this blend mode. If I could replicate the exact same particle emitter, add it behind it with a black color like you said, that would be perfect. I don't know how to do that though, im not even sure if it's possible. it would have to spawn the same particles in the same positions but be a different emitter with a different color.Unthrone
Yes, the last part of your comment explains the problem perfectly. This is an issue that's the result of something else, that of not having good masking in SpriteKit, something I've been fidgeting around in my last few questions on here. Either replicable particle systems or proper (and full) masking systems would solve this problem. Of the two, proper (and full) masking is the much more useful. The sad part is Apple seems to have begun work on it: #40436547 if we could get at this invert, done!Carlisle
And, as to Additive blending not being useful, wash your mouth out with soap, young man! Additive blending is the single best blend mode on earth! When you begin working with particles more often, you'll find it's absolutely amazing. In the meantime, and until Apple gives us inversion masking, make sure you create all your particle systems over realistic portrayals of your game scenes, so that they match and work with the colours and themes of your levels. Particles and additive blending are like peanut butter and jam, born to go together.Carlisle
Is there any other way I can do this? Maybe without SpriteKit and with some other framework?Unthrone
You could use Unreal Engine. It has AMAZING particles, blend techniques and masking abilities. But will involve changing your life. The best and fastest way to get the result you want is to start again, with the SK Particle Editor, and a background representative of your game, to get it as good as you can. You'll need more particles, too, to get this level of vibrance on a background that's not black.Carlisle

© 2022 - 2024 — McMap. All rights reserved.