Speedy models...how do they do it?

Started by
22 comments, last by Dark_Streak 21 years, 9 months ago
I have just successfully made a 3D Studio max model (it''s a robot figure) and imported it into my game. It was too large, so I had to use glScalef to reduce it''s size. I am now getting 30 frames per second...I used to get 60 before I stuck my model in there!?! Why has this reduced my framerate by half? It''s a simple model consisting of only one texture, it''s not even animated. I am using display lists to precompile it, yet it still slows stuff down to a crawl. I don''t get it. Half-Life, Quake etc. they all have numerous models running around whilst explosions are going off and buildings and terrains pass by. I play these and get decent frame rates. How do they do it?
Advertisement
Turn off vsync:

Settings->display->advancedsomething

check vertical sync off by default

And try again

Visit the 2D game programmers'' hideout!
What else do you have going on in the scene? The pro''s also use advanced frustrum culling algorithms and octrees. Might want to check those out in greater detail.

-Vic

===
www.cnunited.com
===
===www.cnunited.com===
dont turn of vsync. Vysnc isn''t your problem and personally I always enable it because I hate to see tearing.

As for the culling, if you are rendering a single mesh on screen then its not your issue. Ignore that guy too :-)

Instead, check the poly count of your model. Maybe you made it to complex. Depending on your machine specifications, 300 polys may be minimum detail for a caracter or something of the sort vs 10,000 maximum. If you utilized meshsmooth or some other functionality of 3dsm you may easily produce a overly detailed model.

Check the 3dmax help files for the polygon counter. Check how many polys you got. (you may need to check the poly count of the exported model, depending on what you used on the model) Let us know the poly count and your machine specs.

-SniperBoB-
most q3 models are approx 1000 vertices or so (or was it polys?) anyway, modeling things in an app like 3d studio max can lead to creating very high amount of vertices. thus requiring more horsepower to push.

what is your REAL framerate before and after placing the model in the scene? turn of vsync and give the numbers. with vsync off your scene could be running at 61 frames per second before the model was added and 59 after. thus you actually get 60 and 30 with it on (since you MUST wait for the refresh of the moniter with vsync on). this is why any benchmark/framerate is pretty much meaningless unless you turn off vsync.

SnprBoB86, obviusly you dont understand the limitations on framerate vsync can impose. you are correct that culling is probably not the issue, but he will need to implement culling anyway. he dont specify how many instances of the model he is drawing per frame, and it could very well be a culling problem.

also most pro games have vsync off by default since it slows things down. also they use culling and have low vertex count models (remeber vertex count is ussually more important then polygon count due to the transformations being done).

i personally think its a combo of a very high polygon count model coupled with vsync. though, its very likly its more vsync then the model, because a single millisecond can determine the difference between 60 and 30 frames per second if vsync is on.
quote:It was too large, so I had to use glScalef to reduce it''s size.

Well that might be your problem right there. Resize it in max, don''t make the CPU work more to resize it in game.

------------
aud.vze.com - The Audacious Engine <-- It''s not much, yet. But it''s mine... my own... my preciousssss...
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
_______________________________________Pixelante Game Studios - Fowl Language
Jeez, does anybody else here really know how vsync works besides me and SniperBob? You guys have kinda the right idea about what it does, but his particular problem doesn''t have anything to do with vsync.
quote:Original post by crrrazydan
Jeez, does anybody else here really know how vsync works besides me and SniperBob? You guys have kinda the right idea about what it does, but his particular problem doesn't have anything to do with vsync.


a person is right, vsync could be having an effect on it. If you don't think so, then you don't understand how vsync works.

If your monitor refreshes at 60Hz, then that means you got 16ms to draw the frame. If he was taking 15ms before, then that's fine, he'll get 60fps. If the model increase the time taken to render the scene to just 17ms (i.e. 2ms more) then you'll drop to 30fps. To show you, here's a diagram:



The top line is the game running at 15ms-per-frame. It ends up running at 60fps, because it hits every vsync. The bottom line is the game running at 17ms-per-frame. It ends up running at 30fps, because it misses every other vsync.

edit: fix up img tag...

codeka.com - Just click it.

[edited by - Dean Harding on June 26, 2002 4:02:35 AM]
Yeah, Dean''s right. I had this problem with vsync in my engine, and when I turned it off, the performance went through the roof. Don''t forget that you can use the EXT_swap_control extension to modify the vsync through your program.

However, while I think that vsync is one of the problems, using glScalef is almost certainly killing performance, as LockePick notes. In every OpenGL document I''ve read, it always says to never let the hardware scale your polygons. Just think, every vertex of your model is being scaled before it''s displayed. That will certainly degrade performance, especially when you bring animation into the mix...

Movie Quote of the Week:

"I''ve seen things you people wouldn''t believe. Attack ships
on fire off the shoulder of Orion. I watched C-beams glitter
in the dark near the Tannhauser gate. All those moments will
be lost in time, like...tears in rain. Time to die."

- Roy Batty, Blade Runner.
Try http://uk.geocities.com/mentalmantle - DarkVertex Coming Soon!
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
if you dont have rescaleNormals, or normalize ative then a scale is nearly free, because you still multiply each vertex with a matrix, and that matrix isnt bigger or smaller if you have/omitt scale in it, the only overhead is the curr_Matrix * Scale which should be once a frame..

This topic is closed to new replies.

Advertisement