Chunky by FelipeFS
Chunky by FelipeFS
GPWiki.org
It is currently Fri Aug 01, 2014 1:40 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Opengl Framerate
PostPosted: Tue May 29, 2012 5:33 pm 
Bit Baby

Joined: Tue May 29, 2012 5:19 pm
Posts: 9
Location: Germany
Hello,

I just started with OpenGl, I have a bit of Experience in C++,
I t worked through the Opengl Tutorials on this site, (http://content.gpwiki.org/index.php/OpenGL:Tutorials:Tutorial_Framework:Base)
I also use the basic code for my 'experiments'.
I wondered if it is possible to archieve a higher Framerate than 50-60 fps.
Which no drawing operations in my while() loop,
i have something like this. This is a bit strange,
because that means, that the FlipBuffers() call needs longer than a 20000 poly model.
(I wrote a .obj model loader).
Any idea to improve this or did I just make a mistake??

avrrobot

(By the way, dont wonder about spelling or grammar mistakes, I'm not a native speaker)

_________________
Hope you dont mind spelling mistakes.
Greetings from Germany.


Top
 Profile  
 
 Post subject: Re: Opengl Framerate
PostPosted: Tue May 29, 2012 6:15 pm 
Digerati

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1804
Location: burrowed
It's not like swapping buffers takes a whole lot of time. If you are stuck at 60 you should see if vertical sync is active.
This will make the buffer swap wait until the monitor refreshes to prevent tearing resulting in a longer wait.
If vsync is not enabled it could mean that your drawing routine is only fired every 60ish seconds. This is sometimes useful to provide a stable graphics simulation. In that case keep an eye out for any sleep() calls or similar waiting functions or conditions that skip your render routine.

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
 Post subject: Re: Opengl Framerate
PostPosted: Tue May 29, 2012 7:25 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 7101
Location: Wilts, Englandshire
Yeap, sounds like your VSYNC is on. Take a look at the properties of your graphics driver. If you're using an nVidia card, there's a big section of OpenGL options that can make a huge difference to rendering speeds.

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
 Post subject: Re: Opengl Framerate
PostPosted: Tue May 29, 2012 8:06 pm 
Yes, I have an nVidia card.
The problem will be, when (if) I render a lot more Polygons,
the whole thing will get to slow.
But I want to keep the whole program (maybe a game later) as portables as possible.
So I cant be sure, that there is an nVidia card.

avrrobot


Top
  
 
 Post subject: Re: Opengl Framerate
PostPosted: Tue May 29, 2012 8:08 pm 
Bit Baby

Joined: Tue May 29, 2012 5:19 pm
Posts: 9
Location: Germany
Sorry, i didnt know, that you can post here without being logged in.

_________________
Hope you dont mind spelling mistakes.
Greetings from Germany.


Top
 Profile  
 
 Post subject: Re: Opengl Framerate
PostPosted: Tue May 29, 2012 9:02 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 7101
Location: Wilts, Englandshire
True enough, but Vsync will limit your framerate to the refresh rate of the monitor. I always turn this off as it's far too easy to fall into the trap of basing the pace and movement of the game to the framerate.

Turning off Vsync and getting time based modelling sorted will make your game more stable and portable, whatever the card is in the end user's box.

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
 Post subject: Re: Opengl Framerate
PostPosted: Wed May 30, 2012 5:25 am 
Bit Baby

Joined: Tue May 29, 2012 5:19 pm
Posts: 9
Location: Germany
Ok, thanks.
But how can I do this properly?
Is this Opengl Code or is this just windows stuff?

avrrobot

_________________
Hope you dont mind spelling mistakes.
Greetings from Germany.


Top
 Profile  
 
 Post subject: Re: Opengl Framerate
PostPosted: Wed May 30, 2012 6:04 am 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 7101
Location: Wilts, Englandshire
Unfortunately OpenGL doesn't provide any API to control VSYNC from within your code. It's purely a Windows setting.
As I said, go digging through your advanced display settings. If you have a FPS counter, you should see it go up over 50/60 fps once VSYNC is off.

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
 Post subject: Re: Opengl Framerate
PostPosted: Wed May 30, 2012 6:34 am 
Bit Baby

Joined: Tue May 29, 2012 5:19 pm
Posts: 9
Location: Germany
Youre right, I found it in my nVidia Settings. I disabled it and now I have 400 fps,
I think this is ok for 20000 Polys.
Thank you!!

avrrobot

_________________
Hope you dont mind spelling mistakes.
Greetings from Germany.


Top
 Profile  
 
 Post subject: Re: Opengl Framerate
PostPosted: Wed May 30, 2012 8:04 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 7101
Location: Wilts, Englandshire
You're welcome. :thumbs

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group