Dream Build Play 2017

Dream Build Play is back!

Back in 2007 Microsoft had the first Dream Build Play contest. Yes, 10 years ago. Then it went away for a while … like 7 years or so…

But it is back! And I’m excited about it.

You can check it out here, or get a little history lesson and learn about something new by watching the video below:

Microsoft Really Wants Your Feedback

I’m writing this blog post from a hotel room in Seattle. I’m attending the Microsoft MVP Summit. To attend this summit, you have to be a Microsoft Most Valuable Professional (MVP).

I was fortunate enough to receive this award from Microsoft back in 2009 and every year since then.
Originally, I received this award for DirectX/XNA. I’ve written a few books and two of them were on game programming using XNA. XNA was the game programming framework created by Microsoft that powered the vast majority of Indie games available on the Xbox 360.

Folks who have a large XNA library code should take a good look at MonoGame.
For those who don’t, should look at another game engine like Unreal or Unity.

If you want to do HoloLens development, I’d highly suggest you get going with the Unity engine.

One of the big benefits of being a Microsoft MVP is that you get to meet the product teams at Microsoft and provide feedback.

Here’s a secret…

If you are into web development at all …

If you want to know what it’s like to be a MVP, then watch the weekly stand-ups of the ASP.NET team. The work is done in public and everything is open source. Your feedback can be heard. You don’t need to be a MVP to talk to the product team.

User Voice is another great way to get in front of the product teams.

The Forums is another great way to get in front of the product teams.

If you have a suggestion for Microsoft, you can make it heard all of those ways. You don’t have to be an MVP to get your voice heard.

Microsoft is very big on feedback. They want to make products that you want. So if you see something that should be done better, let them know!

It’s a great privilege to be able to come out to Seattle every year and meet with the product teams. I’m hoping I’ll be fortunate enough to be able to attend next year.

I’ve heard over and over again so far this week from Microsoft that they want feedback. And it is true, they take the feedback and they make products and/or product changes because of the feedback.

It is a great time to be a software developer. HoloLens and augmented reality is really exciting. I’m grateful that a great community is building in the Learn HoloLens site.

If you are interested in HoloLens development, make sure to check out the Learn HoloLens site and sign up for the notification list.

If you are wondering if you should get into software development in general, then go check out code.org and try it out. You just might like it… and being able to tell the computer what to do is a pretty satisfying feeling!

I made a companion video to this blog post, which you can see below:

XNA Game Studio 3.0 Unleashed book source code updated to work with MonoGame and Windows 10

 

image_thumb[2]

 

XNA Game Studio 3.0 Unleashed Code updated to Run under Windows 10 (and HoloLens)

I’ve gone through the first pass of updating the code in the book. This took quite a bit of time. Some of the chapters are still a little wonky as I’ve ran out of time. But I wanted to get what I have done out into the public in case it was beneficial to anyone. I never really thought I’d update the code for the XNA Game Studio 3.0 Unleashed book. There were a lot of breaking changes between XNA 3.1 and XNA 4.0 and I just didn’t have the time to do it.

However, with my HoloLens being ordered, and hearing Tom Spilman on .NET Rocks last week (http://www.dotnetrocks.com/?show=1283), I decided to see what it would take to upgrade. It was surprisingly simple to get quite a few chapters converted and upgraded. Other chapters were just not attempted (like Networking stuff that isn’t directly in MonoGame [they expect you to use other libraries]). Others had to be commented out to work (like the GameServices stuff to bring up the Xbox Guide, etc.)

Still, the overall conversion project was a success. There a couple of rough edges, but now anyone can fork it and do what they’d like with it. Feel free to send a pull request, if you smooth out a rough edge. Try to keep with the original intent with the code as much as possible.

Go ahead and grab the code from GitHub:

https://github.com/kewlniss/XNAUnleashed

The Table of Contents for the book this code goes with can be found at http://xnaessentials.com/unleashed

Updating PixelShaders from ps_1_0 to ps_4_0 and a Warning

As I’m going through and updating the code I ran into a following snag that took me a bit to figure out. In this case, I only had a Pixel Shader and no Vertex Shader. The shader worked just fine back in the day, but during the upgrade I was told that MonoGame only supported ps_4_0 and this shader was version 1.0 (ps_1_0).  Simply changing the version number in the shader file fixed that.

But then I had a bug where the shader wasn’t giving me the results I wanted.

After poking around a little bit, I finally found out that the method signature needs to explicitly have all of the parameters.  I found this information here:

http://www.software7.com/blog/pitfalls-when-developing-hlsl-shader/

 

The way my pixel shader looked original was:

 

sampler TextureSampler;

struct PixelInput
{
    float2 TexCoord : TEXCOORD0;   
};

float4 pixelShader(PixelInput input) : COLOR
{
    float4 color = tex2D( TextureSampler, input.TexCoord);
    return( color );
}

technique Default
{
    pass P0
    {
        PixelShader = compile ps_1_1 pixelShader();
    }
}

 

And I had to change it to:

sampler TextureSampler;

struct PixelInput
{
    float4 Pos : SV_POSITION;
    float4 Color : COLOR0;
    float2 TexCoord : TEXCOORD0;
};

float4 pixelShader(PixelInput input) : SV_TARGET0
{
    float4 color = tex2D( TextureSampler, input.TexCoord);
    return( color );
}

technique Default
{
    pass P0
    {
        PixelShader = compile ps_4_0 pixelShader();
    }
}

 

Once I made that small tweak (added in the different parameters (albeit through a struct)) it worked like a charm. A struct doesn’t have to be used, but the parameters should be in the right order it seems – position, then color, then texture coordinates.

 

Note, that this pixel shader doesn’t do anything but return the pixel of the texture passed to it.  Typically you would do some math on the color before returning it. Check out Chapter 15, under SimpleGame for some different pixel shader examples when I update the code to GitHub. (Before the end of the month…)

 

So make sure that your pixel shader parameters are all present and associated with the right semantics!