Hi,
I suspect that each particle is an instance of Geometry then? This is very costly.
What you could try instead: Batch all particles in a single Geometry/Mesh (like the build-in particle effect is doing it) and encode the opacity as a per-vertex color (add a new VertexBuffer to your Mesh). This will probably require a modification of the particle shader, but is much cheaper in memory and speed.
If you look at JME’s particle emitter you will note that it can handle per particle opacity just fine by building it into the mesh.
A Geometry per particle is horribly inefficient… whether you shove them under a batch node or not. It’s going to be much better to manage your own Mesh and batch things yourself… like the JME ParticleEmitter does (or any of its offshoots).
What are your particles and why does the stock emitter not work for you?
VertexBuffer documentation is maybe not exaustive on the wiki?
I’ve tried with this:
pEffect.getMesh().setBuffer(VertexBuffer.Type.Color, 4, new float[]{.5f,.6f,.8f,1f});
And got:
java.lang.UnsupportedOperationException: The buffer already set is incompatible with the given parameters
at com.jme3.scene.Mesh.setBuffer(Mesh.java:1051)
at com.jme3.scene.Mesh.setBuffer(Mesh.java:1071)
at com.jme3.scene.Mesh.setBuffer(Mesh.java:1075)
Something already set the buffer… find out what it is and what it set it to (some things use color for other purposes since JME doesn’t let one define custom buffers).