How do I add vertex lighting to this shader?
I only use 1 directional light.
Shader "Custom/1 directional light test" {
Properties {
_MainTex ("Base1 (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "IgnoreProjector"="True" "RenderType"="Opaque" "LightMode"="ForwardBase" }
Cull Back Lighting On ZWrite On Fog { Color (0,0,0,0) }
CGINCLUDE
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "AutoLight.cginc"
sampler2D _MainTex;
float4 _MainTex_ST;
struct v2f {
float4 pos : SV_POSITION;
fixed4 col: COLOR;
float4 uv : TEXCOORD0;
half3 normal;
};
v2f vert (appdata_full v)
{
v2f o;
o.pos= mul(UNITY_MATRIX_MVP, v.vertex);
o.uv.xy = TRANSFORM_TEX(v.texcoord.xy,_MainTex);
o.col = v.color;
return o;
}
ENDCG
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
fixed4 frag (v2f i) : COLOR
{
half4 tex = tex2D (_MainTex, i.uv.xy);
return tex;
}
ENDCG
}
}
}