0
\$\begingroup\$

So I am making a game in Libgdx using an isometric tiled map but when I set the texture filtering of the tiles to linear, black lines show up between all the tiles. This is caused because each tile blends with the tiles next to it.

I know many people have asked this before and the common answer seems to be add padding. I have padding but that doesn't help because then the tiles start blending with the clear pixels instead. That just turns the lines a different color.

Another option people say is to copy the pixels on the edge of each tile for padding, but unfortunately that only works for non-isometric maps. However when I use the tilemap preprocessor it works fine even with filtering, but the tilemap preprocessor causes many other issues so I don't want to do that.

How can I fix this? Somehow the tiledmap preprocessor does it fine but I'm not sure what that actually does other than adding padding. Any help is greatly appreciated!

\$\endgroup\$
5
  • \$\begingroup\$ It is pretty easy to see what tiledmap does inside your IDE (at least in intellij idea). You can see the source code. \$\endgroup\$
    – dimitris93
    Aug 12, 2015 at 9:44
  • \$\begingroup\$ When you add padding, are you including the padding when you are rendering your sprite? Make sure that you don't. Another fix you can do, is not use a spritesheet, as the blending would be ignored on a fixed size image. \$\endgroup\$
    – jgallant
    Aug 12, 2015 at 11:31
  • \$\begingroup\$ I know I can look at the source code but I mean I'm not sure what the tilemap preprocessor does. Also I am not including the padding when rendering, but I want to use a spritesheet because it is faster and easier. \$\endgroup\$ Aug 12, 2015 at 14:49
  • \$\begingroup\$ I still havent solved this. If i dont use a spritesheet for my tiles there are still lines but they are white instead of black. Does anyone know how to solve this? \$\endgroup\$ Nov 4, 2015 at 15:11
  • \$\begingroup\$ One thing I've used to help with some of the weirdness between tiles is to make sure the camera position is always locked to integer values. It seems to help clear up this issues for me in past projects. \$\endgroup\$
    – LAMonday
    Nov 30, 2017 at 15:25

2 Answers 2

1
\$\begingroup\$

If you're getting transparent edge pixels, it sounds like you haven't enabled duplicatePadding. Just to be sure, these are my recommended TexturePackerSettings:

duplicatePadding = true
paddingX = 2
paddingY = 2
\$\endgroup\$
0
\$\begingroup\$

You should check that your spritesheet is power of two.

For example:

3 tiles of 64x64 = one spritesheet of 192x64 ---> wrong

4 tiles of 64x64 = one spritesheet of 256x64 ---> right

Even if each sprite is power of two itself.

I hope this helps you.

\$\endgroup\$
1
  • \$\begingroup\$ How does a power of two help? \$\endgroup\$
    – Genhis
    Jun 27, 2019 at 21:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .