Author Topic: Force Drawcall?  (Read 7373 times)

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Force Drawcall?
« on: August 07, 2012, 11:38:12 AM »
I have a UIGrid-item which consists of two UISprites using the same atlas and between them lies a UITexture.

- UISprite2 (atlas01)
- UITexture
- UISprite1 (atlas01)

Now UISprite2 and UISprite1 obviously are drawn by one drawcall so UITexture can't be drawn between them. Now can I force an object to be drawn by another drawcall?

PS: Using another panel doesn't work inside the UIGrid.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Force Drawcall?
« Reply #1 on: August 07, 2012, 12:43:31 PM »
Why doesn't it work? Should work just fine. Adding an extra panel is the only way to separate them.

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: Force Drawcall?
« Reply #2 on: August 08, 2012, 04:23:57 AM »
Because everything parented to the UIPanel doesn't get clipped.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Force Drawcall?
« Reply #3 on: August 08, 2012, 08:48:40 AM »
You have to duplicate it like this
UIPanel1 (with clip)
-Grid1
-- Sprites1
UITexture (z value lower than UIpanel 1)
UIPanel2 (same clip)
-Grid2
-- Sprites2


Have your input only affect UIPanel 1 and make UIPanel 1 copy its settings (position, clip rect etc) to UIpanel 2 when it is updated.

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: Force Drawcall?
« Reply #4 on: August 08, 2012, 08:50:43 AM »
Hm.. this means I can't work conveniently with prefabs  :-\

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: Force Drawcall?
« Reply #5 on: August 13, 2012, 12:15:06 PM »
So there's no way to get this to work with only one item?  :-\

ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
Re: Force Drawcall?
« Reply #6 on: August 13, 2012, 01:26:01 PM »
Make a duplicate atlas with a different material pointing at the same texture as the first atlas?  Then have sprite 2 refer to the second atlas, it should end up in a separate draw call from sprite 1.

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: Force Drawcall?
« Reply #7 on: August 14, 2012, 11:25:09 AM »
Hm.. maybe better than nothing. Thanks!