int particlesat = 0;
for( int j = 0; j < 100; ++j )
{
glTexCoord(0,particlesat);
i += 10;
}
And using alpha blending of course. Is that a decent way to do it? What other ways are there?
Particles?
At the moment I just draw loads of GL_POINTS as "particles"
The thing is, after only 5000 points or so the frame rate drops dramatically. Now I was wondering how games etc manage to do more of them faster.
I had an idea, being loading a very long texture, 10 pixels high for example. Then I would have each 10*10 square represent a particle state that follows each other, such that I could go through the texture, using coords to make it "loop". Like
There is an example of a particle engine on the Nehe site, It runs resonably fast, and its good code, apparently.
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=19
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=19
Yea, I am not sure what you are saying about the points, but I will tell you that particle systems usually (if not always) use textured polygons.
He means rendering using GL_POINT. With glPointSize you can set the size of the point and with GL_ARB_point_parameters you can define dynamic distance attenuation. I've done it before and with a very high particle count (possibly impractically so) and keeping the camera far enough away, it doesn't look too bad.
EDIT: It might help us to help you if you posted some more information on how you store and render your particles and what video card and CPU you are using. . . With my particle generator on a Radeon 9700 Pro and Athlon XP 2100 I can render 220000 point particles and still get 20 frames per second. With textured quads I can manage 80000 particles at 20 fps. This is all with blending enabled, too.
[edited by - Ostsol on November 30, 2003 1:26:18 AM]
EDIT: It might help us to help you if you posted some more information on how you store and render your particles and what video card and CPU you are using. . . With my particle generator on a Radeon 9700 Pro and Athlon XP 2100 I can render 220000 point particles and still get 20 frames per second. With textured quads I can manage 80000 particles at 20 fps. This is all with blending enabled, too.
[edited by - Ostsol on November 30, 2003 1:26:18 AM]
Theres other stuff going on too, but 170 fps with 50000 particles (Radeon 9700pro, amd xp 2500+(at the speed of a 3200+)), but when I do 500 000 particles, which starts to look ok, it goes down to 39 fps. I''m using vbos if available, otherwise vertex arrays. I guess I''ll try using textured "particles" and see if it looks better
Use textured quads for your particles. A nice, prerendered dot texture makes a great particle. There are a lot of advantages to using textured polygons instead of points for your particles, but probably the one most relevant to your question is that you can select a texture that has an image of multiple particles in it, so it looks like you''re drawing more particles than you actually are.
Textured quads are the way to go. Speed and they should look better due to you can render a sphere or whatever you''re looking for with Photoshop to the texture.
If your hardware supports them...check out Point Sprites, these could potentially be faster than textured quads, I think there''s a tut on GameDev somewhere about them, have a look in the articles & resources perhaps.
GCoder
GCoder
Point Sprites might be good if you don''t need alot of control over them. If you need any kind of rotating or nonuniform scaling you can just forget about them.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement