Another particle problem – black artifacts

When my firaball is colliding with anything else in the world, another particle emitter will be created at location of fireball, as an explosion.



Well, when i put it to the test, when the new particle system will be created, things dont work out as they should. They whole screen fills up with black artifacts. Any Idea why this is happening?



Notice, fireball emittes from the turtle, when it collides near the rabbit, the whole screen just goes crazy.



http://www.youtube.com/watch?v=IKfyfsTPa4Q



the code in the collision method is



[java] if (“fireball”.equals(event.getNodeA().getName()) || “fireball”.equals(event.getNodeB().getName()))

{

ParticleEmitter flame = new ParticleEmitter(“Flame”, Type.Triangle, 32);

Vector3f location = “fireball”.equals(event.getNodeA().getName()) ? event.getNodeA().getLocalTranslation() : event.getNodeB().getLocalTranslation();

flame.setLocalTranslation(location);

// flame.setSelectRandomImage(true);

flame.setImagesX(2);

flame.setImagesY(2);

flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, 1));

flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f));

flame.setStartSize(1.3f);

flame.setEndSize(2f);

// flame.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));

flame.setParticlesPerSec(0);

flame.setGravity(-5f);

flame.setLowLife(.4f);

flame.setHighLife(.5f);

flame.setInitialVelocity(new Vector3f(0, 2, 0));

flame.setVelocityVariation(.2f);

Material flame_mat = new Material(assetManager, “Common/MatDefs/Misc/Particle.j3md”);

flame_mat.setTexture(“Texture”, assetManager.loadTexture(“Effects/Explosion/flame.png”));

// flame_mat.setBoolean(“PointSprite”, true);

flame.setMaterial(flame_mat);

chapter1.attachChild(flame);

flame.emitAllParticles();

}

[/java]



the animation isn’t synchronized with the spawn time of fireball, i cannt speed up the animation because of jME issue. I reported it here

http://hub.jmonkeyengine.org/groups/features/forum/topic/speed-up-animation/

erf i think the problem comes from depth writing…

I’ll look into that

let me know if u need test case :slight_smile: