2D Toolkit Forum

2D Toolkit => Support => Topic started by: zeteginara on December 28, 2014, 11:32:04 pm

Title: Cutout shaders cause tile distortion
Post by: zeteginara on December 28, 2014, 11:32:04 pm
I switched the material of one of my tilemaps to use the tk2d CutoutVertexColor shader, and now a few of the tiles seem to 'pick up' parts of other tiles.

You can see some examples in the texture view here:

This one:
(http://i51.photobucket.com/albums/f363/zeteginara/tilesmessedup2_zps7e9cbbb3.png)
And this one:
(http://i51.photobucket.com/albums/f363/zeteginara/tilesmessedup_zpsd4f6f4f7.png)

It doesn't get obvious until you see it in game:

Like this:
(http://i51.photobucket.com/albums/f363/zeteginara/tilesmessedup3_zpse8fa6033.png)
Or this:
(http://i51.photobucket.com/albums/f363/zeteginara/tilesmessedup4_zps3399456b.png)

It's really weird because I have a couple other tilesets in my game that use the CutoutVertexColor shader and the same settings, and they don't have this problem.  Did I miss something, or have I actually found a bug?
Title: Re: Cutout shaders cause tile distortion
Post by: unikronsoftware on December 29, 2014, 10:04:40 am
Check that you have 1 pixel of padding in sprite collection settings, that will almost certainly help with this. Also open up the image in photoshop and look at the colors / alpha channel, make sure there arent pixely bits with weird alpha values in there...
Title: Re: Cutout shaders cause tile distortion
Post by: zeteginara on December 29, 2014, 11:07:37 pm
Solved.  Using Paint.NET, with the wand at 10% tolerance, I deleted all the crap that was apparently in the alpha channel.