FPS Speed

Started by
14 comments, last by Viscous-Flow 22 years, 5 months ago
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
Advertisement
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.
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
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
Then again, the human eye can''t see much more than 35fps so I guess all those extra digits don''t make any difference, do they?
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.
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
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!
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
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

How do you disable VSYNC?
I disabled VSYNC using a program called NVMAX, do a search and I''m surie you''ll come up with it. It is int the OpenGL section of NVMAX.

This topic is closed to new replies.

Advertisement