Results 1 to 5 of 5

Thread: FPS problem

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    5

    FPS problem

    Hello everyone.

    I recently decided to continue work on my old project (game). So I installed MSVC++ 6.0 (OS = Vista), opened the project and compiled it without a problem.

    Now here is the problem:

    I draw a grid of quads 32*32 by using GL_QUADS (4 vertices per quad, no shared vertices) and everything works fast as it should. Each quad is drawn seperately.

    Then I tried to draw 256*256 grid and my FPS dropped down to 10-12 frames per second. I find this strange since I can play games such as Doom 3, Far Cry 2, Gothic 3 with max quality without a problem and I'm sure that these games show much more triangles than this 256*256 quad grid.

    I tought the problem might be in vista, but fps drop down in Win XP too. Could the problem be in MSVC++ 6.0? Here is a pseudo code for the drawing:

    Code :
    for(x = 0; x < 256; x++) {
       for(z = 0; z < 256; z++) {
          glBindTexture(GL_TEXTURE_2D, some_tex);
          glBegin(GL_QUADS);
            // draw the quad here. 1 normal per quad
            // 4 vertices using x and z values, y = 0 and texture 
            // coorinate for each vertex
          glEnd();
       }
    }

    Any suggestions?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: FPS problem

    Very similar problem, solved here :
    http://www.opengl.org/discussion_boa...&Number=251247

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    5

    Re: FPS problem

    Okay, thanks for the quick answer. I'll look into this later when I'm home. I tought it might be something with all those immidiate calls. I'm not really new to OpenGL but It's been few years since I used it in any application. Looks like I'll have to read that OpenGl bible again

  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: FPS problem

    Quote Originally Posted by Tomsi
    I'll look into this later when I'm home. I tought it might be something with all those immidiate calls.
    Spot on. The thread ZbuffeR refers to will show you the 'correct solution(tm)'.
    But as a quick fix you can just move the glBegin/glEnd out of the for-loops, which should give you at least a little speed boost.
    Quote Originally Posted by Tomsi
    Looks like I'll have to read that OpenGl bible again
    If you don't have a very recent version, there is no gain.

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2009
    Posts
    5

    Re: FPS problem

    Well I found some tutorials on the net about the VBOs and now it works now with the super speed

    I haven't check the OGL Bible yet, but I have SAMS OpenGL Super Bible 3rd edition (2004). And yes, as I remeber there's nothing about VBO's there. I might be wrong though.

Similar Threads

  1. Replies: 1
    Last Post: 09-23-2016, 02:24 PM
  2. Shading problem? (pyglet-problem?, my problem?)
    By H2OBrain in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-03-2009, 08:31 AM
  3. Replies: 4
    Last Post: 09-27-2004, 06:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean