Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Strange FPS difference

  1. #1
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Strange FPS difference

    hi,

    i am new to opengl but know c/c++ for years.
    i just wrote my first opengl app and it works pretty fine.
    but one thing is strange.
    9 times out of 10 when i start the programm i have 15 FPS ( 1200x800:16@60 ) but 1 out of 10 i have a framerate of 30 - 40.
    than the game is very fast and everything is renderd propably as well..
    and i have no idea why ... i have no frame limit implemented.

    can someone give me a hint ?

    thanx
    uwi2k2
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2010
    Location
    France
    Posts
    458

    Re: Strange FPS difference

    Strange. Sure you don't start your program twice 9 times out of 10 ? Is your card doing other stuffs while you run your program ?

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

    Re: Strange FPS difference

    You have a reason to go for 16bits per pixel, instead of 32 ?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Oct 2009
    Posts
    463

    Re: Strange FPS difference

    It could be a vsync issue, where you're on the borderline of being able to complete each frame in time to be displayed.

    eg. At 60 Hz, you have 16.66 ms to complete rendering in order for it be be swapped at the correct time. If you take less than this time, then you will maintain 60 FPS. If you take 17ms to render, you will need to wait for the next vsync event to occur at 33.33 ms, so your FPS will drop down to 30 FPS.

    A slight difference in conditions when you start the program could be pushing you just over the limit, causing quite a large decrease in measured FPS. Try turning off vsync, or speeding your code up.

    The frame rate with vsync on will be equal to the monitor refresh frequency divided by the number of interval periods that you need to render your scene completely.

    less than 16.66 ms = 60 FPS
    16.66 to 33.33 ms = 60/2 = 30 FPS
    33.33 to 50 ms = 60/3 = 20 FPS
    50 ms to 66.66 ms = 60/4 = 15 FPS

    I'd recommend only switching vsync on if you're capable of rendering faster than the refresh frequency.

    If you're not adjusting vsync (with eg. http://www.opengl.org/registry/specs...ap_control.txt), then check your driver control panel, which can usually force vsync on/off, or allow applications to decide.

  5. #5
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Re: Strange FPS difference

    Hi,

    thanks for all the answers..
    i will check them an come back here to post the result..

    thanks !!
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

  6. #6
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Re: Strange FPS difference

    hi guys,

    sadly nothing worked out, but i checked some other strange behaviors.
    i comented out all stuff in my display func, so i just get a black space...
    if i run the game in a 800x600 window FPS is round 50
    if i run the same in fullscreen 12800x800 its only round 15 FPS
    as long as i do not draw anything.. shouldent it be quite the same fps, as only calculations are done ?

    uwi2k2
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

  7. #7
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Re: Strange FPS difference

    hi,

    update: now i changed something:

    //glutGameModeString( "800x600:16@70" ); //the settings
    glutEnterGameMode(); //set glut to fullscreen

    i commented out the settings, and now more ofen i get a frame rate above 100 FPS .. but the normal status is around 26,27 FPS...
    sooo strange .....

    uwi2k2
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

  8. #8
    Senior Member Regular Contributor
    Join Date
    Oct 2010
    Location
    France
    Posts
    458

    Re: Strange FPS difference

    Like ZbuffeR said, try a 32 bpp (or 24).

    Between, your framerate looks very slow when you render nothing. What OS, graphic card, driver, running GL version, do you have ?

  9. #9
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Re: Strange FPS difference

    hi,

    i am running it on win xp, hp compaq laptop. i need to check the gl version, but ist quite old...
    i will test the 32 bpp or 24

    thanx a lot
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

  10. #10
    Senior Member Regular Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    138

    Re: Strange FPS difference

    ok,

    to tell you the result:
    i am a fool ! i should have check my available display modes.
    setting it to one that is really available on my pc givs me a solid frame about 17-18. but according to what i am really rendering i guess thats slow ...
    anyway i just did something wrong here.

    uwi
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    The OpenGL and VULKAN Podcast ( OpenGL2GO ) : OpenGL & Vulkan Podcast
    ---------------------------------------------------------
    timbling.com - Indie TeamUp

Page 1 of 2 12 LastLast

Similar Threads

  1. Can anyone tell me the difference?
    By Lee_Jennifer_82 in forum OpenGL: Basic Coding
    Replies: 16
    Last Post: 03-12-2016, 10:16 AM
  2. 0.0f vs 0f, what's the difference?
    By mpan3 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 11-01-2004, 08:20 PM
  3. ver. 1.3->1.4 ?difference?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-08-2002, 03:48 AM
  4. In VB what is the difference in hDC and hRC?
    By John Jenkins in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-26-2002, 01:47 PM
  5. difference between OGL & VTK?
    By alanchinese in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-07-2000, 08:17 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