Michael Quandt posted a good tip about entering your WP7 app into Imagine Cup Game Design: basically, don't put your game in the Games Hub! The emulator doesn't include the Games Hub, which means when your .xap file gets deployed to the emulator, your game won't be accessible.
But how to actually fix this? Luckily, it's a simple change: in your project, find the WMAppManifest.xml file and change Genre="Apps.Games" to Genre="Apps.Normal". Now when you deploy your .xap to the emulator, it'll show up in the app list rather than the Games Hub.
Showing posts with label Windows Phone 7. Show all posts
Showing posts with label Windows Phone 7. Show all posts
Sunday, March 27, 2011
Thursday, March 3, 2011
High Quality Dithering for Windows Phone 7
In my last post I showed how to use a 32bpp backbuffer to prevent banding in XNA games. But as it turns out, the WP7 hardware specifications only specify a 16-bit LCD at minimum - and that there are devices out there which only have a 16-bit LCD. (I've heard, but have not been able to confirm, that the Samsung devices suffer especially from this).
In that case, if a device only has an LCD capable of 16bpp, setting a 32bpp backbuffer isn't going to help. Instead, you need to dither your images, which will reduce the bit-depth to 16bpp but in a way which reduces visible banding.
I stumbled across this blog post "Photoshop Action for Windows Phone Dithering", which provides a photoshop script to dither images. It gets the job done, but I noticed that it produces a fairly low-quality dither - the end result is very grainy to my eyes.
A while back when I worked on Metropolitan Melbourne, I wrote my own little tool to dither images because WM6.5 only supported 16-bit colour graphics and I couldn't find any other simple tools for high-quality dithering. My tool is called ReduceBitDepthCPP, and takes an input 24-bit/32-bit image in .png or .bmp format, and reduces it to 16-bit (R5G6B5) colour using the Floyd-Steinberg algorithm. The Floyd-Steinberg algorithm eliminates banding while minimising quantisation error. Here's a comparison picture:
As expected, the undithered gradient has extreme banding. The "Photoshop" image was produced by using the script mentioned earlier. If you look closely, the Photoshop image does get rid of banding but also introduces a lot of noise - which makes the image very grainy.
On the top right is the Floyd-Steinberg algorithm produced by my tool, ReduceBitDepthCPP. It also eliminates banding but does so in a way that doesn't introduce a lot of noise, and the end result looks very close to the original.
You can download ReduceBitDepthCPP below, with source as well. It's free for any use, and the source code is distributed under the MIT license.
ReduceBitDepthCPP.exe C:\Temp\meow_orig.png C:\Temp\meow_dithered.png
If you found this useful, don't forget to follow me on Twitter, and check out some of the stuff on my website!
Happy coding!
In that case, if a device only has an LCD capable of 16bpp, setting a 32bpp backbuffer isn't going to help. Instead, you need to dither your images, which will reduce the bit-depth to 16bpp but in a way which reduces visible banding.
I stumbled across this blog post "Photoshop Action for Windows Phone Dithering", which provides a photoshop script to dither images. It gets the job done, but I noticed that it produces a fairly low-quality dither - the end result is very grainy to my eyes.
A while back when I worked on Metropolitan Melbourne, I wrote my own little tool to dither images because WM6.5 only supported 16-bit colour graphics and I couldn't find any other simple tools for high-quality dithering. My tool is called ReduceBitDepthCPP, and takes an input 24-bit/32-bit image in .png or .bmp format, and reduces it to 16-bit (R5G6B5) colour using the Floyd-Steinberg algorithm. The Floyd-Steinberg algorithm eliminates banding while minimising quantisation error. Here's a comparison picture:
As expected, the undithered gradient has extreme banding. The "Photoshop" image was produced by using the script mentioned earlier. If you look closely, the Photoshop image does get rid of banding but also introduces a lot of noise - which makes the image very grainy.
On the top right is the Floyd-Steinberg algorithm produced by my tool, ReduceBitDepthCPP. It also eliminates banding but does so in a way that doesn't introduce a lot of noise, and the end result looks very close to the original.
You can download ReduceBitDepthCPP below, with source as well. It's free for any use, and the source code is distributed under the MIT license.
Instructions
ReduceBitDepthCPP is a command-line tool, which makes it easier to integrate into your build. To use it:- Extract the files somewhere (eg. C:\Temp\ReduceBitDepth\)
- Open up a command prompt by pressing [win]+[r] and typing in "cmd"
- Navigate to the directory where you extracted the files
- Run ReduceBitDepthCPP.exe using the following syntax:
ReduceBitDepthCPP.exe infile outfile
ReduceBitDepthCPP.exe C:\Temp\meow_orig.png C:\Temp\meow_dithered.png
If you found this useful, don't forget to follow me on Twitter, and check out some of the stuff on my website!
Happy coding!
Labels:
Code
,
Microsoft Student Partners
,
MSPTeam2011
,
Windows Phone 7
,
wp7dev
,
XNA
Wednesday, February 23, 2011
Tip of the Day: 32bpp BackBuffers in XNA
Here's a tip: by default, XNA uses a 16-bit R5G6B5 back buffer format. This causes horrific banding if you use lots of gradients in your game. You can fix this by manually telling XNA to use a 32-bit backbuffer format.
In you Game class's constructor, add this line:
And somewhere in your Game class, add this method:
The difference won't show up in the emulator. But on an actual device, it'll vastly increase your image quality by getting rid of a lot of your banding.
In you Game class's constructor, add this line:
graphics.PreparingDeviceSettings += PreparingDeviceSettingsEventHandler;
And somewhere in your Game class, add this method:
void PreparingDeviceSettingsEventHandler(object sender, PreparingDeviceSettingsEventArgs e)
{
var pp = e.GraphicsDeviceInformation.PresentationParameters;
pp.BackBufferFormat = SurfaceFormat.Color;
}
The difference won't show up in the emulator. But on an actual device, it'll vastly increase your image quality by getting rid of a lot of your banding.
Labels:
Code
,
DevVsDev
,
Microsoft Student Partners
,
MSPTeam2011
,
Windows Phone 7
,
wp7dev
,
XNA
Wednesday, February 16, 2011
SatView for Windows Phone 7 Released!
I'm happy to announce that SatView is now available on the Windows Phone 7 marketplace!
This'll be my entry to the DevVsDev competition. SatView is a satellite tracker and orbit predictor that allows you to track one of 1300+ different satellites as they orbit the Earth. Here's the marketing spiel from my site:
I'll admit that this is a pretty niche app. But still, I think it's cool. :) And remember, if you don't already know, DevVsDev closes in just a few weeks, so you'd better submit fast!

