[SOLVED] Tilemap tearing w/ atlas, sprite slicing wong

Hello! I have been having a problem for quite a while with my tilemap tearing, showing transparent lines, as well as parts of other tiles.

(tilemap tearing in the editor)

I dug around the forums, and found everyone saying to use a sprite atlas. So I used it, but it did not fix the tearing at all. I tried all the settings like turning alpha dilation on and off, 2,4,8 padding, point filter mode, no/high quality compression, RGBA 32 bit format, etc. In my project settings, I have the sprite packer mode to ‘V1 - always enabled’. But the tearing after I delete the atlas is exactly the same as when it exists.

That’s pretty much the whole problem.

For more details:

(sprite editor)
This slice is in the middle of a “blended” pixel. In all image editors, there is no blending at all between these 2 tiles, on the left it’s completely yellow, and on the right it’s completely green. There is no extra pixel between them. However, here they are blended. I’ve used point filter, no compression, and tried multiple formats on the sprite.

My sprite atlas looks like this.


There are little bits of other tiles in each tile, such as in tiles (0,1) (1,1) (3,1) from bottom left being (0,0). In all image editors, each tile is 256x256 and doesn’t conflict, but in the unity sprite editor, the slices are made on blended pixels. (no padding, slices are 256x256 and position for each slice is correct)

I’ve been stuck on this for a long time, so any help would be very much appreciated. Thanks! :slight_smile:

Still haven’t found a solution.

you say that you have no compression but i see that you have compression on your atlas

remove tight packing, remove alpha dilation

keep padding high for test, but 2 should be good enough

import single sprites, 256x256 solo .png files

no spritesheet slicing in the editor

Thank you for the reply!

I have tried without compression again, removed tight packing, and removed alpha dilation. I tried with both 8 and 2 padding. The transparent tearing and parts of other tiles remain.

I think that having separate single sprites would fix this, but it would mean a lot of work every time I want to make a change to the tileset. Is there something wrong with the sprite editor in unity, or am I using it wrong?

well im trying to nail down the problem

if separate sprites fixes it, then yes, it would be concluded that the problem is the slicing

Just to doublecheck, you mentioned that you turned off compression on the Sprite Atlas, but what about the original image file that you fed into the Sprite Atlas. Does the Sprite asset also have compression disabled?

Yes it does have no compression. I can’t think of anything other than the sprite editor’s slicing function not working properly.

From the zoomed in picture of the sprite editor you’ve shown, it clearly looks like pixel values from one tile are bleeding into the neighboring tile. This implies that scaling/filtering/compression is happening somewhere, but we don’t know where. The actual location of the tile boundary looks ok from that picture.

Yep that’s what I think as well. Do you know of any other places this could occur?

If the corruption appears in the sprite editor, then that would imply that it happens before the sprite atlas gets involved. Can you post a screenshot of the Sprite asset’s inspector tab?

Here it is 9807801--1408431--upload_2024-5-1_13-12-51.png

If you have 15 tiles that are 256 pixels wide, then the original image is 3840 wide. Have you tried increasing the Max Size to 4096?

1 Like

You are an absolute lifesaver! Thank you :smile:

Very strange, but for me, it only happens when any part of the tilemap was below the 0,0 coordinate.

Moving my tilemap’s parent to always be above the 0,0 position fixes it (somehow)