Silverlight 5 brings XNA 3D to the web

Originally posted to Shawn Hargreaves Blog on MSDN, Wednesday, October 5, 2011

I have been remiss in not mentioning this on my blog before, but if you are an XNA developer who hasn't been paying attention to Silverlight 5, now might be a good time to start!

A quick history:

This is still not all of XNA (for instance there is no Game class) but with this new toolkit, enough pieces are the same that porting existing Xbox or Windows Phone games to the web can be quite easy.  It took us just a few hours to port several existing XNA samples, which are included in the toolkit (Toolkit/Sep11/Source/Sample source code.zip):

image

If you want to use the Content Pipeline in a Silverlight 5 app, you will also need to install XNA Game Studio 4.0 on your development PC.  But don't worry, this doesn't mean you will have to redistribute XNA to your web clients, or have it installed on every computer that runs the app.  Remember this diagram from an old article about the Content Pipeline:

Untitled_959e27ef-8b80-42e7-b2df-102e4f20199c

The way this works with Silverlight 5 is that the blue boxes, which run at build time on your development PC, use the original XNA Game Studio 4.0 Content Pipeline assemblies.  Only the red boxes, which execute at runtime on the client machine, use the new code from the Silverlight Toolkit.  This is similar to when you build an XNA game for Xbox or Windows Phone, but the remote device is now a web browser.  If you are extending the Content Pipeline to add new types, you will need to provide both an XNA version of these types for use at build time, and also a Silverlight version for runtime.  Check out the Silverlight port of the Skinning sample for an example of how to set this up.

I don't normally name names, as I'm lucky to work with so many talented people and this blog is my chance to take credit for all their hard work :-)  But in this case I want to give a shout out to Aaron Oneal and David Catuhe, who went above and beyond to pull all the pieces together and make this happen.  Nice job guys!

Blog index   -   Back to my homepage