- Home /
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):
However as soon as the camera zooms out, seams start to appear:
So I know the issue, it's taking pixels from adjacent textures in my texture map:
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):
Answer by GenericToast · Sep 11, 2017 at 12:58 PM
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.
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; }
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
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Procedural Mesh UV problem 0 Answers
mesh.uv question 1 Answer