XNA 3.1 released!!

XNA Version 3.1 was recently released and can be downloaded from here:
 
The new version adds a lot of great functionality! This includes Avatar support, XNA Live party support, Video Playback, Updates on the Audio API and the content pipline, and XAC3!
 
I’m currently trying out the new features and will share some of my experiences when I get so far. 🙂
Posted in XNA | Leave a comment

Workshop on XNA/HLSL 11.06

Now that the summer is here, a lot of students are working on their own projects. A team working on a project for DreamBuildPlay 2009 asked me to hold a workshop for them, helping them getting started with HLSL and implementing a shader library into their own project.
 
In this workshop I will learn them the basics of HLSL and how to replace the Basic shader they are using now, with their own. Also, we will implement the lighting functionality they are using now, with their own shader, making the project continue where they are now, but with their own shaders instead of the built in shader!
 
So, if you are working on a project that needs some help with anything, I would be glad to help out by holding a workshop and learning you how to implement what you want( If I know how ;P ). Just send me a mail and I’ll see what I can do!
 
Ohwell, back to work 🙂
Posted in XNA | 2 Comments

Some updates

Been another busy week and another to come as we are in the middle of going live on the project I’m working on, but I still managed to use some time on XNA. I have been working on the next Game Camp user group we are going to have, and on Balder.
 
The next Game Camp user group will contain a session by me and Thomas Beswick where we go from getting a game idea, designing it, implementing it, testing it and publishing it. The game will be quite simple( but not as simple as pong ++), but still fun to play, with a few levels and so on. The presentation will learn you something about design, what to do with your ideas, how to make concept art and use photoshop and 3d modeling tools to make graphics for you games, and implementing it using XNA/C#.
 
Ziggyware.com have continued posting my tutorials on his site, and as many as 13 are now added. This is cool as we help distributing them, making more people aware of XNA and its capabilites. Also, some of my tutorials are postet on other sites in various languages. I might make an overview on this blog so you can find them all in one place, but I will need some time to locate them as some are posted without notifying me.
 
My tutorials on Ziggyware can be found here: http://www.ziggyware.com/articles.php?cat_id=6
 
I still work on the HLSL tutorial, but are working on the Artifical Intelligence tutoriasl as well.
The first tutorial will cover some AI in general and what I will start covering in the AI tutorial, and my next HLSL tutorial( working on it now) is covering Vertex displacement. 😉
 
 
New to XNA and Want to know more? These pages will get you started!
Posted in XNA | Leave a comment

Special LiveMeeting session with Scott Guthrie

I’m currently attending the special live meeting session with Scott Guthrie. So far, I find it really interesting and I hope one of my questions will be answered!
 
A lot of good questions have been asked and answered, and I finally know some cool stuff that will happen in the future. 😉
 
( More to come ;P )
 
 
 
Posted in Technology | 1 Comment

Kiteboarding

A pretty cool video about kitesuring, I like some of the effects 🙂

YouTube – Calibrate
 

Posted in General | Leave a comment

My tutorials on Ziggyware XNA

Today http://www.ziggyware.com/ started adding my tutorials on their site. This is a really cool thing as the site is very popular and my tutorials will be reaching out to many more people than it would from just my blog on its own.
 
The first tutorial is already done and can be read here:
http://www.ziggyware.com/readarticle.php?article_id=256
 
Thanks, Ziggy! 😉
 
 
I have used quite a lot of time this week on working with the next Game Camp event and making a cool example game we will make during the event. The more time we use on this, the more I’m looking forward for the next event. Be sure to be there if you are near Oslo in mid august( Date will come soon )!
Posted in XNA | Leave a comment

XNA Shader Programming – Tutorial 22, Transition: Fade

XNA Shader Programming
Tutorial 22 – Transition: Cross
Hi, and welcome to Tutorial 22 of my XNA Shader Programming tutorial. Today I will present to you the 2nd transition tutorial, where I will play one scene, and then fade in to another one using a simple post process shader!
 
The effect we will see today is a basic transition effect, where the scene transition will "cross" into another one.
 
 
The Cross transition
The cross transition will go from one scene into another one, using a "line" that is where the fade is.
In the figure below[22.1], scene B is playing, and scene A is crossing in, resulting in scene A playing.
Fig 22.1
 
Implementing the shader
As in tutorial 21, we need to have two textures in our shader, one for each scene you want to fade between, and then you will need to have a variable that will be used to tell how far in the fade we are.
This variable must be between 0 and 1, and when the variable is 0, Scene A will play, and when its 1, Scene B will play.

Lets start writing the cross-transition shader:

sampler ColorMapSampler : register(s0);

