framerate??

Started by
10 comments, last by ahmedr 20 years ago
Hi all, I''m new to game programming and its been bothering me how simple programs such as nehe''s single-polygon-rendering tutorials (and other tutorials from gametutorials.com) run much slower than full-fledged 3d games like unreal tournament and fifa 2002. This bothers alot cuz im using nehe''s basecode for my little programs and the run at 10-20 fps in fullscreen on my almost extinct VGA card (ati rage 128 pro) while fifa 2002 runs at no less than 30 fps and sometimes reaching 55 fps. Can someone please explain to me what kind of techniques the developers of such big games use to make their code considerably faster than the simplest uses of windows programming and opengl (like rendering a polygon in fullscreen)? regards, ahmedr.
you gotta give to get
Advertisement
Assembly language to speed up the core I suppose, or optimized polygon rendering techniques with BSP, culling, scene graphs, etc.

"There is no dark side of the moon." - Pink Floyd
"There is no dark side of the moon." - Pink Floyd
OMG, I have an ATI RAGE 128 too!! :D

From my experience, the OpenGL support is crap on these, unfortunatly. So it may be that you''re playing with DirectX games and coding with OpenGL...
it has little to NOTHING to do with assembly language.

the main differences are the fact that games like unreal and fifa use the hardware to do the calculations, which NEHE uses software, and the fact that nehe''s code is very linear, and probably waiting for vsynch before progressing, pausing the whole program. the new jet3d engine we are developing is entirely in C++, and in our latest tests (unlit geometry, 240000 poly scene rotating 1 unit every 1/60 of a second) we got 15 fps. a 60000 poly scene easily reaches 60 fps due to asynchronous rendering, and only doing the maximum necessary each time BeginFrame or EndFrame is called.

also, if something is rotating in the nehe tutorial you may be talking about, the little functions sin() cos() and tan() are extreme fps killers, never try to do those in realtime.

___________________
-Nicholas Anton, Owner RaptorTech
-Admin(at)Raptor85.com
-Offer to all Gamedev members
NeHe''s code isn''t optimized for speed at all, its meant for learning from.

You''ll need to learn about Vertex Buffers / Objects rather than using Immediate Mode (sending each vertex to the card).

Theres a lot of other optimizations to make, as well.
hey guys, since we are sort of on topic, ive been wondering, what makes a game have good graphics? as in, how come games like Doom 3 look so damn good? what makes a game have good graphics in general? i imagine its how many "special effects" the programmers code into the game, you know things like shadows and stuff. im guessing these modern games the developers just take advantage of every possible thing the graphics cards can handle???
FTA, my 2D futuristic action MMORPG
also the coders for a commercial game like Unreal etc, would most likely have their own rasterizers tailored specifically for their game''s data structures, so instead of passing in glVertex3f(...) or whatever to opengl or directx they would have a 3D rasterizer do take entire objects or lists of objects and render them all at once.

Also depending on what your using if opengl or directx hasnt been initialized correctly (or optimally) then it could run up to 30-40 fps slower than if it had.

~aussie
[~aussie]
Thanx for the replies everyone, but i think im getting confused, at first i thought they used assembly but then why would there be very advanced object-oriented api's like mfc opengl and directx when assembly language was still the way to go.

Raptor85, i dont understand what you mean by them using the hardware to do the calculations, the opengl we (beginners) use isnt it cross-platform and communicates directly with opengl-compatible hardware. Or do developers write different code optimized for the different VGA technologies (i doubt this since this is what they did before OGL and DX). I kinda lost you when you mentioned "linear" and "vsynch". Please elaborate. And about rotation, the tutorial I'm talking about renders a stationary polygon.

Specchum, I dont think all these optimization techniques would have any positive effect on the framerate since its only one polygon im talking about here.

Runelancer, if sometimes you feel like smashing your pc after trying to run warcraft 3, well, i know exactly how it feels. This is probably the worst VGA card ever.

[edited by - ahmedr on April 5, 2004 5:36:08 AM]
you gotta give to get
quote:
i dont understand what you mean by them using the hardware to do the calculations


it means that the more modern graphics cards have a built in processor (GPU) that is capable of multiplying matrices/vectors or pretty much anything to do with 3D math at much higher speeds than the CPU can do alone, so instead of multiplying all the matrices in software the graphics card can do it for you. The DirectX helper library does this (d3dx9.h) so if you want to do anything with hardware then you could just include this in your program and let it do all the work for you. Even if you have a super shitty video card (like mine) with no on-board GPU, i think it also makes use of CPU optimizations like SSE and 3DNow!, so either way it will give your program and extra speed boost.

quote:
I dont think all these optimization techniques would have any positive effect on the framerate since its only one polygon im talking about here


then OpenGL might not be initialized correctly, try messing around with the PIXELFORMATDESCRIPTOR structure and see if it makes any difference

~aussie

[edited by - James Sioutis on April 5, 2004 7:08:05 AM]
[~aussie]
quote:Original post by James Sioutis
it means that the more modern graphics cards have a built in processor (GPU) that is capable of multiplying matrices/vectors or pretty much anything to do with 3D math at much higher speeds than the CPU can do alone, so instead of multiplying all the matrices in software the graphics card can do it for you.
He has a rage pro...that supports OpenGL, so he is getting hardware acceleration. NeHe''s tutorials ARE OpenGL tutorials...they DO use the GPU to do this maths...

quote:The DirectX helper library does this (d3dx9.h) so if you want to do anything with hardware then you could just include this in your program and let it do all the work for you. Even if you have a super shitty video card (like mine) with no on-board GPU, i think it also makes use of CPU optimizations like SSE and 3DNow!, so either way it will give your program and extra speed boost.
SSE and otehr SIMD instructions are used by the card drivers, and they can be used in peoples programmes...but for one polygon they are not going to make a difference.

quote:I dont think all these optimization techniques would have any positive effect on the framerate since its only one polygon im talking about here


quote:then OpenGL might not be initialized correctly, try messing around with the PIXELFORMATDESCRIPTOR structure and see if it makes any difference
This is more like it. It should not run 10 fps...

This topic is closed to new replies.

Advertisement