Resolution and scaling on Windows Phone


Windows Phone includes a hardware image scaler. This allows XNA games to choose what backbuffer resolution they want to draw to, regardless of the physical screen size. You draw at whatever size you like, then the scaler adjusts the resulting image to fit the screen. This is similar to how the video output works on Xbox 360.

Note: scaling was not implemented in the CTP release of the Windows Phone Emulator, but is fully supported in our recent beta version.

 

Things you should know about the scaler

  • The scaler is easy to use: just set graphics.PreferredBackBufferWidth and PreferredBackBufferHeight in your game constructor
  • The resolution can be anywhere from 240×240 up to a max of 800×480 (or 480×800 if you are making a portrait game)
  • If you choose a resolution that does not match the screen aspect ratio, it will be automatically letterboxed (black bars along the edges)
  • Touch input is automatically scaled to match your chosen backbuffer resolution
  • Scaling is implemented by dedicated hardware, so doesn’t cost any GPU
  • Scaling uses a high quality filter (better looking than GPU bilinear filtering)

 

Choose your own resolution

  • 800×480 is a lot of pixels!
  • Comparison: Xbox 1 games usually ran at 640×480, so the phone has 25% more pixels to fill
  • But the phone has a less powerful GPU than Xbox 1 did…
  • 800×480 provides awesome visual crispness for browsing the web, reading email, and simple games with cheap shaders and not much overdraw
  • More complex games can trade resolution for framerate
  • Consider: 600×360 requires only 56% as many pixels to be rendered

Comments (9)

  1. Bill Reiss says:

    Thanks Sean, is this XNA only or does it work for Silverlight too?

  2. Bill Reiss says:

    Oops meant Shawn of course sorry :(

  3. ShawnHargreaves says:

    This is an XNA Framework feature. I don't believe it is supported in Silverlight, but I'm by no means an expert on Silverlight so I could be wrong!

  4. Alan says:

    Playing with PreferredBackBufferWidth and Height, I'm not getting my game stretched on the emulator (though I can see the black bars if I change the aspect ratio).

    I hope it's just a limitation of the emulator, or should I compute sprite positions and dimensions based on the PreferredBackBufferWidth and Height ?

  5. How much worst is the GPU than xbox 1 one ? says:

    Are the DX9 features usuable at all or we have to go down to DX8 level of visual effects to get games working at acceptable frame rates ?

    Thanks

  6. Mike Vargas says:

    "Scaling uses a high quality filter (better looking than GPU bilinear filtering)"

    What if we intentionally want bad (Photoshop calls it "nearest-neighbor") filtering?  Is there an easy way to accomplish this?

  7. ShawnHargreaves says:

    > What if we intentionally want bad (Photoshop calls it "nearest-neighbor") filtering?

    The hardware scaler is not configurable, so if you want more control over the filter type, you'll have to implement scaling some other way rather than using this feature.

  8. ShawnHargreaves says:

    Thanks Shawn, I was just looking for a way to simulate retro-style graphics, which I think would amount to changing the display mode.  Of course, I don't think that's possible. :)

  9. will says:

    sorry to post on such a old thread but it came up

    would turning off anti aliasing and using a small mode fullscreen mode

    or

    small back buffer in windowed mode work then just maximizing the screen