Particles

I have a little problem with the "new" implementation of Particles System (until now i was using the 0.10). It seems that only half of a particle quad is drawn. I think only one of the two triangles is rendered…or is that a mapping problem?  :?

Besides,how can i avoid that "slow start" of ParticleMesh (which takes some times before running correctly) ?

that's an optimization, render only one triangle but map the texture so that it looks like a quad :wink:



like this! (ascii rules)



I

I

Incidently, I'm about to check in QuadBatch this week. That would pave the way for ParticleQuads.

GLQuad support is something I actually rolled back because it is a lot slower on some cards.  shrug  As for using 2 triangles instead of one, you still can by simply setting the type to PT_QUAD.  Sometimes due to fill, that can be more desireable than using a single triangle.  basically ymmv, so tailor to your own needs.

(adding to todo list: point sprite support)

Thanks for the answers.

I've tried to call the setParticleType(ParticleMesh.PT_QUAD) method,but particles are renderer in the same way as before,with only one visible triangle… Maybe i made a mistake somewhere?

As the javadoc states, you need to call recreate(particleCount) afterwards for it to take effect.

It seems to not work for me…



this.pMesh = ParticleFactory.buildParticles("ChiocciolaReactorParticles",200,ParticleGeometry.PT_QUAD);
this.pMesh.setParticleType(ParticleGeometry.PT_QUAD);
this.pMesh.recreate(200);
this.pMesh.setOriginOffset(new Vector3f(-36.5f,5.5f,0.0f));
this.pMesh.setEmissionDirection(new Vector3f(-1.0f,0.0f,0.0f));
this.pMesh.setMaximumAngle(0.3f);
this.pMesh.setSpeed(0.8f);
this.pMesh.setMinimumLifeTime(250.0f);
this.pMesh.setStartSize(4.0f);
this.pMesh.setEndSize(6.0f);
this.pMesh.setStartColor(new ColorRGBA(0.5f,1.0f,1.0f,1.0f));
this.pMesh.setEndColor(new ColorRGBA(0.0f,0.0f,1.0f,0.0f));
this.pMesh.getParticleController().setControlFlow(true);
this.pMesh.setReleaseRate(200);
this.pMesh.setReleaseVariance(1.0f);
this.pMesh.setInitialVelocity(0.2f);
this.pMesh.setParticleSpinSpeed(0.3f);
this.pMesh.warmUp(60);

I have found how to resolve my problem. Enabling CullState and set its mode to CS_BACK in order to cull back faces has caused this issue. I think the vertex of the second triangle are drawn in clockwise order,so it is considered a back face from the culling procedure. What do you think?

seems like that's true…any objections to changing that renanse?

No definitely not a problem.  Actually, let's change it to a strip instead of two triangles and save a little index buffer memory.  I'll look into that.

Erm, what am I thinking with the strip thing… nvmd!