Seanba / Tiled2Unity

Export Tiled Map Editor (TMX) files into Unity
Other
497 stars 120 forks source link

Some tiles appear "slanted" into the editor and game #106

Closed Frankloco closed 7 years ago

Frankloco commented 7 years ago

[SOLVED] (Solution and explanation at the bottom of this comment) Hello everyone,

I have recently noticed this problem with my game and now I can't unsee it anymore and it bothers me quite much. Some of my tiles appear slanted. Here are some properties about my project that I am creating and some screenshots of my problems:

Texture settings: Resolution: 2048x2048 Grid: 16x16 Saved from PS as .PNG no compression (None / Fast) and Interlace (None)

Tiled: Tile x: 16 Tile y: 16

Tiled2Unity: Pixels Per Unit: 32 (using 16, 64, 8 or 128 doesn't change anything except for scaling of the texture)

Unity: slantedpixtex_01 slantedpixtex_02

I've tried to set the Texture Type to "Sprite (2D and UI)" as well. Didn't fix it :(.

Camera Settings: slantedpix_camsettings

Editor view slantedpix_01

slantedpix_02

In game view Even in game it's terrible slantedpix_ingame

If anyone would have any clue to fix this. I would be pleased to hear as I would like to continue developing my project without any worries!

SOLUTION TO PROBLEM: Create an export commando within Tiled to run the Tiled2Unity exporter that will set the texel-bias to 0.

2017-06-14

Furthermore you should disable "Pixel snap" in the texture it's material within Unity.

Much thanks to Seanba for helping me out with this problem and hopefully other individuals encountering this problem will read this too and see this easy fix!

Seanba commented 7 years ago

It is a bit disappointing that getting pixel-perfect visuals in Unity seems like a dark art at times. Do you have anti-aliasing enabled by chance?

Frankloco commented 7 years ago

Hello Sean, I did manage to check it today. But anti aliasing was already turned off. Any other ideas? PS: If I go into 3d mode and fly around it in the scene, the bug still occurs. (screenshot provided) 2017-06-09

Seanba commented 7 years ago

Hi again. Does the bug occur in the game view outside when you have the scale set to 1.0? I see you have it set to 0.93 in the image above and I wonder if that's because of the way Unity is scaling an image down.

I'm not surprised at visual artifacts appearing in editor mode, btw, but a "real" game view should free of such annoyances.

Frankloco commented 7 years ago

Hi Sean, I am not quite sure as to what you are referring to. As I can not find anything or see something in the images or scene that has a scale of 0.93. And I will just accept the scene bugs then, but I can hopefully fix the ingame problems

EDIT: Found what you were referring to, but no, it does not affect the bug. As mentioned before. It seems to be a problem with the export or usage of tilesets. But in my tileset everything seems to be alright

Seanba commented 7 years ago

Can you export your project as a Unity Project and send it to me? I'm sure I can find some time to take a quick look.

Frankloco commented 7 years ago

Sure, any way you can message me your e-mail? I will include the Tiled map and texture used aswell

Seanba commented 7 years ago

You can find my email on my website: www.seanba.com

anatagawa commented 7 years ago

Any news about this ?

I have the same problem, but also with vertical and horizontal black lines, between each tiles

Frankloco commented 7 years ago

@anatagawa If you would have read the first sentence of this thread you would have read that this problem has been solved. You can see the answer/solution to this problem at the bottom of the first comment! ^^

Hopefully it fixes the problem for you aswell!

Seanba commented 7 years ago

Anatagawa, that's a different problem than what was reported here. What you're seeing is seams. Are there any warnings in your console window (in Unity)?