Flickering seams when moving camera [Unity2D]

Hello,

I’m trying to create a top down 2D game. Currently I’m stuck on a graphical problem: Some sprites ‘borrow’ pixels from their immediate left (in the sprite sheet) when moving the camera around, resulting in flickering seams. Below is an example:

Long Question: In this screenshot, you can see there are 4 ‘water’ tiles that have this yellow ‘seam’ to the left of them (middle of screen). These lines originate from the vertical line of pixels to the immediate left of the sprite in the sprite sheet (See bottom left for the sprite and the yellow gapes in between sprites in my sprite sheet). The seams/lines flicker for a fraction of a second, happen when moving the camera around and can happen to any tile. In this case the grass tiles are not getting these lines since there are no pixels to the left of them in the sprite sheet.

I hope this issue has some obvious solution that I’m missing, but I couldn’t find a proper solution through a google/forum search.

Additional information about sprite sheet/screen: Max Size 4095, Truecolor format, Point filtering, 64 Pixels to Units, happens at all resolutions. I could provide additional information about these seams/lines, but seeing how these lines are depending on their neighboring pixels in the sprite sheet, there’s probably an obvious answer to this problem.

Short question: Sprites are using pixels from immediate vicinity in sprite sheet for fraction of a second, only when moving camera around. Possible causes?

EDIT: Since the colors of the seams depend on the vertical pixel line next to the sprite, I’m guessing this might have to do something with compression? I don’t know exactly how the sprite renderer works though, so maybe someone with more knowledge about it might be able to answer this question.

I found your question while searching for my old question.

I’m going to post another answer since the question-asker notes in a comment to the accepted answer that the accepted solution didn’t really work.

I had a very similar issue and it was also mostly corrected by snapping my camera to my pixel grid. Disabling Anti Aliasing fixed this problem for me.

Edit → Project Settings → QualitySettings and Disable “Anti Aliasing”.

Details about my problem: Seams in 2D Pixel Art - Unity Answers

My guess is that this is caused by fractional lookups in the sprite texture whenever the camera and/or tile positions aren’t aligned properly. For example, if your sprite’s Pixels to Units is set to 10, you could try and quantize your camera and tile positions to the nearest tenth.

float nearestTenth = (int)(floatValue/0.1f)*0.1f;

This might eliminate your textures trying to read “half-pixel” values and keep them in line. Good luck.

This works but enable texture flickering.

Hey, So make sure your import settings for the sprite are set to point(no filter), otherwise it can cause problems. I had moving tiles and synchronizing their movement using time.deltatime helped.