Archived

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

FPS Speed

This topic is 5883 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

Hello, Is having a frames per second rate of ~60 when only having one white quad in the center of the screen abnormal or normal for my system specs: 733mhz 256mb ram 16mb TNT2 Vanta AGP 45GB hard drive It just seems real low because when I play games like Half-life I get about 30-40 fps, and that program draws WAY more than just one blank quad. I'm just trying to implement a FPS counter in my base code. [EDIT]: Almost forgot, I am running it at 800x600, when I run it at 640x480 I get about another 25 fps. Thanks! Edited by - Viscous-Flow on November 3, 2001 1:05:36 AM

Share this post


Link to post
Share on other sites
Disable VYSNC and youll notice your FPS go way over 60fps for that. Currently your framerate is being locked to the vertical refresh rate of your monitor.

Share this post


Link to post
Share on other sites
I disabled V Sync using NVMAX and it did give me another 20fps to about 78fps. Is that still to low? I have heard of people getting over 150fps.

Thanks!

[EDIT] Now I get about 125fps if I run it at 640x480
Edited by - Viscous-Flow on November 3, 2001 1:07:38 AM

Edited by - Viscous-Flow on November 3, 2001 1:08:36 AM

Share this post


Link to post
Share on other sites
Actually its closer to 60fps that the eye can see at.

A monitor running at 60hz has an image that appears to flicker around the edges. It''s easier to see out of the corner of your eye than when you''re looking at it straight on though. If the eye only sees at 35fps, we shouldnt be able to see such flicking.

Another bit of useless info, TV''s (here in australia anyway) run at 25fps, yet the motion appears fluid on them due to them taking advantage of motion blur.

And to do with the code.... is there anything else you''re doing that could be slowing it down? You should be getting over 900fps for a single quad.

Share this post


Link to post
Share on other sites
I''m not doing anything spectacular just translating messages and drawing one quad. Either there is something really wrong with how I get my FPS or my system is really slow, I doubt that though.

Here is my while loop code:
  
while(window.isDone == FALSE) // As long as the program didn''t receive a WM_QUIT message

{
// Check the message queue. If there is a message to be processed

if(PeekMessage(&msg, window.hWnd, NULL, NULL, PM_REMOVE))
{
// If that message is a WM_QUIT

if(msg.message == WM_QUIT)
window.isDone = TRUE; // Set done to true that causes the application to exit

// Otherwise

else
{
// Handle messages

TranslateMessage(&msg); // Translate the message (used to translate virtual-key messages into character messages)

DispatchMessage(&msg); // Dispath the message to the Windows Procedure event handler function


// If the message was to toggle between fullscreen and windowed mode

if(msg.message == WM_TOGGLEFULLSCREEN)
{
// Log mode switch

if(window.isFullScreen == TRUE)
eLog.Output("Switch to fullscreen mode successful!");
else if(window.isFullScreen == FALSE)
eLog.Output("Switch to windowed mode successful!");
else if(window.isDone == TRUE)
eLog.Output("ERROR: Failure to switch display modes.");

main.InitGLScene(); // Since the previous hRC and hDC were destroyed in the process of WM_TOGGLEFULLSCREEN and new ones were made, we have to reset some variables in the OpenGL state machine using functions like setEnable()

}
}
}
// Otherwise there was no message

else
{
// If the window is active

if (window.isActive == TRUE)
{
// Check the keys

main.CheckKeys();

// Render the scene and get the elapsed seconds from last frame

main.Render(30);

// Swap the buffers (double-buffering)

SwapBuffers(window.hDC);

window.numFrames++;

// Display FPS in title bar if necessary

if(window.showFPS == TRUE && window.numFrames >= 10)
{
// Allocate some memory for storing the window title + the length of the "FPS: XXXX"

char *temp = new char[strlen(window.title) + 50];

// Combine the window title with the frames per second

sprintf(temp, "%s - FPS: %f", window.title, window.timer->GetFPS(10));

// Set the window text with the FPS on it

SetWindowText(window.hWnd, temp);

window.numFrames = 0;

delete temp;
}
}
// Otherwise the window is inactive so

else
WaitMessage(); // Wait for a message

}
}


Thanks!

Share this post


Link to post
Share on other sites
If it helps any, here is my GetFPS code:

    
// Returns the average frames per seconds over elapsedFrames

// If this is not called each frame the client should keep

// Track of the number of frames that have elapsed.

float GLTimer::GetFPS(unsigned long elapsedFrames)
{
// The fps over elapsedFrames

float fps = 0;

// Check to see if the performance timer is available

if(timer.performance_timer == TRUE)
{
// Performance timer last time

static LARGE_INTEGER performance_timer_last = timer.performance_timer_start;

// Performance timer current time

LARGE_INTEGER performance_timer_current;

// Get the current time

QueryPerformanceCounter(&performance_timer_current);

// Find the frames per second

fps = (float)elapsedFrames * (float)timer.frequency.QuadPart /
((float)performance_timer_current.QuadPart - (float)performance_timer_last.QuadPart);

// Reset the timer

performance_timer_last = performance_timer_current;
}
// Otherwise the performance timer is not available

else
{
// Use the multimedia timer

// Multimedia timer last

static unsigned long mm_timer_last = timer.mm_timer_start;

// Multimedia timer current

unsigned long mm_timer_current = GetTickCount();

// Find the frames per second

fps = (float)elapsedFrames * (float)timer.frequency.QuadPart /
((float)mm_timer_current - (float)mm_timer_last);

// Reset the timer

mm_timer_last = mm_timer_current;
}

// Return the fps over elapsedFrames

return fps;
}


