Archived

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

framerate??

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

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.

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
quote:
Original post by graveyard filla
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???
Well it is a range of things, both technology and artwork. Good tech wont look good without good artwork.

Consider Doom 3, you have loads of things going on here like Bump Mapping to make details on surfaces look like they pop out at you, stencil shaddows for fast real time lighting, specular highlights and environment mapping to add glare and reflections to surfaces. On top of that you need the basics like high resolution, high colour textures. Most of Doom 3''s textures will probably be 512x512 pixels and 24 or 32 bit colour.

Then there is geomerty...Unreal has high polycounts (geometry complexity) cause it uses different geometry types for different things, such as static meshes which are used for very repetitive geometry and are ultra fast to render and take up very little memory.

Uptimization is the key as well. YOu need all this to be fast, so you have to know your theories well, ie fast data structues like Binary Space Partitions, Red/Black trees for texture lookups.

There is SO MUCH that games need these days to look good, alpha channels, terrain layers, skeletal animation, cubemapping the list is endless...and now with pixel shaders and whole rendering systems being written in them (Unreal Engine 3 for example) things are only going to get more complex.

I am writing an engine with terrain and meshes and believe me it is no easy going...

Share this post


Link to post
Share on other sites
also when you run something in fullscreen it usually runs a hell of alot faster than in windowed mode, most games like unreal etc run in fullscreen anyway, i dont know about nehe tutorials though because i havent read them. But most video cards allow flipping to occur, when running in windowed mode the video cards memory has to be filled up with all the data in the every window on screen and because some of them have different screen formats (like alpha and stuff like that) the video card has to convert them all, store them in a screen-sized array and copy it pixel by pixel to the computer screen, but if your program is in fullscreen mode then the video card just takes a pointer to your window and then swaps it with a pointer to the computer screen window, so it doesnt have to copy all the data pixel by pixel, so that would surely boost up your frame rate alot, no matter how many polys you''re rendering.

also by the way using the SetWindowText() kills your frame rate too, depending on how many times you''re calling it.

~aussie

Share this post


Link to post
Share on other sites