2D Toolkit Forum
2D Toolkit => Support => Topic started by: flying_hamster on July 19, 2012, 06:15:53 pm
-
When I create the tile map everything looks fine, but when you play the game as you move about the game I get these black lines where the edges of tiles are (see screen shot). Is there a way to fix this? My textures are premultiplied.
-
What is the edge filtering mode on the sprites, and what is behind them? How many layers?
-
There are 4 layers. I am not sure where to find the edge filtering mode? The pad method is set to extend and thats about all I changed in the collection.
-
Sorry I meant pad method not edge filtering mode.
are the black lines at tile boundaries?
-
Yes they are at the tile boundaries.
-
This is unexpected. Is there any chance you could set up a repro case for me to look at?
Let me know if it isn't possible / too much hassle, I'll think of a few more tests to try and narrow down whats going wrong.
-
I emailed you a link to an unity package with what I am using. Hopefully that helps. Cant do much more then that.
-
Thanks for the package. I'll investigate.
-
This also happens in my project.
Please let me know if you want me to send a repro project as well, or if you've found out the problem :)
-
Yeah we figured it out.
flying_hamster was using a perspective camera for the tilemap, had multiple layers and was running on Unity 3.5.3/2D Toolkit 1.7. In that version of 2D Toolkit, there was a workaround for a Unity 3.4 - 3.5.2 bug to do with inertia calculation. The workaround was, one of the vertices per sprite was pushed back slightly.
When viewed with a perspective camera, occasionally (well quite often) the parallax from this slightly offset vertex would cause the pixel behind to be visible. Sometimes this was dark.
If you're using v1.75/6 and Unity 3.5.3 then this should not be a problem any more - just in case, re-commit your sprite collection and see if that improves anything. If not, it could be something different... in that case, a repro project would be very much appreciated.
support@unikronsoftware.com
-
I actually do see some black lines at some tile borders with my normal orthographic camera. I put the clear flags to Depth only and solved it :P
-
That doesn't really solve the problem, it just hides it to some extent. You shouldn't get ANY black lines with an ortho camera and when displaying at full resolution.
If you see black lines with an orthographic camera -
1. Is the sprite padding mode set to extend? If not, its likely this is the problem.
2. Does turning off mipmapping make the lines disappear? If yes, you probably aren't displaying the tilemap at 1:1 resolution.
-
It's set to extend. i haven't changed the resolution of anything in the tilemap. I haven o idea how to turn of mipmapping either. I'm pretty new to unity overall. Been working with it for 3 weeks now.
The attached file shows the lines, and it only happens in exactly that place. It's not noticeable at all if you just walk past it slowly. But you see them if you stop there :)
-
It's set to extend. i haven't changed the resolution of anything in the tilemap. I haven o idea how to turn of mipmapping either. I'm pretty new to unity overall. Been working with it for 3 weeks now.
The attached file shows the lines, and it only happens in exactly that place. It's not noticeable at all if you just walk past it slowly. But you see them if you stop there :)
That looks like its happening on tilemap chunk boundaries. I'll have to look into this to see if I can reproduce it. The z depths are different on the chunks. Perhaps its got something to do with this.
-
Aye, and remember that i'm offsetting all tiles little more than you normally are in Z,
removed z += 0.00001 from row 299 and added
z = ((y + 1) * 0.1028f) + (tileMap.gameObject.transform.position.y * 0.032125f) - (layerId * 0.1f);
to row 255. If that makes any difference
-
Ah, for me it only happens on chunk boundaries as well.
For some reason it happens very randomly in my project though. I'm moving around the camera, and some times it happens, but since it happens randomly I unfortunately haven't been able to make a reliable repro case for you.
I have it setup to be orthographic camera, 320 size, 1:1 pixel perfect, all tiles have Extend, mip map off.
-
Interesting that that happens. Ill investigate when I get an opportunity. In the meantime if anyone gets a decent repro case, email it my way.