- Home /
Lines appear between tiles of generated mesh
Alright, so here's my problem. I have a 2d randomly generated mesh that is made of 16px x 16px tiles (they are mapped off a texture atlas, not individual gameobjects). When I run the game I experience bleeding/tearing/whatever you'd like to call it. Below is a screenshot. I tried going into settings and turning off anti-aliasing but that only solved the problem when the camera was stationary. (Since I cannot include any more attachments I will just try my best to explain this one) When I moved the camera around, the horizontal and vertical lines would flicker.
When I moved the camera, the tearing returned. Finally, I tried turning on pixel snapping (shown in below screenshot) and it solved the problem when the window was not maximized (in editor and build). I honestly have no idea what is going on. If you need any additional info or screenshots just ask. Thanks.
EDIT: I was looking at pixel snap some more and now I'm really wondering why when I build it with the display set to full screen it runs fine, same when windowed but not fully maximized. When built, the only time there is an issue is when it is in windowed mode and maximized. Not much else to say other than I am confused.
Yes, the texture is set to point filter. I just tested out bilinear and trilinear but neither fixed the problem.
Answer by geplourde · Jul 21, 2017 at 05:13 AM
You may have to use the gutter technique which is what I had to do in order to avoid these lines flickering as the camera moved. A gutter is a few pixels thick that surrounds the perimeter of the tile/sprite and is just a mirror of the original tile's perimeter. I'd create a gutter of 4 pixels just to be safe. So, in the end, your tiles will be 20x20 even though they are laid out on a 16x16 grid, and the added gutter only appears visible where the flickering lines used to be, removing the problem entirely.
Thank you for your answer. I will mark this as the answer although I did find an alternate solution. What I did was turn on pixel snap and edited the tile atlas so that it only had one row. (ex: before it was 32x32 I made it 16x64) That worked for some reason. Do you know if this is a bug that needs to be reported? Thanks for your help :D
Answer by Menyus777 · Jul 20, 2017 at 11:10 PM
Disable MipMaps if you have them enabled
$$anonymous$$ipmaps were already disabled. Thanks for the reply though
Answer by kalanadis · Jul 21, 2017 at 11:18 AM
Have you checked your texture uv mappings ? if the image texture image is mapping to its edge this could happen. or sometime turning warp mode of the texture to clamp will fix your problem.
Your answer
Follow this Question
Related Questions
Can you manually set the layer order for triangles inside a mesh? 2 Answers
Is it possible to generate a 2D view of a 3D object at runtime? 0 Answers
How to create accurate mesh from texture (like 2D sprites) 2 Answers
2D vs 3D mesh deformation. 0 Answers
How do I create a custom sprite mesh? 0 Answers