Grill Simulator presentation @ TG09

Grill Simulator is finally getting pretty much done!
 
I had a presentation of Grill Simulator in front of 5000 ppl and I think I got a pretty good response so Im happy with it. The presentation was more of a talkshow where we discussed the functionality of the game!
 
If there are anyone at The Gathering who want to play the game, just contact me and ill give you a beta version!
 
 
Posted in Game programming | 1 Comment

Mentor channel on IRC

We have a mentor channel on Efnet, irc, where you can come and ask all kinds of questions and get answers from many skilled programmers, artists and musicians.
 
You can find us here:
#tg-creativia, EFnet where my nick is digierr.
 
Also, there are a section on all mentors in the following magazine:
http://www.gathering.org/tg09/files/content/tng/TheNewsGathering2009_nr1.pdf
 
Here you can read about the gathering and get some information about the mentor system. Be sure to take a look 🙂 ( On norwegian )
Posted in Demoscene | Leave a comment

All tutorials updated

All tutorials are now updated with a more commented version of the shaders! This makes them a little easier to understand if you dont follow the tutorial text.
Posted in Game programming | Leave a comment

An update on Grill Simulator

This week have mostly been work, work and work, but I have managed to use a few hours on Grill Simulator.
 
The game have been trough a balancing process, and made harder. New items, clothes and food have been added and some more known bugs are now fixed.
 
I still got some missing data when saving the game but I know how to fix this, and hope that we will start the release process around April 12th. I’m really looking forward to this, just to get this project out of my hands, and start on new things!
 
Btw. I will finish my newest tutorial during this weekend!
Posted in Game programming | 23 Comments

PodCast with Scott Bilas

If you got a few minutes, I encourage you to listen to Einar Ingebrigsten talk about games with Scott Bilas from Loose Cannon Studios ( And, one of the developers behind Dungeon Siege ).
 
Listen to it on Einar Ingebrigstens blog:
Posted in Game programming | 1 Comment

WebCast with Scott Hanselman

I’m currently listening to the WebCast Einar Ingebrigtsen arranged with Scott Hanselman last week and I find it really funny and interesting.
 
You can read more about it on Einar Ingebritsens blog, and listen/download the audiofile as well as watching the video. If you want to know something about Scott and his lifestyle, I encourage you to listen to this:
 
Posted in Technology | 1 Comment

Mentor at The Gathering 2009

I’m going to be a mentor at The Gathering 2009, and will be available on the stand and on IRC during the event( 8-12. april ).
So, if anyone want to come and say hi, please do so!
 
If you want to start programming or make demos, games and so on, the Workshop at The Gatheirng will be the place to go! Here you will have the possibility to ask qeuestions, get help to get started and chat with many experienced programmers, artists, musicians and 3d modelers.
 
 
 
 
See you at The Gathering 2009! 😉
Posted in General | Leave a comment

Lots of e-mail

I get a lot of e-mails with questions about writing new tutorials and a lot of positive and constructive feedback( trying to answer them all ;P )!
I just want to thank you all for this, it means a lot to me that somebody actually reads my tutorials/blog. Oh, and I’ll try to prioritize what tutorials to write next.
 
 
An update on Grill-Simulator 360:
Today I fixed some minor bugs in grill simulator, and changed some of the functionality. Things are looking good for the project, and the team got a great spirit 😉 The release of Grill Simulator will be very rewarding for me and my team as its our first big release, with a lot of followers. Yeah, I have been creating games before but nothing is as complete/big as this game. The feeling of getting something released is just great, whatever it is, tetris clone, snake, 3d fps and so on 🙂
 
 
 
Anyways, I’m off for tonight.
Cheers!
Posted in XNA | Leave a comment

XNA 3.1 announced

There is not much details about XNA 3.1, but at least it’s official that this release will include customized avatars, new audio APIs and video playback. I can’t wait untill I get my hands on this but I guess I just need to have some patience 🙂
 
 
As for now, I will continue working on Grill Simulator in order to complete this before Easter 🙂
Posted in XNA | Leave a comment

XNA Shader Programming – Tutorial 8, Gloss map

XNA Shader Programming
Tutorial 8 – Gloss map
Hi, and welcome to tutorial 8 of my XNA Shader Tutorial series. Today I’m going to give you better control on you specular highlights by implementing something called "Gloss map".
 
So, what is a gloss map?
A gloss map is really just a black and white texture. Our goal is to use this texture to say how much a texel/surface will reflect at a particular point, and a black and white texture gives us an easy way to do this.
Colors in a shader is given by the following format: r,g,b where each component can range from 0.0 to 1.0.
 
Also, having a black and white texture means that each component got the same value:
White=(1,1,1)
Light gray=(0.8,0.8,0.8)
Dark gray=(0.2,0.2,0.2)
Black=(0,0,0)
 
Glossmap example:
 
We want the specular highlight to be strongest where the color is white, gradually reducing at different levels of gray, to none specular highlight where the color is totally black.
 
Implementing the shader
We need to load the Specular highlight texture in XNA and pass it to the shader. From the shader, we need to take the glossmap color from the texel we are working on and store it in a variable:
 
float4 GlossMapColor = tex2D(GlossMapSampler, Tex);
 
 
Now, we need to use the GlossMapColor in order to decide how much specular color the texel will reflect:
// R = 2 * (N.L) * N – L
float3 Reflect = normalize(2 * Diff * Normal – LightDir); 
float Specular = pow(saturate(dot(Reflect, ViewDir)), 20); // R.V^n
 
Now, notice that we have the maximum specular highlight stored in the variable "Specular". In order to reduce this, we need to somehow modify "Specular" in order to reduce it to the level we want. So how do we do this? You guessed right, by multiplying the Specular color with the GlossMapColor.
 
Now, remember GlossMapColor contains the black and white value of our glossmap texture, so each rgb-component got the same value.
This makes it possible to just use one of the components, and multiply it with "Specular" like this:
 
// R = 2 * (N.L) * N – L
float3 Reflect = normalize(2 * Diff * Normal – LightDir); 
float Specular = pow(saturate(dot(Reflect, ViewDir)), 20); // R.V^n
Specular = Specular*GlossMapColor.x;
 
I’m using the x component of "GlossMapColor" to multiply "Specular" with. GlossMapColor.x ranges from 0.0 to 1.0 and works like a percentage when multiplying with Specular.
 
So, if the glossmap is black, specular will be multiplied with 0.0, resulting in a specular value of 0.0. If it’s white, specular will remain unchanged and anything in between will make it more or less reflective depending on the grayness level of GlossMapColor.
 
Knowing this, we can proceed with our normal lighting equation:
return vAmbient + vDiffuseColor * ColorMapColor * Diff + vSpecularColor * Specular;
 
 
I have also added a colormap for this example just to make it more clear 🙂
 
So, where can I use gloss mapping?
Anywhere you want to control how reflective a surface is going to be! This can be a rusty iron mug where some parts are still reflective, while the rusty parts are less reflective. An old car, blank/rough ice and so on.
 
 
Thats it for today, and I hope you can see some use for gloss maps 🙂 Now, download the source and try it out for yourself!
 
NOTE:
You might have noticed that I have not used effect.commitChanges(); in this code. If you are rendering many objects using this shader, you should add this code in the pass.Begin() part so the changed will get affected in the current pass, and not in the next pass. This should be done if you set any shader paramteres inside the pass.
Posted in XNA Shader Tutorial | 5 Comments