Part1.完整代码
Shader "Chapter7/singleTexShad"
{
Properties{
_Color("Colot Tint",Color) = (1,1,1,1)
_MainTex("Main Tex",2D) = "white"{} //2D为纹理属性的声明方式
_Specular("Specular",Color) = (1,1,1,1)
_Gloss("Gloss",Range(8.0,256)) = 20
}
SubShader
{
Pass{
Tags{"LightMode" = "ForwardBase"}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Lighting.cginc"
//define varieties matching to the corresponding one above
fixed4 _Color;
sampler2D _MainTex;
float4 _MainTex_ST; //scale and translation
fixed4 _Specular;
float _Gloss;
struct a2v{
float4 vertex : POSITION;