Hello,
The issue is that we are experiencing tearing issues in our background and foreground tilemaps.
Little transparent 1 pixel x 1 tile lines appear for a single frame and many appear each frame.
We’re using version 2019.4.4f1 with Universal RP version 7.4.3
We’ve tried many solutions found online but none of them worked. We cannot open pixel snapping as this is not an option with the 2D URP package. The only “solution” that has worked is giving the grid a very small negative cell gap which removes the tearing, however this is not ideal as it ruins the pixel alignment with other objects in long levels. Another possible option was using a sprite atlas but we are using secondary textures for lighting effects on the tiles and as far as I know there is currently no way of correctly mapping secondary textures to sprite atlases.
If there is any practical solution to this problem we’d love to know.
We hope this gets fixed soon as we’re hoping to finish a vertical slice of our game by next month.
Well if atlas won’t work have you tried adjusting tile sprite PPU from import settings. If your tile sprite is 4 pixels per unit, change it to something smaller… like 3.95 or something. This way your tile is still aligned to grid like it was, it only overlaps its neighbor tiles.
We’re considering this but in some cases it has a visual effect on the pixel ratio and is not an ideal solution.
We don’t want to compromise on the visuals of the game.
This problem only happened to me at a low resolution, the problem was almost gone when we switched to an ortographic camera + pixel perfect camera. The definitive solution was to scale the tile in every side by 1 pixel, and painting that part as if it was part of tile. Our tiles are 8x8, but they’re all 10x10 in the spritesheet. I don’t recommend adding a small overlap between the sprites, you’ll misalign all of your colliders, and if you don’t have a skin width big enough, it will be a nightmare. I remember trying a lot of things at the time (2018), don’t know if there is currently a better solution, or if there was and I couldn’t find.
create your sprite atlas manually, the important part of the atlas that you need is the padding, so make sure that your secondary textures have padding aswell.
If you don’t add the padding you will never be able to fix this, other methods will make you think you fixed it but eventually you will find situations where it tears again, its the price of using a 3d engine to create a 2d game, you need to add padding to your sprites in 3d engines.
If by making a sprite atlas manually you mean placing all the sprites of the tilemap into a single file and splitting it we’ve tried that before without padding. Now we tried it with padding and it only made the tearing worse making it appear much more frequently.
If you mean there’s a way of using Unity’s Sprite Atlas system manually I’d love to learn more about that.
Scaling the tiles by 1 pixel is not an Ideal solution since it will require a lot of work form our artists as we have many different tiles and variations and would take a lot of valueable time.
We’ve currently switched to a pixel perfect camera which initially looked like it solved the problem. However after creating some more dense tilemaps, we’ve run into a larger tearing issue where there is horizontal tearing across the screen between every tile making everything much worse.
We’re still looking for other solutions to the problem so any further help would be appreciated.
I remember using ImageMagick to generate the borders, You just duplicate the edge pixels, and add the corners, you’ll probably have to wide the gap between the sprites too. Our sprites are 8x8 tho, don’t know if this would help with bigger/more detailed tiles.
I made a helper tool for this a couple years go and made a post about it, but it never occurred to me to reply to other people’s posts. Probably doesn’t help there was a typo in the thread title haha. Anyways… It will add a 1px padding to each tile in a tileset. It’s pretty basic, but it works quite well. Hope it helps someone!