Setting Individual Particles / Setting Particles Manually

Hey guys,



So I have been trying to solve a problem with rendering hundreds of thousands of simple objects, and after a lot of trouble I am attempting to use particles.



I searched around and found this thread, which is close to what I want, but it never goes into much detail on how to accomplish the asked question: http://hub.jmonkeyengine.org/groups/effects/forum/topic/individual-particle-manipulation/



So even if I can create a new particle and then use particle.position.set(), how can I actually have it render in the scene? Simply doing rootNode.attachChild(particle) is giving me syntax errors, and creating a particle emitter to attach it to does not have an “attachChild” method for actually getting the particle in the scene.



Any help you could offer would be greatly appreciated.

Do you want your particles to move like particles?



Otherwise, just create a mesh with all of your “particles”… or batch separate geometries with the BatchNode.

Note: I just realized you are the same poster from the other thread.



Particles don’t have any magic GPU powers. They generate a big mesh just like everything else. If BatchNode is slow then particles will be just as slow.

@pspeed said:
Note: I just realized you are the same poster from the other thread.

Particles don't have any magic GPU powers. They generate a big mesh just like everything else. If BatchNode is slow then particles will be just as slow.


Well, I was thinking that rather than being a 6 faced cube it would be a simple sprite, which might have better performance.

But anyway, I'm really at a loss here. I really don't want to give up on this project, but I'm starting to wonder if what I want is even possible. :(

Did you try the JVM settings I recommended?



Point sprites would have better performance but they don’t require a particle system. Just make a point mesh and give it the point sprite material.



They always face the camera, though.

If your thinking a terrain like minecraft, then voxel is what your looking for.

I think you’ll find many examples here on jme forum about how to achive that.

@pspeed said:
Did you try the JVM settings I recommended?

Point sprites would have better performance but they don't require a particle system. Just make a point mesh and give it the point sprite material.

They always face the camera, though.


I'll take a look into point mesh with a point sprite material. The good thing is that facing the camera is actually the bahavior I want.

Edit: Yes, I tried the settings you recommended, but they only crashed my JVM at higher levels.

@Addez said:
If your thinking a terrain like minecraft, then voxel is what your looking for.
I think you'll find many examples here on jme forum about how to achive that.


Actually I'm not really trying to do anything like Minecraft. The difference is that I need anywhere from 500k-1Mill objects displayed on the screen at a time. It's kind of a virtual world where the player sees a visualization of each data point.
@anirak said:
Actually I'm not really trying to do anything like Minecraft. The difference is that I need anywhere from 500k-1Mill objects displayed on the screen at a time. It's kind of a virtual world where the player sees a visualization of each data point.

If that was so easy we'd see tons of games like this, don't you think? You will have to consider some "smoke and mirror" measures.

did you try http://hub.jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/spritelibrary-efficient-render-of-sprites/ ?