Weird screen space seam (pixel size) when implementing atlas shader (image inside)

I’m writing a simple atlas shader aware texel bleeding between subtexture regions but I’m not getting that instead I’m getting a horrible seam in screen space the size of pixels.

I’ve tried different texture filter modes bilinear (left) and point (right); In the attached image you can also see that I’ve left some padding so I shouldn’t be getting region “bleeding”.

The shader looks like this:

per vertex
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.posMS = abs(v.vertex.xyz);

per pixel
float2 fuv = frac(i.posMS.xz)*scale+offset;
float3 texColor = tex2D(_TextureAtlas, fuv).xyz;
return float4(texColor, 1);

Don’t have a clue of what could be happening. Thanks for any hint!

Found it. It’s important to disable mip-mapping for that texture by using the “advanced texture type”.

The other problem is that you’re using Frac. The texture might still work without it, as long as it’s set to repeat and not clamp.