Bye Bye Declarative Markup Goodness, Hello XNA Portability

XNA available inside of the web in Silverlight ? Some people would probably suggest to you that this is how XNA already works in Windows Phone 7 (the feature just isn’t integrated and exposed to work together, but might be in the future). My guess is this is how that Microsoft has just enabled it inside the Windows plug-in as well.. I suspect this really isn’t anything new and I have even heard Developer Product Evangelist talking before a crowd mentioning XNA running in Silverlight before..
So is this really Silverlight 3D or is it really XNA wearing a Silverlight T-Shirt as a disguise ?
WPF 3D with Rich Declarative Goodness
Before we look at Silverlight 3D, let’s take a look at some of the coolness of WPF 3D that has come before for historic perspective and what designers could actually do with it, which is now significantly more code and more work now without declarative markup (XAML)..
Note:If this video fails to play because the embed tags fail as suggested by Microsoft to use, put your IE browser in compatibility mode and click play again
Or click here to go to the :
http://channel9vip.orcsweb.com/posts/mike+ormond/Creating-3D-Models-for-WPF-Pt4-Smooth-texture-to-WPF-application/
..
Silverlight gets 3D or does it ? Silverlight 3D or XNA Exposed
Silverlight 5’s 3D is far from the 3D goodness that I imagined for Silverlight, because they have essentially taken the programmer path as you would expect with XNA.
My take on this feature on why I am immensely disappointed in this implementation: Microsoft is obviously not committed to a declarative Markup (XAML) future that is a designer friendly story.. FORCE DESIGNERS into VS2010 or 3D 3rd Party Tools. Historically this has been a mistake, will history repeat itself ?
- Minus: I am one of the few people who love WPF 3D.. I can do a lot with enabling 3D applications without resorting to writing C# code.. Has Microsoft forgot about true designers who can literally do a lot with basic 3D without coding in C#. Normal designers who might have a 3D model and want to manipulate in mark-up are left out of the feature. I wish Microsoft had went all the way and given us XAML markup compliant with what WPF 3D does today. It’s one of the most underrated, under used parts of WPF on Windows.
- Plus: XNA now works in a web browser, on Windows Phone 7, PC and X-Box. While I do believe that this new feature gives Silverlight portability between Windows Phone 7 applications and enables XNA applications on the web, you might as well call this XNA for the web. This is a true victory for write once run many places.
- Minus: Lack of Mac support.. Enough said there, but I am sure this is a big deal because it’s a first level complaint that Microsoft will attempt to remedy if they can. XNA hasn’t been available in any form on the Mac so far really so we’ll see here if they are willing to do it and support hardware acceleration on the Mac (which has been hard to do, just ask the Adobe Flash people about that one..)
- Minus: Again no XAML markup that is compatible with WPF3D.. I see this as a major drawback to telling a good designer story. I am getting the feeling that designers really don’t matter to Microsoft and all of us someday are going to end up having to use Visual Studio whether we want to or not.. This brings us closer to that story of design unfriendliness.
- Minus: Shader Model 2… Really ?? In all fairness this is a base level to work on anything including Mac hardware.. It’s sad we are stuck in a Shader Model 2 “compatible” world especially in 2011.. Shader Model 3 would no doubt price us out of the “web” 3d ball game entirely..
- Minus: Is this a true “Silverlight” feature ? Exposing the XNA below and providing an interface is like doing half of the work and half of the story..
- Minus: No great Expression Blend designer story (beyond the placeholders). The programmers, not the designers are in charge..XNA 3D party design tools are required that are expensive to join the party.. WPF 3D had a great Expression Blend story from the start. This starts to look more and more like lets just leave the designer solution out.
- Minus: No compatibility with XAML 3D or the new HTML 5 WEB 3D stuff.
Why weren’t there more WPF 3D Applications if this is so important ?
Simply put Microsoft didn’t spend money promoting this feature. It was pretty much orphaned from the start. Developer evangelists didn’t know how to promote it, and they spent several years just convincing developer base to leave Win Forms to use XAML in the first place, Also it wasn’t a first priority with Silverlight which stole WPF’s thunder and the 3D features went seriously unnoticed.
If you are saying “SO WHAT ?” at this point, consider that Silverlight was supposed to be a web extension of the Windows Application platform and .NET. Instead it’s became it’s own “animal” so to speak. With Silverlight 5 it’s unlikely that many will be producing Windows platform applications, but Silverlight ones ONLY. The web was more popular than Windows platform applications because Microsoft made it their priority to go at their web audience while leaving the . The reality of doing so is that at some point we’ll all be using HTML 5 and no doubt a later variant of Web3D (X3D).
Declarative Markup goodness with HTML 5
(that you can get in WPF 3D but not Silverlight 3D)
I see Silverlight 5’s Web 3D solution as a half-baked solution that isn’t paying attention to standards as they are arriving on the scene, it is an attempt to leverage Microsoft XNA developers (notice I didn’t say designers) to port to Silverlight and the web. So why not add a declarative mark-up ? It maybe something they feel they can’t sell very well.
So what does the rest of the world think about Declarative 3D mark-up for the web ? They love it…

