Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black lines around the sprite #26

Closed
jeedee opened this issue Feb 9, 2012 · 11 comments
Closed

Black lines around the sprite #26

jeedee opened this issue Feb 9, 2012 · 11 comments

Comments

@jeedee
Copy link

jeedee commented Feb 9, 2012

Could be avoided if no pixel was touching the edge of the UV square but ex2D seems to be trimming transparency. Add an option for padding inside the uv square?

@jwu
Copy link
Contributor

jwu commented Feb 10, 2012

Hi jeedee,

ex2D will trim out zero alpha pixel when texture import to atlas. I'm sorry but can you explain more about the solution you proposed? Thanks in advance.

@jeedee
Copy link
Author

jeedee commented Feb 10, 2012

Hello!

When the UV edges are next to the last pixel of the image it causes the black bar problem (Which can be fixed by setting the texture to "Point" but it does not always yield the results wanted on the picture). It would be nice to be able to add "inner" padding to the sprite.

@jwu
Copy link
Contributor

jwu commented Feb 10, 2012

Hi jeedee,

This is a good idea. My question is, where will this "inner" padding option exists? Will it be part of the atlas settings or just in the exSprite inspector in each sprite instance?

In my experience, I think the setting is relate with the texture you import. But if I put it in the atlas panel, then all the texture will affect by this "inner" padding, which in-fact is no necessary for other texture isn't it?

@jeedee
Copy link
Author

jeedee commented Feb 10, 2012

I think all sprites can benefit from this change, I would maybe make it optional in the atlas import with 0 inner padding by default? I think project-wide you either want it or don't want it so making it per sprite would be a bit tedious

@jwu
Copy link
Contributor

jwu commented Feb 10, 2012

I agree with you.

So before I do this, would you mind to send me some texture or maybe a sample project that including the black line issue. Then I can see if my changes fix it.

@tmsjustinb
Copy link

Hey, I'm currently having the same problem... I'm curious if this feature will ever be added? I've looked into Unitile and they have a padding option however, it doesn't have any animation options... Basically it occurs when trying to put to sprites together to make a seemless wall or something. Similar to tilemapping but just doing it by hand using V snapping. The black edge is from using an atlas, which creates a new transparency for the sprites. I'm still pretty new to unity, I know if I just using tiling without putting the sprite in an atlas would deal with the issue but I don't want to have extra draw calls...

@tmsjustinb
Copy link

Well, I did figure out a work around. You can give your atlas enough padding for you to bring it into photoshop after it's set up. You can then just ad a layer underneath and fill in a pixel or two of the edges where you are getting black lines. You may have to back this up, because I think if you edit it in the atlas editor it might mess things up on you.

@jwu
Copy link
Contributor

jwu commented Sep 11, 2012

Hi tmsjustinb,

This problem have been fixed in ex2D v1.2.6. We've introduce new algorithm which will bleed the pixel at the edge of the sprite.

@tmsjustinb
Copy link

Oh, weird, the store is only saying 1.2.5 is available for me... Is it available already or are you guys still working on it?

@jwu
Copy link
Contributor

jwu commented Sep 12, 2012

Hi tmsjustinb,

Yes, the v1.2.6 is still under beta test. You can ask me the latest beta version through E-Mail.

@jwu
Copy link
Contributor

jwu commented Aug 8, 2013

The problem is caused by several things: filter mode, The padding pixel in atlas, the filling pixel for raw texture to atlas.

In ex2D v1.2.7+, we introduce padding bleed and contour bleed. I move the code to ex2D v2.0 and make them works correctly for rotated texture and atlas fonts. Right now the black line problem solved in v2.0. I'm still testing it with pixel perfect rendering.

The ex2D v2.0 will released soon, so you can test it after that.

@jwu jwu closed this as completed Aug 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants