I've just been adding particle effects for flames and smoke coming from damaged planes in my game, and while it looks rather nice :), it has a couple of issues:
- I need to control the particle release rate, so that I can switch the flames/smoke off and on, and alter intensity. However, sometimes when I use controlFlow, and set the releaseRate to 0, my game slows down and stops over a few frames. It seems like some delay builds up exponentially until the game pretty much freezes. If I have a high or default release rate, or don't use controlFlow, this never seems to happen. I did think that it only happened with releaseRate at 0, but releaseRate 1 will sometimes do it as well. Using warmUp sometimes seems to help a little, but I really need a complete fix so it won't kill my game
- I'm using subtractive blending for smoke:
smokeAlphaState.setSrcFunction(AlphaState.SB_ZERO);
smokeAlphaState.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_COLOR);
When the particles are a long distance away, they appear as squares rather than the roughly circular blob texture I'm using. At extreme distance, they no longer fade out according to the endColor, they stay pretty much opaque until they disappear. Things look fine up close, then "blend" to the opaque squares as distance increases.
The "turning into squares" thing looks a lot like mipmapping, but I have tried to disable this on the TextureState applied to the ParticleMesh:
texture.setMipmapState(Texture.MM_NONE);
textureState.setTexture(texture);
This doesn't seem to make any difference, and mipmapping doesn't explain the alpha problem either.
You can see the effect in this screenshot (just a small region of 1024x768 screen):
The particles at the end of the trails should be nearly transparent (when you see them in motion, they very obviously just "blink" out rather than fading) and should still look like little fluffy blobs.
The particles should look like this: https://aircarrier.dev.java.net/nonav/images/flamesScreenShot.jpg at all ranges (screenshot from closer to the particles)