[EDIT] I know my computer uses the high performance timer

Edited by - Viscous-Flow on November 3, 2001 3:40:50 PM

Share this post


Link to post
Share on other sites
Just a quick note ...

Check out nvidias developer site for a little app called "Timer Timing". It measures the cost of making various timing calls - unless you need the resolution of the high performance timer, you shouldn''t use it!

Here''s the output from my comp (PII 350)




Report file for timing the various timers.

*** Key number is the avg time.
The smaller this number, the faster the timer.


QueryPerformanceFrequency() freq = 0 1193182


method 0:
QueryPerfCntr..() 100 times
tot: 0 497
avg: 4.970000
avg time: 0.0000041653
method 0:
QueryPerfCntr..() 500 times
tot: 0 2652
avg: 5.304000
avg time: 0.0000044453
method 0:
QueryPerfCntr..() 1000 times
tot: 0 4929
avg: 4.929000
avg time: 0.0000041310
method 0:
QueryPerfCntr..() 10000 times
tot: 0 49672
avg: 4.967200
avg time: 0.0000041630



method 1:
GetTickCount() 100 times
tot: 0 9
avg: 0.090000
avg time: 0.0000000754
method 1:
GetTickCount() 500 times
tot: 0 22
avg: 0.044000
avg time: 0.0000000369
method 1:
GetTickCount() 1000 times
tot: 0 38
avg: 0.038000
avg time: 0.0000000318
method 1:
GetTickCount() 10000 times
tot: 0 338
avg: 0.033800
avg time: 0.0000000283



method 2:
TimeGetTime() 100 times
tot: 0 51
avg: 0.510000
avg time: 0.0000004274
method 2:
TimeGetTime() 500 times
tot: 0 166
avg: 0.332000
avg time: 0.0000002782
method 2:
TimeGetTime() 1000 times
tot: 0 366
avg: 0.366000
avg time: 0.0000003067
method 2:
TimeGetTime() 10000 times
tot: 0 3217
avg: 0.321700
avg time: 0.0000002696



method 3:
Pentium internal high-freq cntr() 100 times
tot: 0 16
avg: 0.160000
avg time: 0.0000001341
method 3:
Pentium internal high-freq cntr() 500 times
tot: 0 60
avg: 0.120000
avg time: 0.0000001006
method 3:
Pentium internal high-freq cntr() 1000 times
tot: 0 114
avg: 0.114000
avg time: 0.0000000955
method 3:
Pentium internal high-freq cntr() 10000 times
tot: 0 1102
avg: 0.110200
avg time: 0.0000000924

Share this post


Link to post
Share on other sites
Assuming you have an nvidia card with newish drivers ...

right click on your desktop, and bring up Display Properties
go to Settings
click the Advanced button
on one of the tabs (called GeForce DDR on mine) there''s a button called Additional Properties. Click that and select the openGL tab. There should be an option there to disable VSync.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
about the bit of useless info I assume australia is using the PAL system. The 25fps are actually 50fps. But they are not full frames but only half of the lines are drawn. So you get the feeling of smooth 50fps with half the info. Just to straight things up.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
about the bit of useless info I assume australia is using the PAL system. The 25fps are actually 50fps. But they are not full frames but only half of the lines are drawn. So you get the feeling of smooth 50fps with half the info. Just to straight things up.


Interesting.. I was unaware of that

Share this post


Link to post
Share on other sites
Actually if the frame rate is locked at 30fps and doesn''t go up or down even .1fps photo realistic rendering is quite possible (IE it is the highest the human eye can see) but if it drops below or goes above that the human eye will notice flikering. In other words something that doesn''t move at all from 30fps can be smoother then something that renders with a range from 50-80fps.

That is what i read while waiting for my eye-appointment atleast (crazy eye people), I/It could be wrong of course, and what i gave was a summary of the 5000+ word report on the subject.

Share this post


Link to post
Share on other sites
NTSC is interlaced as well, 29.7Hz half-frames.

It''s not that the eye can only distinquish upto 30fps, 30fps is required to provide the illusion of continous fluid movement. It''s a minimum not a maximum.

Interlacing was required becuase the hardware of the fourties, fifties, sixties, seventies, and eighties sucked and wore-out if you tried to display non-interlaced frames. Now we''re stuck with the original format that black&white TV was orginally broadcast in (color was added with a clever low-amplitude phase-shift and is fully backwards compatible). And that means it''s broadcast in half-frames. Maybe someday HDTV will replace the old singal...

I can tell the difference between 60fps and 100fps playing Quake3 and so can my score

Magmai Kai Holmlor
- Not For Rent

Share this post


Link to post
Share on other sites