shader MainTex.width ?

hi…

I’m trying to make a Shader …

all that I need , to split the Main texture to two parts( as mask )

example :
sampler2D MainTex;

sampler2D FirstHalf;
sampler2D SecondHalf;

MainTex contain the main texture

FirstHalf = from 0 to MainTex.width/2

SecondHalf = from MainTex.width/2 to end of the texture ( 1 )

how can I do that ??

thank you

Calculate the UV.

    float4 FirstHalf = tex2D(_MainTex, i.uv.xy * float2(0.5, 1) );

http://docs.unity3d.com/Manual/ShaderTut2.html