How to use point sprites in jme3?


Since I am new here in this forum, first of all: I really appreciate the great work and the progress here on this project! you definitely have my vote for the open source award :wink:

I am still a beginner, but i already managed to have some working applets with jme2, which i now try to port to jme3.

One problem is: I would like to use point sprites, and also change the size of the points in my vertex shader. In jme2, therefore i have overwriten the predraw()/postdraw() functions of the Point class and enabled/disabled the OpenGL capabilities GL_VERTEX_PROGRAM_POINT_SIZE and GL_POINT_SPRITE there, which worked fine.

how could i achieve this with jme3? Is there a good place to put OpenGL commands, or is this functionality implemented somehow already?

any help would be nice, thanks.

I am planning to add this feature to core.

It would work by using a new ParticleMesh type PointSprite. It will be possible to specify attenuation parameters and point sprite option in the RenderState for the renderer to use.

Lo and behold, 300,000 particles:

And this is running on my pathetic on-board 8400M GS :stuck_out_tongue:

I wouldn’t be surprised if my Radeon 5770 could reach particle counts in the millions.

By the way, this is done using point sprites, without CPU sorting.


I want to test that too!!


Thanks for your answers! It would be really nice to have this feature in core. PointSprites are really usefull and fun to play with sometimes! Right now it works when i enable the OpenGL capabilities in simpleInitApp(), but then the application hangs for some seconds before it starts (It is because of GL_VERTEX_PROGRAM_POINT_SIZE but i’m not sure why…)