Windows Phone Graphics Speedup with BEPUphysics
/
The folks at BEPU have made a wonderful 3D physics engine for XNA on Windows Phone. You can see it in action above.
And they’ve now ported it onto Windows Phone. I’ve downloaded the demo software onto my device and initially it ran rather slowly. However, Windows Phone has a lovely trick which makes it unique amongst mobile devices. You can set the display resolution to a lower value and hardware autoscales it to fit the screen of the device. This is great for two reasons:
- It means you no longer have to write games to fit a particular screen size
- You can get a performance hike by rendering to a smaller screen and having it scaled up
You set the resolution that you want in the constructor of your game object in the XNA game. I asked for the lowest resolution:
// Pre-autoscale settings.
graphics.PreferredBackBufferWidth = 240;
graphics.PreferredBackBufferHeight = 400;
I had to do some fiddling with the display to make the buttons work (you can find out more here) but the result was a physics display that looked lovely (and only a tiny bit blurred).
If you want to get your hands on some ready made 3D physics (with very generous licensing terms) then you should head over to BEPU.
If you want to speed up your XNA game on Windows Phone (or make it future proof as far as resolution is concerned) then you should start using the settings above.