I have a little problem with a shader I wrote.
There are line artifacts between the uv tiling of the texture.
Is there something I’m doing wrong or does uv’s are not between 0.0 and 1.0?
I have no idea what could be causing this.
Here is a screenshot of the problem:
and this is the Texture:

Here is the code:
Shader "custom/Test Shader"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
struct Input
{
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o)
{
float2 pgUvMainTex1 = float2(fmod(IN.uv_MainTex.x,0.5), fmod(IN.uv_MainTex.y,0.5)+0.5);
half4 color1 = tex2D (_MainTex, pgUvMainTex1);
o.Albedo = color1.rgb;
o.Alpha = 1;
}
ENDCG
}
FallBack "Diffuse"
}
