Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

casper

How are fps determined?

This topic is 6647 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Count how many frames you''ve shown and divide by how many seconds have gone by. Now use printf();

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!