Skip to main content
gamedev.net
🔒 Locked

FPS

Started by Stonicus 31 replies 1.8k views
Original Post
Stonicus
Stonicus
Ok, I have to ask this because it has been bothering me for some time. Do people *really* get 800 frames/sec? For starters, I do not believe they do at all. That being said, I have a dual processor PIII 1Ghz with 1gig ram and GeForce4 MX420 AGP card. I never ever get 800 frames/sec. I sometimes get 100 or 120 on a very simply scene with nothing being drawn. Do the math, to get 800 frames/sec you have to do a frame almost every single millisecond. How do you people with 800 frames/sec calculate your frames? How do you get your frame time? Do you use QueryPerformanceCounter or just timeGetTime()? If anyone claiming 400, 500, 600, etc frame/sec could answer these questions I''d be interested in knowing the answers. And to top it off, I have tried many sample/tutorial programs and have found many of them to have buggy fps counters so was just curious if people blindly copy them...
Lev Povalahev
Lev Povalahev
Well, if you aren''t drawing anything what should limit your FPS? I just did a quick test and with frame/depth buffer clears only (nothing gets drawn) I get 2000 fps and more. Try using some profiler to find where your bottleneck is.

-lev
GreatOne
GreatOne
It could be that you have processes running in the background that are sucking up CPU cycles (my friend had that problem, he would barely get 30fps on simple games and he had a geforce ti4600).

I''ve got a Geforce4 ti4600 and I''ve gotten over well over 800 fps on some apps and demos. For my game, I use QueryPerformanceCounter cause its faster than timeGetTime()

Look up some tutorials on calculating fps there is one on www.gametutorials.com.

-------------------
Realm Games Company
-------------------Realm Games Company
Stonicus
Stonicus
Well the problem is I get 70 fps with nothing on screen, I can dump like 50000 triangles per frame and I get 50 fps... so I dunno... maybe it is my fps counter that bugs
OpenGL_Guru
OpenGL_Guru
this is a good thread.. something that has been on my mind a lot lately is what is the best and most effecient way to calculate the FPS on any demo or game?? ive seen it done several different ways, i just thought i would take a stab on asking someone for the best way. thanks

heh
Shag
Shag
Firstly, someone stated that they use QueryPerformamceCounter because it's faster than timeGetTime() - this is not true. However, it is far more precise.

There's nothing wrong with using GetTickCount for a simple FPS counter - just remember that it isn't very accurate. It's most useful if you use it in some way like this:-

unsigned int t1 = GetTickCount( );
unsigned int t2;
unsigned int f = 0; //frame counter
float fps;

game loop
.
.
.
f++;
t2 = GetTickCount( ) - t1;
if( t2 >= 1000 ) //roughly one second has passed
{
fps = f / float( t2 ) * 1000.0f;
f = 0;
t1 = GetTickCount( );
}
.
.
.
end game loop

That's one way (psuedo) example in which you can use GetTickCount as a cheap FPS counter. It'll only update the frame rate once every second or so - but it's good for an average.

Ultimately it depends on your requirements - whether or not you need to know the exact amout of time between in each frame (for time based movement etc) and so on.

Regards

[edited by - Shag on February 20, 2003 6:36:34 PM]
Palidine
Palidine
ok,

so anyone who is getting locked at FPS of 60, 70, 100, 120 need to learn about vsync. basically your FPS is limited by the refresh rate of the monitor if you have vsync turned on. it is turned on by default. there is a software way in opeGL to turn it off. otherwise you should have access to that through some control panel inside windows.

-me
Shag
Shag
Just out of interest i managed to get a framerate of about 3800 fps in windowed mode on a PII350 (@392) and a GeForce 256 DDR - just by clear the color buffer and then calling swapbuffers.

However - that really doesn''t mean anything

And as the previous poster stated - it sounds like your limits are those of your monitor vsync - not the potential performance of your system.
PlasmicSoup
PlasmicSoup
Yea, on my fully functional game i get 450 fps so yea, definetly check your vsync (ok thats redundant). I think QueryPerformamceCounter is the only practical way of timing for games... even with the speed loss. Since everything is moving frame rate independent, if the computer thinks the frame rate is slower/faster than what it really is you get, well, retarded looking results. The slightest inaccuracies i had in my code showed this. From choppy results on slower computers even at 60fps, to weird slow downs on faster computers, where the frame rate wouldnt drop, but the speed of everything would. Accuracy is far more important, I think.

-plasmicsoup
Gilgamesh Games
-plasmicsoup
The Flood
The Flood
So how do you turn off vsync through open gl?
zedzeek
zedzeek
>>I think QueryPerformamceCounter is the only practical way of timing for games... even with the speed loss<<

QueryPerformamceCounter is the slowest timer under windows ie both timegettime + gettickcount are quicker. theres also another even faster (+ more accurate) timer on most systems.
FWIW IIRC quake3 uses gettickcount
this is more than accurate for most games

>>So how do you turn off vsync through open gl? <<

http://oss.sgi.com/projects/ogl-sample/registry/EXT/wgl_swap_control.txt

>>That being said, I have a dual processor PIII 1Ghz with 1gig ram and GeForce4 MX420 AGP card. I never ever get 800 frames/sec. I sometimes get 100 or 120 on a very simply scene with nothing being drawn.<<

make the window really small + watch the framerate shootup, if it doesnt then u have a problem

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

[edited by - zedzeek on February 21, 2003 2:55:30 PM]
Alpha_ProgDes
Alpha_ProgDes
is there a cross platform getTime function?
and why is one person saying QueryPerformanceCounter is more precise than timeGetTime and another person is saying that''s it''s Query... is slower than timeGet...?
Beginner in Game Development?  Read here. And read here.  
zedzeek
zedzeek
>>QueryPerformanceCounter is more precise than timeGetTime and another person is saying that''s it''s Query... is slower than timeGet<<

QueryPerformanceCounter IS more precise than timeGetTime (except sometimes when it jumps a few seconds )
but for a game even a very fast FPS(quake3) this precsion is not needed

QueryPerformanceCounter is slower than the other 2 though since youre only calling this once per frame this will have no inflence.

unfortunatly there is no perfect timer under windows

read this
http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-RDTSCTimer&forum=cotd&id=-1


http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
PlasmicSoup
PlasmicSoup
quote:
Original post by zedzeek
FWIW IIRC quake3 uses gettickcount
this is more than accurate for most games


oh wow cool, ill try it out.

-plasmicsoup
Gilgamesh Games
-plasmicsoup
ShlomiSteinberg
ShlomiSteinberg
quote:
Original post by Luke Philpot


      
PFNWGLSWAPINTERVALEXTPROC pFunc = NULL;
if ((pFunc = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress("wglSwapIntervalEXT")) != NULL)
pFunc(0);


...for turning off vsync

[edited by - Luke Philpot on February 21, 2003 10:12:49 PM]


PFNWGLSWAPINTERVALEXTPROC doesn''t work.
Should I include something?
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)
Oxyacetylene
Oxyacetylene
You should get the latest version of wglext.h from opengl.org here

Topic Locked

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

Sign in to reply to this topic.