Resolution and scaling on Windows Phone

Resolution and scaling on Windows Phone

  • Comments 9

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 240x240 up to a max of 800x480 (or 480x800 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

  • 800x480 is a lot of pixels!
  • Comparison: Xbox 1 games usually ran at 640x480, so the phone has 25% more pixels to fill
  • But the phone has a less powerful GPU than Xbox 1 did...
  • 800x480 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: 600x360 requires only 56% as many pixels to be rendered
  • Thanks Sean, is this XNA only or does it work for Silverlight too?

  • Oops meant Shawn of course sorry :(

  • 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!

  • 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 ?

  • 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

  • "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?

  • > 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.

  • 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. :)

  • 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

Page 1 of 1 (9 items)
Leave a Comment
  • Please add 5 and 2 and type the answer here:
  • Post