Advertisement

How are fps determined?

Started by March 12, 2000 07:43 PM
6 comments, last by casper 24 years, 9 months ago
I''m a newbie to game programming and everything I''ve read on Frame Rates a little but don''t know how they are determined, so that I can know how to decrease or increase it? Can someone give me a descent description of fps and the determination of it? Thanks casper
...for over a thousand years the Jedi Knights have been the guardians of peace and justice..before the dark times..before the EmpireCasper..
FPS is Frames per second. Basically you count how many frames you can render during a certain amount of time, then you divide this number with the time. Or you take the time it takes to render a certain amount of frames, then divide the number of frames with the measured time.

A good function to get the time is timeGetTime() which returns the number of milliseconds that have gone by since you started your computer.
Advertisement
fps means frames per seconds
and frames per seconds is simply how many times per seconds the screen is redrawn. more the fps is high, more the fluidity is high. and the fps is determined by how many gfx you draw to the screen and how the gfx are complicated, to increased the fps, you need to decrease the amount of displayed gfx and vice versa.
cyberg- cyberg_coder@hotmail.com- http://members.xoom.com/cybergsoft
Why do some people measure the FPS more than once per second? Like in Quake III. It makes the FPS really hard to read, since it''s always changing.

============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
check out this post
It should answer your questions.

wytraven@kik.net
www.geocities.com/wytraven_2000

There is nothing real outside our perception of reality. Is there?
[email=wytraven@kik.net]wytraven@kik.net[/email]There is nothing real outside our perception of reality. Is there?
Thanks, everyone .
casper
...for over a thousand years the Jedi Knights have been the guardians of peace and justice..before the dark times..before the EmpireCasper..
Advertisement
Count how many frames you''ve shown and divide by how many seconds have gone by. Now use printf();
A single measurement that only lasted a fraction of a second is pretty
useless to know anyway unless it consistently appears again and again.
So what I do is average my FPS over the entire time the program is
running to smooth it out. So it won''t jump around as much.

You could have a global float variable called aver_time and calculate
it like this:

aver_time = (frame_time + aver_time) / 2;

Then save it to a string somewhere so you can later print it out:

char fps[64];
sprintf(fps, "FPS: %.3f", (1.0/aver_time) );

Rasta

This topic is closed to new replies.

Advertisement