Performance Issue

rated by 0 users
This post has 4 Replies | 2 Followers

Top 500 Contributor
Posts 4
SunBurn_Pro_Licensee
IanUnderwood Posted: 08-31-2010 9:19 PM

In my game I've been making, I've run into a strange performance issue with the scene I've imported in. After doing a lot of testing, I've come here to ask for help. I'll try to describe everything I've done. 

The game is intended for the Xbox 360, so all framerates are based on the Xbox performance. My PC runs the game fairly smoothly.

I have a scene, which is all one object in 3DS Max. When looking in certain directions, the game slows to about 20 fps. However, at other angles the game will run at a smooth 60 fps. I am using deferred rendering. I've also turned off all shadows for now, my goal is to make the game run at 60 fps without shadows.

Here's an example of a slow view, this runs at 20fps on the Xbox:

http://img230.imageshack.us/img230/2929/slow.jpg

And here's an example of a 60 fps view, all I've done is move the camera directly backwards, until the whole scene is viewable:

http://img844.imageshack.us/img844/7544/fast.jpg

What I can't understand is what's causing the slowdown. Even simply turning the camera from one view to another equally detailed view will cause an fps difference.

Here are the tests I've done, and their results:

Importing a textureless version of the level: no difference

Reducing the polygon count (originally 100,000 tris, to 20,000 tris): no difference

Reducing the resolution *does* increase the fps, but I have to reduce the resolution to very small amounts to get the problem angles running at 60 fps. I'm targeting 1280x720.

Replacing the entire light rig with a single light: 30 fps at the problem angles, up 10 fps.

Creating a new game, replacing the default windmill scene with my own scene, and turning off shadows: also 30 fps at the problem angles, up 10 fps.

Changing the game to forward rendering: 60 fps at all times with one light, but terrible performance with the normal light rig. This isn't really an option, my artists will mutiny :P

Changing the performance preferances (such as preferences.TextureQuality), all to the lowest: no difference

Changing the DeferredBuffers precision mode and and lighting range to low: no difference

The best guess I have is that if the lights in the game light up all the pixels visible on the screen, it goes slow, but surely Sunburn should be able to render a simple scene like this at 60 fps?

Top 10 Contributor
Posts 4,546
Employee
SunBurn_Studio_Licensee

Hi Ian,

Your scene design is awesome, I can't wait to see more!

It looks like vertical-sync is on, which is causing the frame rate to jump between 60, 30, and 20 fps (making it seem like changes are not having an effect).  During performance testing make sure to disable v-sync, this provides the most detailed performance info.

If you can re-run a few tests to see the performance change it should help identify the problem area:

  • Test EffectDetail High, Medium, Low
  • Test DeferredBuffer size of 1024x576
  • Test enabling / disabling render manager options DepthFillOptimizationEnabled and OcclusionQueryEnabled (occlusion querying ideally should be off in smaller scenes like this)

Also is HDR enabled?  HDR combined with deferred can consume a very large amount of memory bandwidth, it may not be possible to target a full 60 fps at 720p, however reducing the PostProcessingDetail level will certainly help.

Let me know if this helps and what results you see!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 500 Contributor
Posts 4
SunBurn_Pro_Licensee

Thanks, Bob!

Turning on Vsync really helped seeing the small fps changes, I was under the impression for some reason that I would still see fps changes as long as it was under 60, my bad. I did the changes you suggested, and here were the results:

(Every test is based on the "base" scene, with only the change specified)

Base fps: 22

Effect detail medium: 23

Effect detail low: 24

DepthFillOptimization turn on (I normally have it off, as it was causing visual glitching with sgMotion): 20 fps (lower? Unexpected)

OcclusionQueryEnabled turned on (I normally have it off, I have my own system of turning on and off lights based on player position): 20 fps

Reduced Depth Buffer size: 33 fps (yay!)

You asked if I had HDR turned on, which I don't. I do, however, have my own Bloom post processing, which is based on the XNA sample. Turning off post processing added 1 fps.

Deleting my light rig and simplifying it to one light: 46 fps

 

So it seems with a combination of reducing overdraw in my light rig, and reducing the Deferred Buffer size, I am able to get my target frame rate. With adding two shadow casters to the scene, I am able to run at 30 fps consistently. So now my question is this: With a deferred buffer size of 1024x576 (which causes some graphical ugliness), and two shadow casters, should I be able to reach 60 fps on the Xbox, or is 30 fps about what I should expect?

 

Top 10 Contributor
Posts 4,546
Employee
SunBurn_Studio_Licensee

Hi Ian,

Those frame rates are rather low - it sounds like there may be something else going on that's affecting the performance.

As an example: in the main room of the Power Station Example there are ~120 lights and 6 shadow casters, and the scene runs at 30 fps at 720p with 1024x576 deferred buffers (on Xbox 360).

Is there anything going on in the game that could be affecting the performance?

Also can you take a screen shot with the SunBurn stats on the screen (preferably the lighting, rendering, and scene stats)?  Which version of SunBurn are you using?

Thanks!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 500 Contributor
Posts 4
SunBurn_Pro_Licensee

Thanks for your help, JohnK. I think the problem was related to a lot of overdraw with the lights, and having a lot of complicated geometry, even tho it wasn't all seen on screen at once. Since my original post we've done a restructuring on how the game works: now all irrelevant geometry is turned off based on the player's position, and the problem is pretty much solved. Recreating the light rig to have less overdraw helped significantly.

Page 1 of 1 (5 items) | RSS