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: Code (csharp): 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" }
Thanks for the reply. Now I know what the problem is. (mipmap) Hmm, is there another way to get atlas texture working on my shader? I need it for my terrain for detail textures etc. Or is it possible to extend the editor (inspector) for terrain painting with more textures on one splat (like diffuse, normal, detail, ...)?