Author Topic: is point sprite supported?  (Read 2337 times)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
is point sprite supported?
« on: April 15, 2020, 11:10:57 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: is point sprite supported?
« Reply #1 on: April 22, 2020, 09:08:09 am »
I've no plans to support this. It would require a whole new data structure to support points instead of polygonal objects.

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: is point sprite supported?
« Reply #2 on: April 23, 2020, 05:06:26 am »
what about the point mode in drawWireframe() ?
the object is still made of polygons, but only points are rendered.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: is point sprite supported?
« Reply #3 on: April 23, 2020, 08:57:27 am »
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.

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: is point sprite supported?
« Reply #4 on: April 23, 2020, 11:52:58 pm »
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.