Alpha issue with Pex Particle Editor

I’m running into the issue that’s described in this thread: https://forums.coronalabs.com/topic/56041-color-problem-with-particle-emitter/

I created a particle emitter in Roaming Gamer’s pex editor and I want my particles to be completely opaque without any color variance because I plan to use an already colored particle image (the effect I’m going for is a wooden crate breaking apart).

After reading that thread, I can’t figure out if they actually solved their issue. I tried messing with the default background color and different blend functions, but what seems to look fine in the pex editor still comes out transparent in my own app.

Frankly, the links that Roaming Gamer posted in that thread are a little above my head. If anyone can post the settings necessary for my desired effect I’d be grateful.

Here is my .rg file

{ "configName": "dummy", "minRadius": 0, "maxRadius": 159.69, "duration": 0.2, "tangentialAcceleration": 0, "emitterType": 0, "radialAcceleration": 0, "startColorVarianceAlpha": 0, "speed": 118, "angle": 270.02, "finishColorRed": 1, "startColorVarianceBlue": 0, "startParticleSize": 80, "angleVariance": 129.68, "rotationEnd": 131.94, "startColorBlue": 1, "yCoordFlipped": 1, "textureFileName": "cratebreak\_particle.png", "\_locked": false, "startColorVarianceGreen": 0, "finishColorVarianceRed": 0, "\_brushNum": 21, "gravityy": 531.94, "rotationEndVariance": 0, "speedVariance": 0, "finishParticleSizeVariance": 0, "finishColorVarianceAlpha": 0, "minRadiusVariance": 0, "maxParticles": 1, "rotationStartVariance": 29.97, "maxRadiusVariance": 205.76, "startParticleSizeVariance": 0, "startColorVarianceRed": 0, "rotatePerSecond": -2.09, "tangentialAccelVariance": 0, "finishColorVarianceGreen": 0, "finishColorVarianceBlue": 0, "particleLifespan": 0.05, "radialAccelVariance": 0, "finishColorGreen": 1, "particleLifespanVariance": 4.36, "blendFuncSource": 770, "sourcePositionVariancey": 0, "startColorAlpha": 1, "blendFuncDestination": 770, "rotationStart": 0, "finishColorBlue": 1, "finishParticleSize": 70, "rotatePerSecondVariance": 0, "gravityx": 0, "startColorRed": 1, "sourcePositionVariancex": 0, "startColorGreen": 1, "finishColorAlpha": 1 }

This is the sample image that I’m using

Ok so after A LOT of trial and error I figured it out. It definitely had to do with the blend modes. I don’t really understand what each setting means but after plugging in a bunch of different numbers found at this link: http://docs.factorcode.org/search?search=Gl_ONE I finally found a combination that worked for me.

I realized that particles had their full alpha in the pex editor because the background is completely black. Once you have a different colored background the blend modes cause the image to get masked/lightened/darkend (similar to using multiply/darken/burn effects in photoshop).

So in my case, for a completely opaque image with correct colors on a non-black background, I had to use the following blend settings:

“blendFuncSource”: 1,
“blendFuncDestination”: 771

Also, for anyone wondering - this is how the completed effect turned out. Each piece of the crate is a separate particle emitter. The final rg file is below too.

v0DHODy.gif

{ "configName": "dummy", "minRadius": 0, "maxRadius": 57.07, "maxRadiusVariance": 205.76, "tangentialAcceleration": 0, "emitterType": 0, "radialAcceleration": 0, "startColorVarianceAlpha": 0, "speed": 250, "maxParticles": 42, "finishColorRed": 1, "minRadiusVariance": 0, "startParticleSize": 80, "angleVariance": 20.36, "rotationEnd": 147.02, "startColorBlue": 1, "yCoordFlipped": 1, "textureFileName": "cratebreak1\_particle.png", "\_locked": false, "startColorVarianceGreen": 0, "finishColorVarianceRed": 0, "\_brushNum": 42, "gravityy": 800.57, "startParticleSizeVariance": 0, "speedVariance": 0, "finishParticleSizeVariance": 0, "finishColorVarianceAlpha": 0, "startColorVarianceBlue": 0, "angle": 270.09, "rotationStartVariance": 28.08, "duration": 0.05, "rotationEndVariance": 486.28, "startColorVarianceRed": 0, "tangentialAccelVariance": 0, "rotatePerSecond": 10, "finishColorVarianceGreen": 0, "finishColorVarianceBlue": 0, "particleLifespan": 2.10, "radialAccelVariance": 0, "finishColorGreen": 1, "particleLifespanVariance": 0, "blendFuncSource": 1, "sourcePositionVariancey": 0, "startColorAlpha": 1, "blendFuncDestination": 771, "rotationStart": 0, "finishColorBlue": 1, "finishParticleSize": 70, "rotatePerSecondVariance": 0, "gravityx": 0, "startColorRed": 1, "sourcePositionVariancex": 0, "startColorGreen": 1, "finishColorAlpha": 1 }

