Archived

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

XaOs

Extreamly high framerate!!!!!!

Recommended Posts

XaOs    122
Hi!! I was making this little program to test the speed diff. between triangle calculations and display lists!! I use 2 cylinders (draw with some math and tris), and a some quads for a floor using fake reflections!!(blending)!!

But when i run this i get between 380 and 430 FPS!!!!!!!!! Can someone download the prog and walk trough the source for me and tell me i you can find something wrong...... I dont think a prog. like this one should run this fast.... At least it never did before...... You can find the source at my page right here Just go to downloads and pick it down..(Wacky FPS Demo)!! Thanx to anyone helping..... - -- ---[XaOs]--- -- - Edited by - XaOs on June 27, 2001 4:08:48 PM

Share this post


Link to post
Share on other sites
AbeE    122
Sorry to butt in here lads but could you tell me if the way I am calculating FPS makes sense, I do it like so:
Scene_Start = TimerGetTime(); ///Before anything is drawn

<......Stuff drawn........>

Scene_End = TimerGetTime(); ///After everything is drawn
Total_Time = Scene_End - Scene_Start;
FPS = (1 / Total_Time)*1000

My logic is that if Total_Time is the time for one frame then
if I divide by the time taken and multiply by 1000 to get it into seconds instead of milliseconds. Is that OK?, because on my terrain program I made I get around 400FPS on it and it has alota polygons (though it does seem really smooth).
Thanks

And the framerate I got on your program was 110FPS,
my system: Pentium-2-450Mhz, 128MB RAM, Geforce 2 Pro.

Share this post


Link to post
Share on other sites
XaOs    122
Thanx for the feedback everyone.....
Nice to see that it wasn''t my FPS counter that was screwed!!


Penetrator
How long have you been working on you flightsim...?
It looks bloody awesome....
I specially like your terrain..nurbs / bezier ?

Take Care!

- -- ---[XaOs]--- -- -

Share this post


Link to post
Share on other sites
penetrator    122
hi XaoS, i started working on glHorizon flightsim last November: terrain engine is generated from a satellite heightmap area of about 4.000.000 km² (2000km*2000km), which include the bordering region between Ethiopia, Sudan, Kenya and Uganda.
Basically the terrain engine is formed from subsequent triangle strips, whose vertex are computed from the heightmap of course. I''m planning to use ROAM alghorithms in the future. But the most difficult part was the flight model: now also that is quite advanced and working well, the simulation is playable, perhaps i''ll release a little demo in the next weeks.

Check out www.web-discovery.net !

bye


glHorizon_Project



www.web-discovery.net


Share this post


Link to post
Share on other sites
brettporter    122
I think the reason it is so high is that you aren''t flushing the triangles - so you are only calculating on CPU time (always low). You should read the value several frames in a row and take the average.

Since I''ve just made a release I''m in plug mode PoratLib has some FPS calclation code I''ve found to be very reliable. (link in signature).

Let me know how it goes!

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL

Share this post


Link to post
Share on other sites
AbeE    122
penetrator:
mmmmmmm,....Well, I have a loop that goes through 7200 triangles but after the terrain is generated its stored in a display list, I''ve managed to get the FPS up as high as 500fps with this many triangles. Its a really basic little program though. Nothing like you guys would make but its my first real ''project'' so to speak and so I''m quite pleased with it. The only real problem I have with it is that it takes about 30 seconds to load the vertices into an array which is quite annoying.

Share this post


Link to post
Share on other sites
Zadkiel    122
Heres a neat trick for calculating an average framerate, without have to store the previous 30 frames in an array.

let FPStmp = 1000/Time_End-Time_Start
multiply FPS by N
add FPStmp
divide by N+1

so I suppose its FPS = [(FPS*N)+(1000/Time_End-Time_Start)]/(N+1)

The higher N the less erratic the Frame count, but it also takes longer before it reads correctly

Share this post


Link to post
Share on other sites
RipTorn    722
The best way to measure FPS is to have a variable set to the millisecond count (using either timegettime, (the best) a performacnce counter divided by its frequency, or (the worst) GetTickCount)...
Each frame, test the variable to see if it is smaller than the current time-1000, when this is true, 1 second will have passed. you can simple count the frames between each second, and set the checking variable to the new time. it isn''t perfectly accurate at low fps, but it is _VERY_ accurate at high fps.
Finding the FPS at very high frame rates is very inacurate if you try and do it every frame.

On the fps issue, its all in how complex your loop''s are. You can get 15m/tris/sec with a loop just using GL primitive calls, but that will dive to around 0.5-1m/tris/sec if you add a _SINGLE_ if, or such...

its also about keeping the processor and vid''card busy at the same time, but that gets complex

Share this post


Link to post
Share on other sites
I have a very sufficient way using Clock();

void CalcFPS( void )
{
nFrames += 1;
if(nFrames > 100)
{
// Get the current Time

storclock = storclock + clockint;

clockint = clock() - storclock;

fps = (float)nFrames/((float)clockint/CLOCKS_PER_SEC);
// Display the fps
nFrames = 0;
// Resets the timer

}

return;
}

It can be pretty whacky, but it works rather well.

Share this post


Link to post
Share on other sites
max621    139
quote:
Original post by Ak37
What''s the problem with GetTickCount ??

I believe it is inaccurate... might be wrong on that.

Share this post


Link to post
Share on other sites
RipTorn    722
I''m getting this data from the VC++ help thing, but the thing that makes GetTickCount suck is that it is only updated at fairly long intervals. (10-15milliseconds on WinNT, 55 on Win95) where a performance counter can be every 1/2 millisecond.
This means if you are doing movement distance scaled by the millisecond count between frames (which you should be ), you won''t have smooth movement, but jolts.. (although it will not be noticable).

Share this post


Link to post
Share on other sites
panic    211
omg, 1000+ fps in fullscreen without lighting (around 800 with lighting)..

p2 400, GeForce2 GTS (Quadro2 pro software patch, shouldn''t matter in this case)

Share this post


Link to post
Share on other sites