Help, I've optimized too much!

Started by
14 comments, last by user0 11 years, 2 months ago

So my game was running around 50 FPS, but then I reworked my terrain by implimenting GeoMipMapping, and sending my entity draw calls to a frustrum check instead of just rendering all entities.

I'm now pushing 170 fps, and my laptops fan ramps up and gets loud. I'm assuming this will cook the GPU after a while.

Is there a way to figure out how much to sleep given the FPS? I want to get it back down to 60ish fps (or some lower value).

Advertisement

Probably just waiting on VSync would do it.

If you are using DirectX lookup the present parameters and something like D3DPRESENT_INTERVAL_ONE.

So if your monitors refresh rate is 60hz. Then your FPS will be 60 at most.

That would be a pretty straight forward way to limit your FPS.
For lower values there is D3DPRESENT_INTERVAL_TWO and THREE i think.
For sleep times you could just track your frame and sleep until 1/60th of second as passed; That sounds kinda weird to me though.

Ah I should have mentioned I"m using OpenGL.

Well the concept is the same. Just wait on vsync. I'm sure there is a way to do it in openGL.

A quick google search shows wglSwapIntervalEXT as an extension. Unsure if that is what you should use. But I'm sure you can figure it out.

So my game was running around 50 FPS, but then I reworked my terrain by implimenting GeoMipMapping, and sending my entity draw calls to a frustrum check instead of just rendering all entities.

I'm now pushing 170 fps, and my laptops fan ramps up and gets loud. I'm assuming this will cook the GPU after a while.

Is there a way to figure out how much to sleep given the FPS? I want to get it back down to 60ish fps (or some lower value).

Really? they didn't buzz before. I mean before rework... The CPU usage would be the same with or without optimization with your description so strange...

So my game was running around 50 FPS, but then I reworked my terrain by implimenting GeoMipMapping, and sending my entity draw calls to a frustrum check instead of just rendering all entities.

I'm now pushing 170 fps, and my laptops fan ramps up and gets loud. I'm assuming this will cook the GPU after a while.

Is there a way to figure out how much to sleep given the FPS? I want to get it back down to 60ish fps (or some lower value).

Really? they didn't buzz before. I mean before rework... The CPU usage would be the same with or without optimization with your description so strange...

I'm not sure why you would assume his CPU load would be the same when he runs at 50 FPS vs 170 FPS, but it is not relevant. He asked how to limit his FPS.

So my game was running around 50 FPS, but then I reworked my terrain by implimenting GeoMipMapping, and sending my entity draw calls to a frustrum check instead of just rendering all entities.

I'm now pushing 170 fps, and my laptops fan ramps up and gets loud. I'm assuming this will cook the GPU after a while.

Is there a way to figure out how much to sleep given the FPS? I want to get it back down to 60ish fps (or some lower value).

Really? they didn't buzz before. I mean before rework... The CPU usage would be the same with or without optimization with your description so strange...

I'm not sure why you would assume his CPU load would be the same when he runs at 50 FPS vs 170 FPS, but it is not relevant. He asked how to limit his FPS.

Thanks HAM, i'll take a look at what you said earlier. Yea, I'm not multithreaded, so my update and render functions are right after eachother. Now that I'm pushing 200 FPS, the fan gets really really loud, so I just read up on it, and basically you gave me some good keywords to google search. I'm wasting cycles drawing the scene that aren't going to matter anways since I'm limited by the refresh rate.

So If I limit my frames to 60 per second, should I only be limiting my Render function (that renders the scene) or both update and render functions. Update functions handles all game updates, moving objects, AI, etc...... I'm also single threaded. This is a small game really. I'm just kinda asking what the best advice is when limiting FPS.

So If I limit my frames to 60 per second, should I only be limiting my Render function (that renders the scene) or both update and render functions. Update functions handles all game updates, moving objects, AI, etc...... I'm also single threaded. This is a small game really. I'm just kinda asking what the best advice is when limiting FPS.

Well since you can run at 200 FPS that means you are not CPU bound. And for simplicity sake why not just keep it like you have it.

Lock to vsync. This will lock you state updates, input, and rendering. If you start wanting to run at lower than 60 that is when it might become a concern for your input timings. But you'll create more input woes if you want to start threading anyway, so why not keep it as simple as possible until you need something more.

http://blogs.msdn.com/b/oldnewthing/archive/2010/12/03/10097861.aspx

[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]

This topic is closed to new replies.

Advertisement