Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

PlasmicSoup

OpenGL Optimizing my OpenGL performance

This topic is 5730 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I found out that main game''s bottleneck is the drawing stuff. Without AI, Input, and Collision Detection, it still runs at basically the same speed! Without the drawing, I get around 100fps faster. My game is a 2d (uses 3d perspective though as i use the Z axis for stuff coming down, so its like an overhead 3d game with 2d quads for sprites, appearing 2d). Anyway, I''m wondering how I can optimize the rendering. I''ve read of several methods (display lists, vertex arrays, etc.) and I currently don''t use any of them, any extensions, or lighting or anything like that yet. I have a ''DrawEverything'' function that loops through every object type and if it exists draws it using DrawSprite, which resets everything/translates/rotates/colors(alpha) than draws the sprite with appropriate tex coordinates depending on frame of animation (contained within each sprite''s texture). What would be the best method to optimize this and how would I go about doing it? Thanks in advance. I considered display lists for each enemy for each frame, but would it really be faster? I think my main problem is that I call LoadIdentity, translate, rotate, Glbegin, etc. etc. like 300 times a frame for each sprite. I can''t combine things under glBegin and End because everything has different rotations and textures. I could loop through everything that has the same rotation and texture, though, and draw it in one step, then do everything else. I AM getting like 300 fps on my game, though. Am i just being greedy? I figured Quake 3 runs at like 80 on my machine with top settings, so my puny little game should be like 1000! Will my fps drop considerably once i add lighting and other crazy effects? Alright, thats all. Thanks for any reply. -plasmicsoup

Share this post


Link to post
Share on other sites
Advertisement
I think 300 fps is ok. the question is will it run that well on your customers pc''s? as for optimizations you''re on the right track. to see a real speed increase with display lists you need to render a lot of the same object. (not to discourage you from using them). vertex arrays are good. compiled vertex arrays are better. do you have GL_CULL_FACE enabled? this will help some with backface culling. (if it''s in 3d) the more state changes you have the slowing it will be. try sorting all of your textures so all objects with similar textures are rendered together in static objects to minimize calls to glBindTexture().
just some ideas to throw around.

Joe

My Homepage

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!