Game Development Reference
In-Depth Information
The shader programming language is very complex and difficult, especially when we have to
deal with lighing. It can be a nightmare, but Unity 3.x has come up with a new style of wriing
the shader program that is shorter and simpler. We sill need to know the basics of Cg/HLSL
programming, but we won't go too deep into how to create a shader from scratch or how Cg/
HLSL works. We will use the new surface shader and create our own custom shader.
Mission briefing
We will create a basic custom shader and apply this shader to the character model that we
already have. That's it. We might say "Hey! Why is it so short?". Well, it's short to say but it
takes a long ime to explain the whole concept of wriing a shader.
1. First, we will open the character model in 3Ds Max (this is an opional step).
We can get the trial version for free from this website:
http://usa.autodesk.com/adsk/servlet/
download/item?siteID=123112&id=16324410 .
2. Then, we will set up its scale and rotaion, and export it as an FBX ile format to work
with Unity. Then, we will import the character model to Unity and start applying a
build material in Unity.
3. Next, we will start creaing a shader, which includes difuse texture, bump map
(normal map) texture, ambient color, specular color and glossiness, rim light (or
back light) color and power, and ramp texture, as shown in the following screenshot:
 
Search WWH ::




Custom Search