Hello Guest

Author Topic: Mesh Sorting Incorrect when using Bottom-Right render order  (Read 3829 times)

esdot

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Mesh Sorting Incorrect when using Bottom-Right render order
« on: August 15, 2014, 05:15:37 am »
For some reason, the render mesh's appear to be ordered correctly in the Editor pane, but in the game preview, they are incorrect:
http://cl.ly/image/0g0M0u1E412S

You can see the overlap at the bounds of the mesh.

Seems to be related to the way z-index is assigned. It's currently:
Mesh_0_1 - -1e06
Mesh_1_0 - -3e06

Which looks fine in editor, but is broken in game.

If I manually type in:
Mesh_0_1 - -1e05
Mesh_1_0 - -3e05

It renders correctly. So maybe some weird precision bug with the unity renderer?

I know I can probably fix this at runtime with a simple script, but thought you might like to know.
« Last Edit: August 15, 2014, 05:26:29 am by esdot »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Mesh Sorting Incorrect when using Bottom-Right render order
« Reply #1 on: August 15, 2014, 11:40:48 am »
I wouldn't bother with z indexing. Modify the code to write out the correct Renderer.SortingOrder value so it is guaranteed to be in the right order. This overrides the z values

esdot

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Mesh Sorting Incorrect when using Bottom-Right render order
« Reply #2 on: August 15, 2014, 03:33:45 pm »
Ok cool thx, will do for now. Are you planning on patching the issue?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Mesh Sorting Incorrect when using Bottom-Right render order
« Reply #3 on: August 16, 2014, 11:57:21 am »
Dont plan on doing anything with sorting order in the toolkit - its too specific to the game, and theres no reliable way to cascade these in Unity...