Game Development Reference
In-Depth Information
sampler2D _MainTex;
sampler2D _BumpMap;
struct Input {
float2 uv_MainTex;
float2 uv_BumpMap;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = c.a;
o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
}
ENDCG
}
9. Finally, we go back to Unity and apply the texture to our model.
Let's click on the
Heroine.FBX
model in the
Hierarchy
view to bring up its
Inspector
view.
In the
Inspector
view, we will go to the material component and set the following:
F
Texture
: Drag-and-drop the
Diffuse.tga
in the
Textures
folder from the
Project
view to this thumbnail
F
Bumpmap
: Drag-and-drop the
Normal.tga
in the
Textures
folder from the
Project
view to this thumbnail
You will see the
Inspector
view, as shown in the following screenshot: