is point sprite supported?

Started by MichaelJPCT, April 15, 2020, 11:10:57 AM

Previous topic - Next topic

MichaelJPCT

i read that point sprite can make high performance particle system, and gl es 2.0 has point sprite too. can jpct-ae support it?

EgonOlsen

I've no plans to support this. It would require a whole new data structure to support points instead of polygonal objects.

MichaelJPCT

what about the point mode in drawWireframe() ?
the object is still made of polygons, but only points are rendered.

EgonOlsen

It doesn't make much sense to use an Object3D for a particle system. I tried that, it didn't really work out as good as I hoped. It's better to use a single, billboarded object per particle. That's not highly efficient, but as long as you don't want to use particles extensively, it should be fine. At least that's what I'm doing and once I had it working, I never spent a second thought about it, because it was just fine IMHO.

MichaelJPCT

i have tried using an object3d to hold 100 particles (my cloud effect) , using shader/uniform to locate every particle.
in this method, jpct doesn't need to sort all particles, only sort the object3d in a World. when particles within an object3d are close to each other, and the scene is not too complex, this method doesn't often cause sorting error, and it  saves sorting time, 1 vs 100(or 20 vs 2000) candidates to sort in my case, that should be quite some time.
imagine i want a particle emitter with varying quantity of particles, sometimes a few, sometimes 500 particles, adding/removing them as individual object3d, or only setting visibility while keeping them in a World,  not something i would prefer to do.
if they are only 1 object3d, i can use shader to easily make some of them disappear.
and 500 draw calls cost much more time than 1 drawcall.
so these are the benefits of using object3d like an emitter. not always good, but in some case, it's very good.
in my scene, there are often 20 clouds (2000 particles) on screen , my app runs 30fps without problem if they all look small on screen. test device has quadcore A53 which is low-end device now.
using quads can do it, but point sprites can save calculation.