Skip to main content
gamedev.net
🔒 Locked

speed...

Started by PatrickD 5 replies 450+ views
Original Post
PatrickD
PatrickD
Hi, I'm new to OpenGl and I was wondering... what could I use to gain a higher frame rate. The programs I run in OpenGL run pretty good but as I get closer to any object it slows down a lot, that's cause my pc suckx. I know this question is easy but I can't find anything that'll help in NeHe's tutorials (as far as I got in the tutorial). Thanks in advance. [edited by - PatrickD on May 20, 2003 11:38:02 PM]
eriel
eriel
You could use display lists and vertex arrays for some speed up... sometimes.
GreatOne
GreatOne
A better description of what tutorial you are on and your problem would be appreciated, but generally, there are a number of things you can do, but from what you describe, it sounds like you have a fillrate problem (which you can''t really do too much about). This is probably the case if you have a gf2. Also, never use glVertex3f() or glVertex3fv() for more than a few polygons. They are extremely slow. Instead, use OpenGL''s vertex arrays. You should also minimize the number of API calls you make per frame. Turning off things like lighting will also help. Hope that helps.

-------------------
Realm Games Company
-------------------Realm Games Company
Khaos Dragon
Khaos Dragon
do vertex arrays provide an immense speed boost?
PatrickD
PatrickD
Ok,I realized I''m using too much glVertex3f()(thanks to GreatOne) and that''s what slowed down my programs, I''ll use vertex arrays instead. I also modified to code a little bit and gained a little more speed, so now the program runs pretty fast even if the objects are closer like I explained in my first post. Thanks for your replies.
nildo
nildo
How to use Vertex arrays ?
kdogg
kdogg
Beyond your specific coding style, also make sure you use optimal high level algorithms. The overall algorithm your program uses is the biggest determining factor of the program''s speed. I''m assuming you already know that, but it''s still good to reinforce that statement.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.