Hey man, I was actually having this same issue and this fixed it! (though it doesn’t necessarily answer my question completely) Thank you for posting your solution! I pointed my post towards yours in case someone sees it in the future.

https://forums.coronalabs.com/topic/63221-full-parameter-list-for-emitterobject/?hl=particle

Also, your game looks really cool!  :smiley:

Hey thanks! I wish I could offer a better explanation for what the different blend functions do, but I just had to plug in different values until I found something that worked. Not very efficient if you ask me lol.

Btw, as a particle editor I used Pex Editor from Roaming Gamer. Unfortunately it seems he’s not offering it for sale anymore but I remember paying like $3 for it. It was really just a Corona app. You can probably make your own with sliders to adjust the different values and output the json table. Good luck!

Ok so after A LOT of trial and error I figured it out. It definitely had to do with the blend modes. I don’t really understand what each setting means but after plugging in a bunch of different numbers found at this link: http://docs.factorcode.org/search?search=Gl_ONE I finally found a combination that worked for me.

I realized that particles had their full alpha in the pex editor because the background is completely black. Once you have a different colored background the blend modes cause the image to get masked/lightened/darkend (similar to using multiply/darken/burn effects in photoshop).

So in my case, for a completely opaque image with correct colors on a non-black background, I had to use the following blend settings:

“blendFuncSource”: 1,
“blendFuncDestination”: 771

Also, for anyone wondering - this is how the completed effect turned out. Each piece of the crate is a separate particle emitter. The final rg file is below too.

v0DHODy.gif

{ "configName": "dummy", "minRadius": 0, "maxRadius": 57.07, "maxRadiusVariance": 205.76, "tangentialAcceleration": 0, "emitterType": 0, "radialAcceleration": 0, "startColorVarianceAlpha": 0, "speed": 250, "maxParticles": 42, "finishColorRed": 1, "minRadiusVariance": 0, "startParticleSize": 80, "angleVariance": 20.36, "rotationEnd": 147.02, "startColorBlue": 1, "yCoordFlipped": 1, "textureFileName": "cratebreak1\_particle.png", "\_locked": false, "startColorVarianceGreen": 0, "finishColorVarianceRed": 0, "\_brushNum": 42, "gravityy": 800.57, "startParticleSizeVariance": 0, "speedVariance": 0, "finishParticleSizeVariance": 0, "finishColorVarianceAlpha": 0, "startColorVarianceBlue": 0, "angle": 270.09, "rotationStartVariance": 28.08, "duration": 0.05, "rotationEndVariance": 486.28, "startColorVarianceRed": 0, "tangentialAccelVariance": 0, "rotatePerSecond": 10, "finishColorVarianceGreen": 0, "finishColorVarianceBlue": 0, "particleLifespan": 2.10, "radialAccelVariance": 0, "finishColorGreen": 1, "particleLifespanVariance": 0, "blendFuncSource": 1, "sourcePositionVariancey": 0, "startColorAlpha": 1, "blendFuncDestination": 771, "rotationStart": 0, "finishColorBlue": 1, "finishParticleSize": 70, "rotatePerSecondVariance": 0, "gravityx": 0, "startColorRed": 1, "sourcePositionVariancex": 0, "startColorGreen": 1, "finishColorAlpha": 1 }

Hey man, I was actually having this same issue and this fixed it! (though it doesn’t necessarily answer my question completely) Thank you for posting your solution! I pointed my post towards yours in case someone sees it in the future.

https://forums.coronalabs.com/topic/63221-full-parameter-list-for-emitterobject/?hl=particle

Also, your game looks really cool!  :smiley:

Hey thanks! I wish I could offer a better explanation for what the different blend functions do, but I just had to plug in different values until I found something that worked. Not very efficient if you ask me lol.

Btw, as a particle editor I used Pex Editor from Roaming Gamer. Unfortunately it seems he’s not offering it for sale anymore but I remember paying like $3 for it. It was really just a Corona app. You can probably make your own with sliders to adjust the different values and output the json table. Good luck!