Hello Guest

Author Topic: Sprites not tessellating properly, shadow on edge  (Read 3853 times)

dbanfield

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Sprites not tessellating properly, shadow on edge
« on: July 21, 2013, 07:17:41 pm »
Hi,
I only bought 2d toolkit a couple of weeks ago so still figuring it out. Setup some sprites on my main character quite easily. Now replacing some of the platforms with some artwork.

That's when I started running into trouble. I have some typical platform artwork which includes a left-hand piece, a centre piece which can be repeated as necessary and a right-hand piece. I was starting to have problems getting the pieces to line up without a gap when using the vertex snapped function of unity. There seem to be a dark line between the 2 sprites. So I started a test (Unity 4.1.5).

Create a 64 x 64 completely white PNG
New scene
create a new sprite collection and add my white PNG
create a new sprite in my scene, select the sprite collection and the white PNG
duplicate the sprite (or add a second of the same)
use the vertex tool to snap them side-by-side


And what do I see? A nasty grey line in between the 2 perfectly aligned sprites.
I now see that when I zoom in closely there is a small grey shadow around the entire outside edge of the white sprite.


How do I get rid of this? I've been messing around with some of the render settings, trying each kind of camera which changes nothing, and I don't understand why a straightforward sprite should default having some kind of shadow around the outside.

Please help! :(

Thanks
Dan

dbanfield

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Sprites not tessellating properly, shadow on edge
« Reply #1 on: July 21, 2013, 07:27:37 pm »
One of those moments when you finally solve the problem moments after posting...

For anyone else, change your filter mode to "Point" on your sprite collection. This solved it for me.

There is actually a helpful message if you change your sprite collection "pad amount" to 0 indicating that some sprite bleeding will occur unless you change your filter mode to "Point".

If there are any other more ideal ways though, please let me know.
Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites not tessellating properly, shadow on edge
« Reply #2 on: July 21, 2013, 08:39:39 pm »
To get it to work with padding, and bilinear filtering, you could try this
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,294.0.html

dbanfield

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Sprites not tessellating properly, shadow on edge
« Reply #3 on: July 22, 2013, 07:01:27 pm »
Awesome! Yes this is much better since I retain bilinear filtering and everything looks a lot nicer.

Thanks!