What's new in Silverlight 5 beta? 3D graphics support!
Happy Silverlight 5 Beta day! The biggest additions to Silverlight 5 are certainly the support for GPU accelerated video and 3D graphics and the SDK team has been hard at work trying to get samples and documentation together for today. If you're a developer, after downloading the Silverlight 5 beta runtime, SDK, and developer tools, you'll probably want to start playing with the 3D features. In this blog post, I'll point you to the resources we created to help get you started.
Get the Silverlight 5 Beta, Tools, and SDK Now
1) The XNA Math Helper DLL
We expect that the math functions from XNA will be integrated into the Silverlight namespaces in the future, but for Silverlight 5 beta, you'll want to make use of this library instead. Add a reference to this DLL by right-clicking references in your Visual Studio project, clicking "Add Reference," selecting the "Browse" tab and navigating to this DLL's location. Then you can use the original XNA documentation to make use of the math functions contained within. These are a real lifesaver when doing matrix math, creating camera views, changing object positions, etc.
2) 3D Graphics Overview Topic
A high-level overview of the basics, explaining the capabilities provided in this beta release.
3) Textured 3D Cube Walkthrough and Downloadable Source Code
This walkthrough and sample demonstrates how to create a complete Silverlight 5 beta 3D application, including the use of textures, the use of shaders, integration with Silverlight UI elements, and cross-thread synchronizing (between the rendering thread and main UI thread). When completed, you will have created a textured cube that can be manipulated with ordinary Silverlight UI elements (in this case, sliders).
Already have the runtime installed? Here's the Textured Cube sample running live!
4) Reference documentation for the new API areas: Microsoft.Xna.Framework (Silverlight Version), Microsoft.Xna.Framework.Graphics (Silverlight Version), Micrososft.Xna.Framework.Silverlight, and the appearance of DrawingSurface in the System.Windows.Controls namespace.
While XNA developers have enjoyed being able to use managed code to create and apply 3D effects for awhile now, in Silverlight 5 beta, effects are the purview of shaders. This is because the effects APIs from XNA haven't been integrated yet. For now, just as you must workaround the limitations of the beta release by manually importing the XNA math library, so must you write and compile shaders to have effects in Silverlight 5 beta. A minimum of a vertex shader and a pixel shader is required, but as you will see in the textured cube sample, they need not do anything terribly fancy.
We are working on posting some other samples that demonstrate 3D use, and look forward to posting them very soon. Hopefully you got to see the "Babylon" demo (showing the interior of a cafe) during the MIX presentation, featuring full-scene, full-screen, GPU-accelerated 3D. It is really amazing to have an in-browser experience that feels so much like a modern 3D game; truly an example of trailblazing plug-in technology at work!
Comments
Anonymous
April 12, 2011
The comment has been removedAnonymous
April 13, 2011
For Silverlight developers, this new version includes XAML parser improvements that speed up startup and runtime performance. silverlightdevelopment.blogspot.com/.../silverlight-developers-use-cross.htmlAnonymous
April 14, 2011
Live babylon demo: david.blob.core.windows.net/.../Babylon.htmlAnonymous
April 14, 2011
I have install all tools(VS 2010 SP1, Silverlight 5 beta tools, directx sdk, and can not see the live sample. I am on a windows XP. Do I need to install any otherthings to see 3D cube?Anonymous
April 14, 2011
@silverlight user: There could be incompatiblity with Windows XP (a question is out to the product team on that one). Other issues involve not having a supported video card, though most DirectX compatible cards with a GPU should be fine), and the fact that you don't actually list the Silverlight 5 beta RUNTIME (not just the tools) in the things you've installed so far. @David Catuhe: Thanks so much! The Babylon demo blew us away!Anonymous
April 14, 2011
Worth noting is that there is a library called Balder that provides an abstraction on top of this that lets you do everything in Xaml : http://balder.codeplex.comAnonymous
April 15, 2011
@silverlight user, per the product team, XP drivers are blocked for security and compatibility reasons.Anonymous
April 15, 2011
@silverlight user: Got word from the PM: "XP drivers are blocked by default and require user consent. This was necessary for security and compatibility reasons. Check out my MIX session for more info: channel9.msdn.com/.../MED06 "Anonymous
April 15, 2011
Thank you, John and Cheryl. I right-click the silverlight applicaiton and allow the 3D display. Now I see the 3D cube. Good job, silverlight product team! This 3D feature is what I want for a long time.Anonymous
April 17, 2011
The comment has been removedAnonymous
April 26, 2011
The comment has been removed