View Full Version : A Simple Speed Trick for a Particle Engine...
06-23-2001, 04:13 PM
It just came to me that NeHe's particle engine uses 2 triangles for every particle. Why? Why not use just a single triangle for every particle? You would need to modify the texture a bit, but thats trivial. Wouldnt this give you roughly double the performance since you need to render only half the triangle for the same number of particles.
It would help if you are geometry limited but not fill rate limited.
06-23-2001, 09:27 PM
Well, I just tried it out and for just a scene with a particle engine it is around twice as fast...
06-24-2001, 05:24 AM
I was just thinking about this the other night. After it seems my VIA chipset is doomed to have terrible sys mem -> AGP mem writes.
Not only would it speed stuff up, but will reduce the number of vertices, and indices (if draw in indexed mode) by 1 quarter. Saving memory is good.. http://www.opengl.org/discussion_boards/ubb/smile.gif
Actually come to think of it, my current billboard demo draws using the GL_QUADS primitive. And I'm using indexed vertices. Considering ever vertex is unique, would it be faster to use glDrawArrays instead of glDrawElements, and not use any indices?
06-24-2001, 07:35 AM
when i wrote my partcle system i used a different triangle for each particle, should i change it?
06-24-2001, 08:21 AM
Just want to point out that this is not always a good idea. Notice what j said. This is good if you are geometry limited but not fillrate limited. In fact a close examination of the technique reveals that it requires at best twice the fillrate (I worked it out with Maple). And if you don't use an appropriate triangle the fillrate demands can literally explode.
06-24-2001, 10:22 PM
I dont see how using triangles instead of Quads can possibly slow a program down...
Also, the fillrate comes into play if the particle system is close to the screen and thereby takes up alot of pixels. If it is in the distance the fillrate requirements are lower.
with tris fillrate is always gonna be higher no matter if the particles are near or far, unless of course your particles are triangles
>>Considering ever vertex is unique, would it be faster to use glDrawArrays instead of glDrawElements, and not use any indices?<<
definitly if you can do drawarrays instead of elements use it it is defintly faster.
06-25-2001, 04:11 AM
I belive Q3 used triangles for atleast some of their particles.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.