Saturday, February 16, 2013

XNA Normal Mapping and Lighting

02/16/2013

After a long struggle with trying to get normal mapping and lighting shaders to work in our game I finally got it working where I can show off the results.

I set it up so that our artists will be able to select which shader each model will be drawn with.

For transparency I used our artists transparent shader. For Normal Mapping I setup a Normal Mapping Pipeline similar to the one shown off in the Xbox Live Indie Games Code Samples. One of the problems I was running into was caused by the ASCII FBX exports from Maya. For each model that we wanted normal mapping for I would have to go in and find the section for each model and add a normal map tag, for example:

P: "NormalMap", "Enum", "", "A+U",0, "../SourceImages/Brick3_normal.png"

I would then have to find all other references to the NormalMap and remove them. Once I did this the normal mapping would be displayed. With the normal mapping we have the following variables we can configure; light position, light color, ambient light color, shininess, specular power.

Below are examples of the shaders...

Transparent lamp next to the rectangle:


Normal Mapping on different models:





Example of the same barrel model with Normal Mapping on or off:


Video examples of the Normal Mapping:



Testing lighting so that it looks like the light on the two arches is coming from the lamp between them:

Thursday, February 7, 2013

Ninja Scroll Animation (Update)

02/07/2013

I updated the ninja scroll animation. Scrolls can now be spawned anywhere on the screen by giving them a Vector2 location of the top left corner. You can dynamically set the text, and scale of the scroll.

Examples of setting location and scale:


Play Test / Level Testing

02/07/2013

Today we will be doing a play test with the Master students. Our team has been trying to get a big indoor level to work but have been running into performance issues with it lagging on the xbox 360. On Tuesday I was asked to try and get this level working before the play test. I determined that the problem with the level was due to the collision layer, so I spent the last couple of days trying to edit the Maya model and remove as much as possible without affecting the game play.

Here is a video of the lagging performance:


Here is a video where I removed the level's collision layer and added a different level's collision layer and the level runs smooth:


After removing all the models and faces I could from the Maya model it still performed slow. So I started to edit and remove each edge that I could, but performance still continued to run slow.


One of our artists started to build the collision layer from scratch. As he created it I would test it out and find locations where collisions either needed to be improved or added because they were missing.

In the end we decided to scrap this level since it did not fit with our level builder.

Thursday, January 31, 2013

Transparent Shader

01/31/2013

I was able to take the transparent and normal mapping shaders created by our artist and use them successfully. The normal mapping is not showing up as defined as we would like so I am continuing to play with it, but with no success.

Here is a video of the xna shaders with multiple models:

Thursday, January 24, 2013

Ninja Scroll Animation

01/24/2013

I was asked to animate the un-rolling and rolling of a ninja scroll. One of our Artists created some frame textures for me to use for the scroll.

Here is a video of the animation:

Thursday, January 17, 2013

Mini Map

01/17/2013

After searching around for an example or tutorial of creating a mini map for an XNA game I was unable to find one, so I just built one from scratch. I setup an interface IMiniMapItem with one method:

Vector3 GetPosition();

These items need the GetPosition() method so that their dynamic positions will always be updated on the mini map. Any item we want to show up on the mini map needs to implement the interface, and then add it to the mini map:

public void Add(IMiniMapItem item)
{
MiniMapItems.Add(item);
}


There is also a Remove(IMiniMapItem item) so that items can add and remove themselves from the mini map. You can also add and remove static positioned items based on a Vector3:

public void Add(Vector3 item)
{
Vector3Items.Add(item);
}


I also setup the mini map so that it can be be re-sized to be either small, medium, or large. It can also be positioned in the top left, top right, bottom left, or bottom right corners of the screen. These settings can later be added to the settings screen.

Thursday, January 10, 2013

Christmas Break

01/10/2013

During Christmas break I did not get as much done as I would have liked to. I continued working on XNA shading and lighting and went over RB Whitaker's working with Shaders in XNA tutorials.

I tried working with his shaders and was not able to get his models working in our game, but was able to get his models working in my test environment. I will continue to work on this until I figure it out.

I missed the first day of class on Tuesday due to the influenza going around.

One of the Artists on our team over the break also had gone over the tutorials and had played with creating his own Transparent and Normal Mapping shaders. He is going to give them to me to work on implementing them in our game.

Besides shaders I have also been assigned creating a mini map for our game.