Hello Guest

Author Topic: Isometric Draw Order Problem  (Read 6577 times)

boehmz

  • Newbie
  • *
  • Posts: 7
    • View Profile
Isometric Draw Order Problem
« on: November 08, 2012, 05:08:32 am »
In an isometric view, when a small sprite goes far away enough from the camera from a larger sprite that it's supposed to be on top of.

The main character gets drawn underneath the floor at the back here:


But in the editor, moving the camera to a side view shows he's clearly on top.



Basically I want to order draws by y-position only(I think, maybe there might be some weird exceptions case even with that).  I'm using orthographic camera with rotation of 45,45,0 euler.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Isometric Draw Order Problem
« Reply #1 on: November 08, 2012, 10:04:41 am »
The whole tilemap will be drawn in one draw call - so you'lll have to make sure your character is in front of the whole object, not just the few tiles there. Easy way to tell is to select the tilemap mesh and look at bounds.

boehmz

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Isometric Draw Order Problem
« Reply #2 on: November 09, 2012, 01:52:53 am »
Seems like a tricky problem.  We want our character to be able to walk to the back of an object and still be on top.  Currently we kinda hack it by putting the floor objects way below(since it's orthographic, and camera angle doesn't change).  Any tips you can think of to get around it through shaders or any other draw settings?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Isometric Draw Order Problem
« Reply #3 on: November 09, 2012, 06:34:47 pm »
Couldn't you can use tilemap layers to help here? YOu could put the foreground objects in a different layer to the background and then move your character in front of or behind them.

boehmz

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Isometric Draw Order Problem
« Reply #4 on: November 12, 2012, 02:06:20 am »
Even when making layers of tiles, the lower layer sometimes gets drawn on top when viewing the tilemap not completely top down.



Uploaded with ImageShack.us

That is an example of a tilemap with all red tiles on the top layer and all blue tiles on the bottom layer.  At about halfpoint, the blue tiles get drawn on top of the red tiles.

I'm fairly fluent at rendering techniques, what files handle the batching of draw calls?

boehmz

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Isometric Draw Order Problem
« Reply #5 on: November 12, 2012, 06:28:41 am »
Nevermind, was replacing the tiles with prefabs.  I think I got this all worked out.