Hello Guest

Author Topic: Ugly Edges  (Read 5115 times)

dustinbahr

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Ugly Edges
« on: September 25, 2012, 11:43:00 pm »
I'm hoping there's a setting I am missing to improve the edges on my graphics, especially on scaled non-retina displays.

I have my project setup for iPad with the following settings:

tk2dcamera:
Native Res: 1536 x 2048 (retina iPad)
Override: 768 x 1024 (ipad 1 & 2), auto-scale none, scale 0.5

I have attached screenshots from iPad 1 and iPad 3 (retina).

The retina is close to acceptable but the edge on the cloud graphic is still less that stellar.

The iPad 1 is just plain awful. If I understand correctly this is displaying one of the auto generated mipmaps.

I have also attached the png atlas that 2DToolkit is generating from my graphics. It does not show any sign of these horrible edges, so I am hoping there is a Unity import setting I can tweak.

Any advice?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Ugly Edges
« Reply #1 on: September 25, 2012, 11:54:41 pm »
This is usually caused by the source image containing black outside the visible areas - new versions of Photoshop save this out correctly, but older ones dont and a lot of other apps don't correctly dilate the color channel. As soon as its incorrect you see horrible artefacts like this.

I suggest switching to premultiplied alpha - it should be a LOT better. Check the "premultiplied alpha" tickbox in settings & commit. After that select the material and switch to tk2d/PremulVertexColor. Does it look better?

dustinbahr

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: Ugly Edges
« Reply #2 on: September 26, 2012, 03:47:17 pm »
Perfect! Using premultiplied did the trick :) Now both resolutions are looking awesome. Thanks for the swift reply!

amaranth

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
  • Amaranthians rule!!!
    • View Profile
    • Amaranth Games
Re: Ugly Edges
« Reply #3 on: October 02, 2012, 08:08:29 pm »
I'm having the same problem, but I have a new version of PhotoShop (CS5.1). When I save something as a PNG, it always has a white background in Unity. When I looked at your spider image, it has a black background in Unity. Did you do something in PhotoShop to save alpha as black? Or is this something done in Unity? Most of my images have little white pixels around the edges where the sprite should be transparent in Unity.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Ugly Edges
« Reply #4 on: October 02, 2012, 08:12:33 pm »
Switch to premultiplied, that sorts out the white outline problem too.