COLOR PROBLEM with Particle Emitter

@Simone

You too should feel free to post a JSON file and image as a zip if you want.  I’ll look at either and try to give an answer.

** UPDATE **

@simone,

Looking at your sample, I think this line is wrong for that background:

"blendFuncDestination": 1,

I seem to remember StarCrunch posting a link (here in the forums) to a great document on blending modes.  I just can’t find it right now.

The Image: http://s4.postimg.org/qrhl3gvih/particle.png

The JSON (like above):

{ "emitterType": 0, "textureFileName": "particle.png", "startColorAlpha": 1, "startColorRed": 1, "startColorGreen": 0, "startColorBlue": 0, "finishColorAlpha": 1, "finishColorRed": 0, "finishColorGreen": 1, "finishColorBlue": 0, "startColorVarianceAlpha": 0, "startColorVarianceRed": 0, "startColorVarianceGreen": 0, "startColorVarianceBlue": 0, "finishColorVarianceAlpha": 0, "finishColorVarianceRed": 0, "finishColorVarianceBlue": 0, "finishColorVarianceGreen": 1, "startParticleSize": 25, "finishParticleSize": 45, "startParticleSizeVariance": 10, "finishParticleSizeVariance": 10, "speed": 200, "speedVariance": 100, "duration": 2.5, "particleLifespan": 10, "particleLifespanVariance": 10, "sourcePositionVariancex": 40, "sourcePositionVariancey": 40, "maxParticles": 100, "gravityx": 0, "gravityy": 400, "radialAcceleration": 0, "tangentialAcceleration": 10, "rotatePerSecond": 0, "rotationStart": 0, "rotationEnd": 0, "rotatePerSecondVariance": 0, "rotationEndVariance": 0, "rotationStartVariance": 360, "minRadius": 0, "maxRadius": 0, "minRadiusVariance": 0, "maxRadiusVariance": 0, "yCoordFlipped": -1, "radialAccelVariance": 0, "tangentialAccelVariance": 0, "angleVariance": 0, "angle": -90, "blendFuncSource": 770 , "blendFuncDestination": 1, }

See my update above.  

also…

I tried these settings and at least now I can see the particles:

"blendFuncSource": 0 , "blendFuncDestination": 769,

Of course, now they are the wrong color…

Yeah, the problem is definitely with your two blend filters (Source and Destination).  You need to select appropriate ones for a WHITE background.

I pinged Steven about this and hopefully I’m remembering correctly and he remembers the link to that blending dicussion.

  • Cheers.

Is it this one?

I thought I’d posted another link, but maybe I just remember following it off the Wikipedia link, which I’ve posted.

Yep… Porter/Duff.

Thanks!

Unfortunately, my memory was wrong.  While this is useful and awesome as a read, it isn’t directly applicable to the current blending issue.  Time to break out the ‘Blue Book’.

http://www.glprogramming.com/blue/ch05.html#id5452795

Thanks again Steven!

Thanks!