2D Toolkit Forum
2D Toolkit => Support => Topic started by: oklo on October 26, 2013, 11:27:53 pm
-
Hi there!
I have a problem I can't seem to figure out at the moment (could be due to the late hour..). Basically I have a tilesheet with 64x64 tiles in it. Two wall tiles that should normally fit together perfectly does not do so, and to me it appears as if the trimming of tiles is to blame.
The camera is ortographic and both it and the spritesheet are set up with pixels per meter (20). The spritesheet is also set to point as the filtering mode. I've found out that by disabling trimming in spritesheet settings the problem goes away and everything appears to be pixel perfect, but I would ideally want the trimming in place to save place in the atlas.
Anyone have any clue as to what might be the problem?
-
Does adding some padding (sprite collection settings, set padding to 1 or 2) improve quality?
-
No dice, the problem remains even if I add 1 or 2 under Pad Amount. Not sure what could be causing this as I've not had this problem in another project that uses the same tilesheets. I'll investigate some more.
-
What kind of error are you seeing here?
-
I've attached 2 files showing the result with and without trimming enabled (two 64x64 tiles, one placed above the other). In case you want to investigate you can find a tiny unity project where the problem occurs for me located right here: link removed - only post links in the private support forum
It works perfectly when one disables trimming, the problem occurs when trimming is enabled. (The tilesheet is all yellow because I am not at liberty to share the artwork in use, but the problem is not exactly less visible with this bogus artwork)
-
After some further investigation I've discovered that the problem is actually present both with and without trimming. The tiles should have 32 yellow pixels where they touch, but when trimming is disabled I am getting 33px - while if trimming is enabled I am getting 32px on the top one while 33px on the corner one at the bottom.
My guess is that it's a mistake on my part, I just don't see how or where...
-
Hmmm... I don't see the issue at all. What platform / hardware are you running on?
-
It's just windows 7 with fairly typical pc hardware. Recent nvidia gpu.
-
How big is your game window (physically)? What is the game window resolution set to? Is there some compression that is going on?
-
Just an update - the problem goes away when running a build instead of hitting play in the unity editor. It also goes away if I resize the scene window in the editor. The oddball screen resolution (in the editor scene window) of 1249x976 makes the problem visible for me, while most other similary odd resolutions seem fine. I don't see this is an important problem as seems to only occur for weird resolutions. Thanks for looking into the issue, and double thanks for making this great product :)
I also got this (most likely unrelated warning during build):
The private field `tk2dCamera.gameWindowResolution' is assigned but its value is never used
-
Yes this is definitely unrelated, and this won't cause any issues :) Thanks for mentioning it - I'll fix it in the next release.
The private field `tk2dCamera.gameWindowResolution' is assigned but its value is never used