Even the HTML 5 crowd sees a future in declarative markup for Web based 3D…
http://www.web3d.org/x3d/wiki/index.php/X3D_and_HTML5_examples
Here’s an example of declarative 3D markup in the HTML 5 world:

HelloWorld.X3D
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "http://www.web3d.org/specifications/x3d-3.2.dtd">
<X3D profile='Immersive' version='3.2' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'
xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.2.xsd'>
<head>
<meta name='title' content='HelloWorld.x3d'/>
<meta name='identifier' content='http://www.web3d.org/x3d/content/examples/HelloWorld.x3d'/>
</head>
<Scene>
<Group>
<Viewpoint centerOfRotation='0 -1 0'
description='Hello world!' position='0 -1 7'/>
<Transform rotation='0 1 0 3'>
<Shape>
<Sphere/>
<Appearance>
<Material diffuseColor='0 0.5 1'/>
<ImageTexture url='"earth-topo.png"' />
</Appearance>
</Shape>
</Transform>
<Transform translation='0 -2 0'>
<Shape>
<Text solid='false' string='"Hello" "world!"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material diffuseColor='0.1 0.5 1'/>
</Appearance>
</Shape>
</Transform>
</Group>
</Scene>
</X3D>
Hello World.xaml (in WPF 3D) thanks to WPFTUTORIAL.NET for this quick example (quoting):

<Viewport3D>
<Viewport3D.Camera>
<PerspectiveCamera Position="-40,40,40" LookDirection="40,-40,-40 "
UpDirection="0,0,1" />
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<Model3DGroup>
<DirectionalLight Color="White" Direction="-1,-1,-3" />
<GeometryModel3D>
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="0,0,0 10,0,0 10,10,0 0,10,0 0,0,10
10,0,10 10,10,10 0,10,10"
TriangleIndices="0 1 3 1 2 3 0 4 3 4 7 3 4 6 7 4 5 6
0 4 1 1 4 5 1 2 6 6 5 1 2 3 7 7 6 2"/>
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<DiffuseMaterial Brush="Red"/>
</GeometryModel3D.Material>
</GeometryModel3D>
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
Questions ? Questions ?
While I see that XNA available through Silverlight makes XNA accessible literally everywhere and it’s a great thing for XNA programmers is this really a good thing for Silverlight developers ? It does bring a level of parity for 3D in the Microsoft developer community, but I am still left with several major questions..
- Why leave designers who want mark-up out ?
- Besides the obvious portability with windows phone why stick with just XNA ?
- If you can’t offer us XAML mark-up why not offer us the 3D compatibility with markup from the Web3D consortium so that we can easily port these apps later to HTML 5 supported environments if Microsoft is really interested in web interoperability.. With HTML 5 being a standard this would make more sense to leave us with some type of option.
3D has been a thorn in the side of the Silverlight developer team for years. This solution offers parity with web plug-in Silverlight and what they are doing on Windows phone, all of this at the expense of a good markup designer story that will let common developers really embrace 3D in the UI. The only reason WPF 3D didn’t work out was bad promotion and management decisions, not that it wasn’t/isn’t a good thing today.. In fact WPF 3D is being used today in cancer research and doing some pretty important things for visualization there.
The Expression Blend Factor
If you want to know just how easy it is to use Blend in the past with WPF 3D to do something without a lot of code, check this out..
The Mix 11 Presentation
http://channel9.msdn.com/Events/MIX/MIX11/MED06
Anyway here is the Mix 11 Presentation it has great information on Silverlight 3D from Mix 11. Clicking the “Play Button” that’s obscured in the image below should open this for you to view the content double click to make it full screen.…
.
If you wish to download the content try the following links:
MP4 | Medium Quality WMV | High Quality WMV