Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 909
Minimi Avatar asked Nov 06 '16 00:11

Minimi


1 Answers

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

like image 176
Confused Avatar answered Oct 07 '22 10:10

Confused