#### Archived

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

# Tips to increase FPS on a slow machine

This topic is 5237 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey all, I''m waiting to build my new computer, so until then I''m stuck with my really old setup: AMD K6-2 450 MHz 192 MB RAM Matrox Millenium MGA 2064 (4 MB) So, as you can see doing pretty much any OpenGL on this machine is pretty sttrenuous. I''m using Slackware Linux 9.0 with the 2.4.20 kernel and SDL. I''ve written a little program that I hoped to turn into a game but anything I do to it slows it down. I''m drawing an animated MD2 model, around 1000 triangles, and a 14 triangle model for the ground plane. Everything is textured. When texturing and lighting is on, I get around 1 FPS. With no texturing but still lighting, I get 5-6 FPS. With no texturing, lighting, and everything drawn as outlined polygons, I get 10-11 FPS. I was able to get a 10% increase in FPS by putting my ground plane in a display list. What else can I do to get a boost out of my program? "Donkey, if it were me, you''d be dead." I cna ytpe 300 wrods pre mniute.

##### Share on other sites
Well nobody has answered this in the day or two I''ve seen it up, so here are my suggestions:

Lower the poly count of the model! I know nothing about MD2 models but I can tell you 1000 polygon models would never be used on a (now) low-end machine like you have. Try cutting that number in half or less (by finding another model)

glDisable(GL_DITHER). I think dithering personally looks ugly. I boosted the FPS in my program from 80 to 120 FPS running about 14000 multitextured polygons just by disabling it.

Number of polygons may not be the problem, but rather the fillrate. I''m not quite sure how to get around that one but it might be something to look into.

I''ll post more if I think of anything. There isn''t much you can do to optimize without me seeing the code you''re using.

##### Share on other sites
not mutch, perhaps if you allso use tristips for the model and groundplane.
Allthough your setup is pretty sucky, i am slightly supprised that you get that low fps.
Quake 2 runns faster than that even in software mode, and it has way more than 1K polys.

A few tips:

render all the polygons that use the same texture at the same time.

Make shure your software get''s all the resources it needs.

allso make shure that you run in 32 bit colors, 16Bit might be slower.

Lastly, Ogl drivers for linux that run in hardware are rare for older cards, try and locate better drivers or similar.

However, you should get a newer rig, it''s worth it.

---------------------------------
For an overdose of l33tness, flashbang.nu

##### Share on other sites
Ogl drivers are probably it.
This is probably becouse the drivers for your video card hawe software implementation of GL - so when you make a display lisit you get a preformance bost.

Buth if not:

You did not say witch texture resolution hawe you used.
On 4 mb video card this any thing more than 64x64 is critical slowdown.

And you said that your model is animated.
Did you try to optimize the animation algoritam (with 1000 triangles this can be the main slow down).
Try using assembler.

There are many other things.

P.S.
Sory abouth gramatial errors

##### Share on other sites
Thanks for the tips everyone. I have had some trouble with the drivers and XFree86 so I may see if that is causing a problem. I''m using the same texture on all the polygons because I thought that might be a problem, and I''m not texturing the animated MD2 model. I worked on this way back when I had Windows installed, no graphics card, just onboard graphics (SiS chipset). I worked on it at school which had much nicer setups than mine, so I got a little fancy, but I''ve since then ported it to SDL on Linux on my machine, so things aren''t quite what they used to be. I''ll lower the polygon count on my model, disable dithering, try 32 bit colors, resize my textures, and see if can find some better drivers. Thanks for the help!

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.

##### Share on other sites
remember boys and girls.

Opengl and SiS graphics cards don''t mix
Maybe that way you had that low fps count!
I suggest you to use something else

##### Share on other sites
Well, I lowered the polygon count on my animated model, resized the textures, and resized my OpenGL screen to half what it was and I am now getting 7-8 FPS with all textures on! But I've found a new problem: timing. I thought I wrote time-dependent code, but now that the frame rates went up, gravity is affected! This is the relevant code:

//this is executed in the main game loop, which is recursivecurrent_time = SDL_GetTicks();elapsed_time = current_time - last_time;last_time = current_time;//this is where I handle movement due to gravity, i.e. fallingtime_since_bounce += elapsed_time;//pogo stick is bouncing, so I keep track of time it has been in the airgravity = -0.000012 * (time_since_bounce * time_since_bounce);//I probably should've called it something other than "gravity", but oh well. This is the change in height due to gravity. Soon I'll convert all my untis to metricheading.x = new_heading.x;//this is just the new direction, which is the old plus the direction found when pogo stick collided with the groundheading.y = new_heading.y + gravity;heading.z = new_heading.z;

So can anyone point out something I'm missing? I checked, and the amount of time between each bounce is the same independent of framerate, so time_since_bounce is okay.

And to the anonymous poster, if you'd read my original post, you'd know I'm not using the SiS chipset!

"Donkey, if it were me, you'd be dead."
I cna ytpe 300 wrods pre mniute.

Edit: Okay, so I forgot how to post code! I've spent too much time in the Linux forums.

[edited by - duncanbojangles on May 22, 2004 11:57:28 PM]

[edited by - duncanbojangles on May 23, 2004 2:12:31 AM]

##### Share on other sites
well the trick for doing FPS independent animations is to multiply any movement with the delta time of the the last frame.

If you are using seconds as a base for delta time and the using the model scale of 1 unit=1meter then you could use SI for your gravity like this.
gravity = 9.82*elapsed_time;
yaccel-=gravity; //never clear this one except when not moving

When bouncing just invert yaccel.

---------------------------------
For an overdose of l33tness, flashbang.nu

[edited by - lc_overlord on May 23, 2004 4:37:23 AM]

##### Share on other sites
I changed my code so that
gravity -= gravity_constant * elapsed_time;
but it still acts strangely. I keep trying different things, but nothing works. Sometimes, the time between jumps is the same, but the height to which the jumps go varies. Other times, the height is the same, but the time varies. I have no idea how to fix this.

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.

##### Share on other sites
thanks for all the help! I fixed the problem, and fixed up some other code in the process. Thanks again!

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 48
• ### Forum Statistics

• Total Topics
632637
• Total Posts
3007578
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!