Nearby particles fighting

Greetings all!

We have a minor issue with the particles that I’m trying to clean up; I could use any advice people can provide.

We have two particle effects (smoke and fire) that work very closely together, but can be controlled by our users independently (hence, two effects). The issue we run into is that when we put the two effects at the same origin, we don’t get the render behavior we expect. We would have expected the particles to interleave (and thus the smoke to dominate the fire, since the smoke’s emitter is wider). Instead, on any given frame the effects ‘pop’ against each other: Either all the smoke is drawn atop all the fire, or all the fire is drawn atop all the smoke.

Does anyone have any suggestions as to what would cause this? Does the render traversal algorithm do all the particles in a given effect at once, or are all particles interleaved and then rendered back-to-front? If the former, is there any way to change this behavior?

One solution we’ve been attacking is using bins to force smoke to always render after fire. This has been working, but we run into a problem with transparent objects occluding the particle effects when the effects should be visible through the objects.

Thank you for your help!


Right, each particle group is rendered separately. This allows all of the smoke particles to be rendered in a single call, followed by a single call to render all of the fire particles. It isn’t really feasible to sort the individual particles back-to-front and render them in individual particle order; that would mean several thousand calls (one for each particle) instead of just two.

You’ll have to find solutions such as playing with the bins, as you describe. One obvious possibility is to displace the smoke effect away from the camera so that it is always slightly in front of the fire effect. You can use a billboard to do this effectively. For instance: smoke.setBillboardAxis(); smoke.setY(-5)