UV Mapping: extra pixels either side

Hey everyone,

So I’ve got a map that’s procedurally generated and the floor needs to match what’s on each tile. I.e. A road tile has a road texture applied to it.

This works for the most part (forgive the placeholder textures):
alt text

However as soon as the camera zooms out, seams start to appear:
alt text

So I know the issue, it’s taking pixels from adjacent textures in my texture map:
alt text

How do I assign UVs for each tile on my mesh such that there isn’t a seam?
This is how I currently do it (320px is the total texture map width, each tile texture is 64px wide):
alt text

I encountered this problem for a game i did a while ago. I can’t really remember how i fixed it but heres what i recall.

  1. I added pixel snapping to the shader i was using for my tilemap mesh

    v2f vert(appdata_t v)
    v2f o;
    o.vertex = UnityObjectToClipPos(v.vertex);
    o.vertex = UnityPixelSnap(o.vertex);
    o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
    UNITY_TRANSFER_FOG(o, o.vertex);
    return o;

  2. I disabled off anti aliasing in the quality settings under Edit>Project Settings>Quality

I don’t know if theres other ways to fix this but hopefully it helps