PDA

View Full Version : Improve particle engine



cochondinde
02-07-2005, 11:42 PM
I'm trying to do a particle engine and I wonder how to improve it. I try to use billboard face instead of point sprite and to use some glVertex3f(..) but performance are not so good than I expected. If someone have some ideas to improve particle engine, it would be very helpfull.
(Sorry for my bad english... I'm french)

CrazyButcher
02-08-2005, 01:13 AM
use a vertexprogram/shader to create the billboards.
there is a sample+code at delphi3d.net about it.
use vertex arrays/vbos for the vertexdata.

cochondinde
02-08-2005, 04:08 AM
But if i use vbo, I had to change the value of all vertex each frame, so are sure it make the particle engine faster. I renember that I've made a test few month ago, and I haven't see the difference between using glVertex and using vbo.
For the shader (for billboarding), don't you think that using SSE instruction for computing billboarding??

SirKnight
02-08-2005, 09:54 AM
I haven't see the difference between using glVertex and using vbo.
And you won't unless you are using a large number of triangles. Keep in mind though that immediate mode (glBegin/End, glVertex, etc) is the slowest way to render and is pretty much only good for test purposes.

-SirKnight

Aeluned
02-08-2005, 10:40 AM
As your vertex data is changing each frame VBOs will perform no better than regular VARS (vertex arrays) since you're stuck with a data upload each frame.

Use VARS.

do not render hundreds or thousands or particles using glVertex. As SirKnight said, the only reason to ever use immediate mode like that is for testing or trivially simple stuff like rendering a bounding box.

zed
02-08-2005, 10:50 AM
the big killer of particle systems is usually heaps of overdraw of blended polygons, thus focusing on that is gonna typically help more than worrying about VBOs immediate etc
look into texture compression, different internal formats/formats, alpha testing on, maximizing used texture space per polygon etc

cochondinde
02-08-2005, 12:40 PM
So the best way is to use VARS and S3TC for texture? Ok, I will try to do so