2D Toolkit Forum

2D Toolkit => Support => Topic started by: fsadeq on April 25, 2012, 03:35:50 pm

Title: Custom Shape Seams
Post by: fsadeq on April 25, 2012, 03:35:50 pm
I am seeing seams when using custom shapes on some of my textures. I am using the tilemap editor and everything is displayed pixel perfect. The seams go away if I disable the custom shape. Any idea why? I am pretty certain the shape itself isn't off or anything on the edges. Thanks.
Title: Re: Custom Shape Seams
Post by: unikronsoftware on April 25, 2012, 04:17:41 pm
What kind of seams? Can you post a screenshot please? Or if you prefer, you can send it to the support email address.
Title: Re: Custom Shape Seams
Post by: fsadeq on April 25, 2012, 05:55:26 pm
Don't have access to the project until I get home, but they fluctuate between dark and white lines and flicker on and off depending on where you are. This is on iPhone 4 btw.

EDIT: This is also using the solid shader. I don't remember, but I *think* it goes away when using a transparent shader.
Title: Re: Custom Shape Seams
Post by: unikronsoftware on April 25, 2012, 09:22:05 pm
What filtering is set on the atlas texture?
Title: Re: Custom Shape Seams
Post by: fsadeq on April 26, 2012, 01:16:33 am
It is set to Point. Mip-mapping is also off.
Title: Re: Custom Shape Seams
Post by: unikronsoftware on April 26, 2012, 08:41:54 am
Ok getting somewhere I think. If you turn on bilinear filtering on the texture, do you get a constant white seam? It looks like it could be a problem with the source texture - basically you need to ensure the RGB channel doesnt go white in the transparent regions.
Title: Re: Custom Shape Seams
Post by: fsadeq on April 27, 2012, 12:49:27 am
Yes, it does indeed get consistant light-colored lines when set to bilinear. What do I need to do?
Title: Re: Custom Shape Seams
Post by: unikronsoftware on April 27, 2012, 10:41:30 am
So the idea is you want your color channel to have more information, i.e. dilate the pixels over edge boundary. Newer versions of Photoshop and PS Elements actually do this for you automatically. This is the "correct" way to do it, otherwise you end up with white edges bleeding across (which premultiplied alpha fixes to an extent, but that can't be used for solid shaders)

The other option, if you'd prefer, is to make the tile "solid" and simply cut the shape using geometry in the sprite collection editor.
Title: Re: Custom Shape Seams
Post by: fsadeq on April 30, 2012, 01:39:00 am
I was able to resolve this issue by changing the padding to 'extend' and then changing the 'extra padding' value to 4. Though I'm not quite sure what that extra value padding really means?
Title: Re: Custom Shape Seams
Post by: unikronsoftware on April 30, 2012, 10:13:43 am
"extend" padding simply dilates the edges. Extra padding increases the amount its extending by 4 pixels on all sides. This suggests that your texture is being minimized / mipmapped, the normal padding amount should be more than enough.
Title: Re: Custom Shape Seams
Post by: unikronsoftware on April 30, 2012, 10:14:25 am
Actually, can you post / email a screenshot of the problem tile? There might be a better solution to this.