PDA

View Full Version : change point size per VBO element



kfriddile
03-16-2009, 03:14 PM
I'm using a VBO to draw some textured point sprites for a particle system. Prior to switching to point sprites, this system was drawing textured particles as quads. This allowed each "particle" in the VBO to have a different size by simply building the quad from the particle's center and radius. This behavior has become relied upon, so I would like to preserve it while also reaping the benefits of using point sprites. Is there a way to do this without using shaders?

scratt
03-16-2009, 08:59 PM
AFAIK without shaders the only way is to have them attenuate themselves based on their position, which means setting that up in the FF pipe and then displaying them at different distances from the viewpoint to alter their size..

kfriddile
03-16-2009, 10:06 PM
AFAIK without shaders the only way is to have them attenuate themselves based on their position, which means setting that up in the FF pipe and then displaying them at different distances from the viewpoint to alter their size..

Ya, I had thought about trying that, but decided against point sprites for more reasons than the sizing problem. Namely the fact that on some implementations, points are clipped based on their center coordinate, and also I believe the iPhone has a very small maximum point size (32 I think). So I just used billboarded quads and everything is fine.

scratt
03-17-2009, 02:48 AM
On the iPhone that they are indeed clipped based on their center point.
I think that is standard on most implementations.

Here's some specs you might find handy..
http://www.glbenchmark.com/phonedetails.jsp?benchmark=pro&D=Apple%20iPhone&testgroup=gl

Brolingstanz
03-17-2009, 07:46 AM
If you must use point sprites there is a way to skirt the clipping problem, as described in pitfall (http://www.opengl.org/resources/features/KilgardTechniques/oglpitfall/) #10.

scratt
03-17-2009, 08:46 PM
You learn something new every day! :)