Zune client software required.
This'll be my entry to the DevVsDev competition. SatView is a satellite tracker and orbit predictor that allows you to track one of 1300+ different satellites as they orbit the Earth. Here's the marketing spiel from my site:
SatView is a realtime satellite tracker and orbit predictor. Track satellite positions, determine visibility, and calculate coordinates of over 1300 different satellites.
Included with SatView are both 2D and 3D viewing modes, allowing you to view the orbital trajectories of satellies from space or projected onto a map. SatView can also use your phone's GPS system to determine visibility and to calculate satellite passes over your location. SatView is ideal for budding astronomers and amateurs alike.
Features:
- 1300+ different trackable satellites
- Orbit prediction with adjustable time controls
- GPS and location services support
- Determine all visible satellites from your current location
- Calculate next visible passes of a chosen satellite over your location
- Search function for finding satellites by name or catalog number
- 2D and 3D orbit viewing modes
- Topographic and geocentric coordinates
- Automatic updates for latest satellite orbital data
I'll admit that this is a pretty niche app. But still, I think it's cool. :) And remember, if you don't already know, DevVsDev closes in just a few weeks, so you'd better submit fast!
only US$1.29

More information at microngamestudios.com
Labels:
DevVsDev
,
Microsoft Student Partners
,
MSPTeam2011
,
SatView
,
Windows Phone 7
,
XNA
Subscribe to:
Posts (Atom)

