XNA Creators Club Online
Page 1 of 1 (13 items)
Sort Posts: Previous Next

FPS issue with 720p and 4AA

Last post 9/22/2008 5:45 PM by HerrUppoHoppa. 12 replies.
  • 9/18/2008 4:40 PM

    FPS issue with 720p and 4AA

    Hi everyone,

    I have written that little engine that renders some models and when I render with 800x600 pixels I get 60FPS.

    When I leave everything the same, (even the multisampling at 4) and change the backbuffer to 1280x720 I get exactly have of the FPS, 30FPS.

    Can that really be? What could possibly cause that FPS reduction by 50%?

    I use the following techniques: ShadowMapping (PCF), ReflectionMapping, XboxHardwareInstancing for 2 Models with around 150 instances

    There are only 2 additional RenderTargets, one for the ShadowMap (2048x2048) and one for the ReflectionMap (backbuffer-size).

    Cheers

  • 9/18/2008 4:48 PM In reply to

    Re: FPS issue with 720p and 4AA

    It's partially because going from 800x600 to 1280x720 is nearly doubling the number of pixels you are rendering:

    800x600 = 480,000 pixels
    1280x720 = 921,600 pixels

    Not to mention those are values without multisampling so yours will actually be a bit higher. This means all those pixel shaders you are running now run more and could potentially be bottlenecking you.

    That probably isn't quite the entire cause (I doubt double pixels = half framerate). I'm guessing you have vertical sync on which means the game will only ever operate at a frame rate divisible into 60 (for 60Hz, the usual monitor/TV refresh rate). So once you have enough rendering going on that your game cannot stay at 60fps, it will drop to 30, then 20, then 15, and so on.

    To fix this you will want to profile and see what drawing routines are causing the most damage and decide which ones you can do without. If there's nothing you want to cut, you'll have to consider toning down the multisampling to 2 or 0, or going to a lower resolution.

  • 9/18/2008 6:26 PM In reply to

    Re: FPS issue with 720p and 4AA

    I doubt double pixels = half framerate

    Actually, that is almost entirely the case. The only case when that doesn't hold, is if you get texture magnification on the higher resolution, so that you don't double the texture read rate when doubling resolution.

    Also, if you have a 64-bit graphics chip (GeForce n400, n300, etc, Radeon n400, n300, etc) or an integrated graphics controller (Intel Extreme, Intel GMA or Intel G45) then you will be very fill rate limited. Meanwhile, the Xbox has a lot better fill rate. My laptop has a GeForce 7400, and I have to run some scenes at 426x240 to get full frame rates, but they run OK on the Xbox.

    You can easily tell if you are fill rate limited by just varying the window size. If a really small window makes it run just fine, then you are fill rate limited. If the really small window runs slow, then you're either CPU limited (likely) or vertex limited.

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 9/19/2008 9:23 AM In reply to

    Re: FPS issue with 720p and 4AA

    Thank you for your replies.

    The thing Nick points out with using vertical sync perfectly makes sense and is most likely the reason for my 50% FPS reduction.

    I'm still surprised that the Xbox is not managing to render my engine at 60FPS because there is not much I do. But I will try and find some cuttoffs I can make.

    I will most likely just turn off vertical sync since it is not crucial for my project (a board game).

    Another experience I want to share with you; yesterday evening I tried to run my engine on my 32" LCD (1080i set for xbox) at home and I was surprised about the result.

    When I set the backbuffer programatically to 720p using PresentationParameters.BackbufferWidth/Height it will render at 30FPS. Window.ClientBounds.Width/Height correctly tells me that I have 720p.

    The only RenderTarget I'm instancing using PresentationParameters.Backbuffer.Width/Height is then also 720p.

    But when I'm NOT telling the GraphicsDevice anything about the Backbuffer size, it will render the scene at 60FPS while the Window.ClientBounds.Width/Height tells me that its rendering at 1080p, while the PresentationParameters.Backbuffer.Width/Height is at 800x600.

    I have a hard time understanding that behavior. How can the BackBuffer be at 800*600 (different aspect ration) while the screen is rendering at 1080p? The result is perfect and runs at 60FPS, but if I don't set the Backbuffer I don't have the option to tell the xbox to render the game at 720p when the display (e.g. computer monitor) supports more than 800*600. Or is there another way?

    Thank you for sharing your experience with me.

  • 9/19/2008 2:03 PM In reply to

    Re: FPS issue with 720p and 4AA

    The backbuffer can be pretty much any size you like on Xbox. It doesn't have to be the same size as the output video signal (which is what gets reported via Window.ClientBounds). The hardware will scale the image if the two sizes are not the same.
    XNA Framework Developer - blog - homepage
  • 9/19/2008 7:07 PM In reply to

    Re: FPS issue with 720p and 4AA

    joscht:

    I have a hard time understanding that behavior.

    A lot of TVs have really bad upscalers and introduce an unaccetpable delay between user input and onscreen action, which can be upwards of 2 seconds behind. They are that bad. So 360 scales the output to the tv's native resolution, and skips around that problem completely.

    return;
  • 9/19/2008 7:32 PM In reply to
    • (2342)
    • premium membership MVP
    • Posts 1,226

    Re: FPS issue with 720p and 4AA

    Your problem may not even be related to fillrate or pixel processing.  Whenever you're rendering to a render-target, you have to mindful of whether predicated tiling will be active and how many tiles it will require.  In the case of 1280 x 720 with 4xMSAA, you're going to need 3 tiles.  What this means is that any Draw call that results in pixels being drawn on multiple tiles will have to be made multiple times.  In your case you're using instancing to render a lot of stuff in one Draw call, which means your geometry for that call is likely to be scattered all over the screen.  This means chances are very good that your call will be duplicated for each extra tile.  Keep that in mind for your shadow map too, 2048 x 2048 requires 4 tiles to render. 

    I suggest keeping track of how many DrawPrimitive calls you make every frame, and displaying the counter to the screen.  It's a number you'll always want to keep an eye on when evaulating performance, especially on the 360.
    Matt Pettineo | DirectX/XNA MVP


    Ride into The Danger Zone | PIX With XNA Tutorial
  • 9/22/2008 9:02 AM In reply to

    Re: FPS issue with 720p and 4AA

    Thanks to all of you for helping me understand.

    If I got it right you were saying that if I set the rendertarget to 800*600 and run the game on a 1080p screen the xbox will upscale the result to fit that resolution, right?

    Is there any way to actuallty tell the xbox to upscale to a specified resolution?

  • 9/22/2008 9:24 AM In reply to

    Re: FPS issue with 720p and 4AA

    joscht:

    Is there any way to actuallty tell the xbox to upscale to a specified resolution?

    The Xbox will upscale to whatever resolution the user has chosen in their system settings. Your game cannot change this.
  • 9/22/2008 3:35 PM In reply to

    Re: FPS issue with 720p and 4AA

    Nick Gravelyn:
    The Xbox will upscale to whatever resolution the user has chosen in their system settings. Your game cannot change this.
    Does this mean that whatever resolution I choose for my game will work on the Xbox, no matter what TV they use or which resolution they have chosen? So I could at startup just make a choice between two resolutions, one for wide screen and one for 4:3 aspect ratio and it will work on any Xbox configuration?
  • 9/22/2008 4:16 PM In reply to
    • (2342)
    • premium membership MVP
    • Posts 1,226

    Re: FPS issue with 720p and 4AA

    HerrUppoHoppa:
    Nick Gravelyn:
    The Xbox will upscale to whatever resolution the user has chosen in their system settings. Your game cannot change this.
    Does this mean that whatever resolution I choose for my game will work on the Xbox, no matter what TV they use or which resolution they have chosen? So I could at startup just make a choice between two resolutions, one for wide screen and one for 4:3 aspect ratio and it will work on any Xbox configuration?


    For the most part, yes.  I believe the one exception is that 1920 x 1080 won't be scaled down to 480p, or least I've seen people here mention that this is the case.
    Matt Pettineo | DirectX/XNA MVP


    Ride into The Danger Zone | PIX With XNA Tutorial
  • 9/22/2008 4:29 PM In reply to

    Re: FPS issue with 720p and 4AA

    MJP:


    For the most part, yes.  I believe the one exception is that 1920 x 1080 won't be scaled down to 480p, or least I've seen people here mention that this is the case.

    1080p won't be scaled down to 480i i.e. if the end user is on a composite output. The scaler just doesn't handle that and you get a very odd error about reinstalling DirectX on the xbox.... always makes me laugh...

    See the bottom of this help page http://msdn.microsoft.com/en-us/library/bb203889.aspx

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 9/22/2008 5:45 PM In reply to

    Re: FPS issue with 720p and 4AA

    Cool then I should be safe never going above 720p seeing as how I cant seem to get a decent frame rate at 1080p anyway.

    Thanks alot.


Page 1 of 1 (13 items) Previous Next