Saturday, May 21, 2011

Shader - Color Shading

This time I will talk about color shading in shader.

Before I start to talk more about it, let me illustrate what it is used for.

I believe most of you did play racing game before. Now I will take Need For Speed as an example. Do you remember that you can change the color of the car to whatever color you want in Need For Speed? You can even add some graffiti on the car skin too. Question is, how can all these effects be done?

The answer is very simple, you need SHADER!
All you have to do is creating masking for each model.
*Sample masking map for Lamborghini model.

As you can see, there is only black and white color in the map (you can do grayscale level if you want to)

So what is this map used for? Basically your shader program will use this map as a reference, white color part will be affected (means it will change color) and black color part will not be affected (it won't change color).

The formula to change the car skin color is:
CurrentColor = CurrentColor * Masking.a

You will notice that Masking.a, how about r,g and b?
The answer is, you can actually put 4 maps on 1 complete texture, which means you can do 4 different pattern of masking on a 3D model. Cool isn' it?

Example:
Car skin masking will be stored in R channel.
Car rim masking will be stored in G channel.
Car window masking will be stored in B channel.
Car bumper masking will be stored in A channel.

All you need to do is creating masking map to whatever pattern you want :)

Sample screenshots:
*Default Lambo with white color

*Lambo in red color

*Lambo in green color

*Lambo in blue color

Notice that all the color changes only applied on the car skin but not the whole car. This is the power of using masking :)

Video demo:



Here's the download link:

Key control:
1 - Default model
2 - Model with diffuse map only
3 - Complete model

Once you are in complete model, you can press the following keys to change color.
R - Red color
G - Green color
B - Blue color
Y - Yellow color
P - Pink color


CREDIT: Thanks to Mr.Hiew Sau Fung sponsored me all these 3D models.

Shader - Toon Shading 2

Last time I've done Toon Shading implementation. This time, I just want to enhance abit so that it will have specular effect.

Actually you just need to add specular value into the lighting calculation.
Final result will be look like this:

Video demo:



You can download the demo here:

Shader - Normal Mapping 2

Finally I've finished my Final Year Project and it's time for me to update what I've done recently :)

I would like to talk about normal mapping again. Basically normal mapping is adding details to the object without adding extra polygons. It is a very useful technique in game industry because it can improve the graphics without having penalty on performance.

Previously I've talk about normal mapping, you can click here to read about it.

This time I would like to add some extra information about normal mapping which is Specular Map.

Basically specular map is a texture map to control the object's specularity, the shininess of the object. Specular map mostly is a grayscale image.
* Specular map for human head

With specular map, you can control the specularity of the object without changing any code. All you need to do is just to replace the specular map with a new one and the result will be changed too :)

Sample screenshots:
*Default model

*Model with diffuse map

*Complete model (Diffuse + Normal + Specular)

Video Demo 1:



Video Demo 2:



Video Demo 3:


Here's the download link for normal mapping demo:

Key control:
1 - Default model
2 - Diffuse map model
3 - Complete model


CREDIT:
Thanks to Mr.Hiew Sau Fung sponsored me all these 3D models :)

Tuesday, May 17, 2011

iPhone App - Hide n Seek

This is the third app I've developed for iPhone. This time, I bring you an augmented reality treasure hunting game!

It sounds cool isn' it? In a general idea for this app is, there are Hider and Seekers, Hider is the one who decide where to hide those treasures while Seekers are the people to dig out all the treasures been hidden.

Although there is a big drawback of this app which is it is strongly depending on your GPS signal. If your signal is good then you can get the treasure information accurately, but if it's in a bad signal then I'm so sorry :(

Here are some screenshots teaching you on how to use it:
1 - This is the Main Menu. You can choose which player you are (Hider or Seeker)

2 - After you have selected Hider, you can hide the treasures on the provided map view. (The red pin indicating treasure)

3 - After that, the seeker can use CAM view to locate where are the treasures and find it out!
NOTE: You can set the effective radius (in meters) in the Main Menu screen.

4 - Is this app only for 1 player? The answer is --- NO!
Once the Hider finished hiding all the treasures, he can send his treasure data to all other iPhone users who have this app installed. The sending method is through Bluetooth.

If you are still confusing about how to use this app, look at this video tutorial:



Interested to try it?
Hope you enjoy using it :)


NOTE: If you saw a message saying that "Memory Low", please turn off all your background running apps (double tap HOME button)

Saturday, April 2, 2011

iPhone App - Simple iNotes

Finally I've decided to put my first iPhone app on App Store for FREE. Actually this has been done about half year ago but I didn't feel like putting it on App Store because I don't think my app is good enough to compete with others :(

Anyway, since my app now is on App Store, it is better for me to show other people by just giving them the download link and let them try out themselves. It is easier for my portfolio too :)

Simple iNotes is an iPhone note which allows you to manage your note in 1 place.

Key Features:
- Create different folders to categorize your notes.
- Photo notes allow you to import photo from your photo library and add your own captions/notes on it.
- Protect your notes by enabling the password protected.

*Screenshot from App Store

Here is a video tutorial teaching you on how to use Simple iNotes:



Get Simple iNotes here:
Hope you enjoy using this app :D

Saturday, February 26, 2011

Spaceship Fighter - A Simple Shooting Game

Hello guys, after been through some series of beginner tutorials of Unity. I've came out a simple spaceship shooting game.

All the arts and models are taken from somewhere else.
It's not a fun game but it is my first experience of working in Unity!

All the scripting was done in C# :)

Here's are some screenshots:
*Game screenshot

*Player spaceship exploded (Particle effect)

*Lose screen

Video demo:




If you are interested to try out this simple game, you can download here:

Hope you enjoy :)

Unity - Game Development Tool

Recently I've been searching around about Unity and found out that it is really a great game development tool because it provides a lot of features which can simplified your works as you developing games.


I would say it is almost like a game engine because it handles collision, physics, audio, and rendering. Besides that, it does provide scripting ability (C# and Javascript) which allows you to code your own behaviors and apply it on your games. Cool, isn't it?



In terms of publication, it supports almost all platforms like Windows, Macintosh, iPhone, Android, Wii, PS3, and Xbox 360. The only thing which doesn't support is Open-Source OS like Linux. There are 2 versions of Unity which is Unity Standard and Unity Pro. For the product features comparison you can visit the following link:

It is not a tool just to develop some normal casual games but it can be developed for AAA games. Although it may not be as powerful as Unreal Engine but I believe Unity might be catching up in future!

Finally, I would like to say:
I Love Unity!