SOLVED - Issues with PNG transparency for a custom particle system

#1

Hello -

I am trying to use a PNG with transparency for a custom particle system but am having issues where I see the bonding boxes - even though I’ve tripled checked the alpha settings and I using ofEnableAlphaBlending();

Has it got something to do with 3D? Are ofImage only 2D?

The particle system here is a normal one but you can see the two PNGs are not intersecting correctly.

Any ideas?

THANKS, Rachel

#2

If you aren’t using any blend modes, the “easiest” fix is to sort your particles by Z position, then draw them starting with the farthest away from the camera. The system is drawing the transparent bits of the image over whatever’s behind it, overwriting the previous drawing.

There certainly might be a more elegant solution, but I’ve def had to do this in the past.

cheers!

#3

Thanks Nick. I ended up using these two lines of code and ALL IS WELL!!!

1 Like