Hello Guest

Author Topic: Flashing line between vertex snapped sprites  (Read 4721 times)

Majicpanda

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Flashing line between vertex snapped sprites
« on: February 23, 2014, 03:53:55 am »
I have 4 GameObjects that each have a child GO with a tk2dSprite on them.  I have used vertex snapping in game to link them all together in a horizontal row.

In FixedUpdate I am moving the entire parent that all 4 GOs are in to the left to simulate the world moving underneath my characters feet.  This all works well except on "SOME" platforms I'm seeing a 1 pixel seam flash continually between where the 2 sprites join.  When movement stops sometimes the line is there and sometimes it is not. 

This problem seems to have gone away on the Web player in unity but has come back now that I've built for OSX.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Flashing line between vertex snapped sprites
« Reply #1 on: February 23, 2014, 08:57:06 pm »
1. Is antialiasing on?
2. Floating point issues could cause this. I wouldn't trust that vertex snapping thing either as I've seen it not put them at precise locations in the past.

Are you using 100 pixels per meter or something like that? I would try positioning by typing in numbers. Also, try some additional padding.

2 things could be happening here - either the vertices are getting snapped to the wrong pixels, or the texels are being sampled incorrectly. You can work out which by replacing the shader with something solid without a texture - if you still see it its vertex pos, otherwise its texels. Texels can be fixed by padding. If its pos, we need to get to the bottom of why, eg. try positioning with numbers to see if it helps.

Also, if you're not running pixel perfect, that adds a lot more potential for mad stuff to happen.

Majicpanda

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Re: Flashing line between vertex snapped sprites
« Reply #2 on: February 24, 2014, 04:20:15 am »
http://tinypic.com/r/2uoj9ja/8

There's the vid of what's happening.  AA is off and it's only happening on certain platforms so it almost seems like texture compression is somehow affecting it? Like on web player it isn't happening anymore but PC and OSX it is.  iOS it no longer occurs either.

I started dev on this game a long time ago before the per meter thing, we're currently designed at Explicit, Ortho 10, Target Height 144, Pad Amount 1, point filtered reduced 16 bit compression (tried truecolor same result).

Ok here's a really weird test I just ran.. if I leave the game set to "Good" quality when launched the problem goes away, but on Fantastic it comes back.. now I'm really confused.
« Last Edit: February 24, 2014, 04:22:45 am by Majicpanda »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Flashing line between vertex snapped sprites
« Reply #3 on: February 24, 2014, 12:09:44 pm »
Are you really really sure antialiasing isn't on in Fantastic?

Majicpanda

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Re: Flashing line between vertex snapped sprites
« Reply #4 on: February 24, 2014, 07:13:48 pm »
Dunce cap and sit in the corner... this fixed it.  My quality settings are getting reset between git pushes sometimes among my different dev computers.  I will make sure I look out for this every build and go consult the unity gods for a way to make sure this gets pushed through git commits.

Thanks again.