On mobile devices, it is recommended that you do not use clip / reset methods, as this is a very expensive operation.
I updated the fragment shader part without the clip / discard method. Here, instead of clipping, make parts that you do not want to display in a transparent color, and for the rest, render as they are.
if ((IN.texcoord.x<0) || (IN.texcoord.x>_Width) || (IN.texcoord.y<0) || (IN.texcoord.y>_Length))
{
half4 colorTransparent = half4(0,0,0,0) ;
return colorTransparent ;
}
else
return tex2D(_MainTex, IN.texcoord) ;
source
share