Using TEXCOORD1 in surface shader

I made a procedurally generated mesh and set values for uv and uv1 properties.
I wrote a surface shader that uses both sets of uvs.
The shader has two textures, and the mesh has a set of uvs for each one.
I should be able to switch between one and another by changing a weight between them.

Shader "MyShader" {
Properties {
	_MainTex ("Base (RGB)", 2D) = "white" {}
	_ShineTex ("Shine (RGB)", 2D) = "white" {}
	_ShineOpacity ("Shine opacity", Range (0,1)) = 0
}
SubShader {
	Tags { "RenderType"="Opaque" }
	LOD 200

CGPROGRAM
#pragma surface surf Lambert

sampler2D _MainTex;
sampler2D _ShineTex;
float _ShineOpacity;

struct Input {
	float2 uv_MainTex	: TEXCOORD0;
	float2 uv_ShineTex	: TEXCOORD1;
};

void surf (Input IN, inout SurfaceOutput o) {
	fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * (1-_ShineOpacity) + tex2D(_ShineTex, IN.uv_ShineTex) * _ShineOpacity;
	o.Albedo = c.rgb;
	o.Alpha = c.a;
}
ENDCG
}

Fallback "VertexLit"
}

This is not working, and by the render I can tell that uv_MainTex and uv_ShineTex are both using TEXCOORD0.
Any ideas about what’s happening?

Solved. In the documentation

it says “Texture coordinates must be named “uv” followed by texture name (or start it with “uv2” to use second texture coordinate set).”

I didn’t know about this naming convention. I think this should be written in a bigger bold red font :stuck_out_tongue:
I just changed “uv_ShineTex” to “uv2_ShineTex” and it worked.

Lol… it is written in manual however there is another problem corresponding with this… when u have 1 texture and more UV maps (http://forum.unity3d.com/threads/problems-with-shader-utilizing-uv2.151702/, different second uv usage cause _mainTex_ST redefinition.Need Help - Unity Answers)

causes error:

struct Input {
  float2 uv_MainTex : TEXCOORD0;
  float2 uv2_MainTex;
} 

solution:

struct Input {
  float2 uv_MainTex : TEXCOORD0;
  float2 uv2_MainTex2;
} 

AND YES you have to create new parameter for that!!!

	Properties {
		_Color ("Color", Color) = (1,1,1,1)
		_MainTex ("Albedo (RGB)", 2D) = "white" {}
		_MainTex2 ("Albedo (RGB)", 2D) = "white" {}
		_MainTex3 ("Albedo (RGB)", 2D) = "white" {}