Hello Guest

Author Topic: Possible draw order bug.  (Read 4510 times)

Porthos

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
Possible draw order bug.
« on: June 19, 2012, 05:53:09 pm »
Draw order messed up in Scene view.

Everything displays fine in game view and in game, but sprites that are clearly behind other sprites are often drawn on top in the Scene window.

Not really too big of a problem or anything, just did not see any mention of this in the forums.

If this is not a known bug, I can provide more info.

P.S. This could be a cool Fez like game idea, where things are drawn arbitrarily instead of based on their position in 3D space.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Possible draw order bug.
« Reply #1 on: June 19, 2012, 11:41:29 pm »
This is a known issue and there isn't really a fix for it, apart from using an ortho camera in scene view. Simply right click on the axis gizmo in the top right of scene view, and select back. You shouldn't have any sorting issues when perspective is off.

Wrywulf

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Possible draw order bug.
« Reply #2 on: June 25, 2012, 09:22:18 pm »
I also experience this bug and actually I still see the messed-up z-ordering even if I choose "Back" as my scene view cam (which I always use anyway).

I have lots of 2D sprites (buttons, text meshed etc.) that are separated i Z by only a few units (even a fraction sometimes) and I've noticed that it seems all the ones using a transparancy shader have this problem... don't know if that makes sense or not. When I pan the camera around some sprites become invisible and some become visible. It seems to me that if the camera is placed directly  in front of a sprite its z-ordering is correct. But the "off-center" ones disappear.

Is this a known issue with Unity 3.5 or with 2D Toolkit?

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Possible draw order bug.
« Reply #3 on: June 25, 2012, 10:41:09 pm »
I'm not really sure if I'm describing the same thing here. If possible could you send me a screenshot or two showing the problem to support at unikronsoftware dot com?

Unity 3.5.3 will have a more advanced sorting mode for sprites & perspective cameras which should work a lot better. This was announced on the unity blog today (http://blogs.unity3d.com/2012/06/24/unity-3-x-and-4-x-going-forward/). Don't know how it'll work in the viewport cameras though.