Display Lists/VBO/Point Sprites

Started by
3 comments, last by zedz 16 years ago
Currently I'm using immediate mode for everything, all are rendered quads in my game. Since I'm in 2D ortho mode, the most quads I will ever draw will be about 5,000 on the scene at once. I'm undecided if I should go ahead and switch everything into Display Lists or VBO's, and switch all my particles into point sprites. For instance, your normal scene during game play you will see about 100 quads. 100 quads is nothing, and it won't make any difference what method im using to draw them. I'm just wondering if I should take the time to do this, when the performance difference won't be seen unless someone is trying to play on a 500mhz computer :/. The only calls I make are pretty much transform and rotate. And sometimes a glscale (zooming or explosions etc). and are point sprites a good way to do explosions? (movement, scaling, rotating) Should I just do it, or am I wasting time?
Black Sky A Star Control 2/Elite like game
Advertisement
I don't think you will get a performance boost if that is what you mean because 5000 quads means 20000 vertices, which is nothing at all for the GPU.
The advantage of using VBO or display list is that you make less functions calls so it reduces CPU usage.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
btw, forget about display list, vbo is far more "openGL 3.0 friendly".

Instead of quads or point sprites, you can use instancing. Google for "gl_InstanceID" (the last time I tried I could not make it work...)
Well, if you draw 5000 quads in a frame, you'd need 20000+ OGL calls. If you moved this to VBO you'd get some advantages:
- vertex data is stored in video memory, i.e. it doesn't have to be passed over the bus every frame if it doesn't change
- the vertex data is compiled already and thus can be reused (if it doesn't change)

As a side note, if your transformations don't change that often you could calculate the transformation matrix once and provide this to OGL instead of recalculating it every frame.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
even slow (<500mhz) computers can handle 5000 quads with immediate mode easily
but if u say theres only gonna be 100 visable at once then even more so, u will see no difference by changing over the DL or VBO

This topic is closed to new replies.

Advertisement