texture ColorMap2;
sampler ColorMapSampler2 = sampler_state
{
   Texture = <ColorMap2>;
   MinFilter = Linear;
   MagFilter = Linear;
   MipFilter = Linear;  
   AddressU  = Clamp;
   AddressV  = Clamp;
};
 
float fFadeAmount;

Here we define two texture samples, ColorMapSampler1 and ColorMapSampler2, and both will contain a scene that we will fade between using the variable named fFadeAmount. The texture samplers is defined in two different ways, and is explained in a previous tutorial.

 
Now, we are ready to implement the pixel shader.
// Transition
float4 PixelShader(float2 Tex: TEXCOORD0) : COLOR
{
 float4 Color = tex2D(ColorMapSampler, Tex); 
 float4 Color2 = tex2D(ColorMapSampler2, Tex); 
 
 float4 finalColor = lerp(Color,Color2,smoothstep(fFadeAmount,fFadeAmount+fSmoothSize,Tex.x));
 
 // Set our alphachannel to fAlphaAmount.
 finalColor.a = 1;
  
 return finalColor;
}
 
This shader is almost exactly the same as the one in tutorial 21, except from the following line:
float4 finalColor = lerp(Color,Color2,smoothstep(fFadeAmount,fFadeAmount+fSmoothSize,Tex.x));
Here we use a function named smoothstep(a,b,x) that will return a value between 0 or one based on a,b, and x. The smoothstep function returns 0 when x is below a, and 1 when x is above b, and something in between when x is between a and b.
Fig 22.2
 
We then use the smoothstep, using Tex.x as x, and fFadeAmount as a, and fFadeAmount (fSmoothSize is set to 0) as b, making a sharp on the transition. You can use the fSmoothSize to make the transition smoother, making b larger than a.
This function will return [0,1] based on Tex.x, and use this as the control value in the lerp function, making a nice cross transition!
 
Note: When fSmoothSize is > 0.0, and fFadeAmount = 0, we will still be able to see fSmoothSize part of the scene displayed when fFadeAmount = 1, because our fade starts at fFadeAmount and stops at fFadeAmount( 0 ) + fSmoothSize.
 
Using the shader
When we want to use the shader, we will need to render the two scenes we want to fade between in to a texture, and pass them in to the shader:
spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.SaveState);
{
    // Apply the post process shader
    float fadeBetweenScenes = ((float)Math.Sin(m_Timer) * 0.5f) + 0.5f;
    effectPost.Parameters["fFadeAmount"].SetValue(fadeBetweenScenes);
    effectPost.Parameters["ColorMap2"].SetValue(Scene2Texture);
    effectPost.CommitChanges();
    effectPost.Begin();
    {
        effectPost.CurrentTechnique.Passes[0].Begin();
        {
            spriteBatch.Draw(SceneTexture, new Rectangle(0, 0, 800, 600), Color.White);
            effectPost.CurrentTechnique.Passes[0].End();
        }
    }
    effectPost.End();
}
spriteBatch.End();
 
What we do here is to use the texture set when rendering the sprite as SceneA and another texture set by a parameter to the shader as SceneB, and then we have a periodical function to fade between these based on a given timer, so fFadeAmount is somewhere between 0 and 1.
 
Posted in XNA Shader Tutorial | 2 Comments

Game Camp after the summer

I have spent a lot of time planning the next Game Camp event.
 
Two new Game Camp User Groups will take place at NITH, Oslo after the summer( mid august? )( more information to come ).
This time we will have more speakers, and an interesting agenda with topics for programmers, designers, artists and general game programming. I will not yet post the speakers but it will be pretty cool so be sure to come! 😉
 
These two user groups will be open for all, and one of them will be a part of NITHs "onboarding" program for new students and their "Fadder" week, which is really exiting. I’m looking forward for this event and I hope many of you have the opportunity to come.
Posted in Game Camp | 3 Comments

An update on Grill Simulator!

Grill Simulator is moving towards a finished product, and will be delivered to PeerReview this week.
 
Changes:
– Navigation is modified ( but not completly )
– Better tutorials ( Please follow this in order to understand the navigation )
– Many bugs are fixed( all from last Test and Peer review )
– New in-game music added
Posted in Grill Simulator 360 | Leave a comment

Tutorials on Artificial Intelligence

I was thinking that I want to start another tutorial series, but this time on Artificial Intelligence in XNA!
I see there are many topics and questions regarding this on various forums, and as I know something about AI, I might as well get it on paper and share it.

Is this something that would be interesting?

 
Note: This does NOT mean that my shader tutorial series will stop.
 
 
Anyway, my visitors have left and I’m back blogging, coding and writing tutorials.. 🙂
Posted in XNA | 9 Comments