Author Topic: NGUI 3.0.2 and particles - how to make depth sort right?  (Read 10377 times)

wildmandnd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
NGUI 3.0.2 and particles - how to make depth sort right?
« on: October 20, 2013, 04:23:22 AM »
Hey, I've upgraded to 3.0.2 and sorted out all issues with the widgets. The problem I can't solve is with particles: NGUI widgets are rendered on top of any particles in the screen. I've tried Shuriken ones as well as some legacy with no luck. Changing camera's type from "UI" to "World" does not help.

It seems the issue is not only with the particles, but any non-NGUI object, like cube or sphere. Widgets are being rendered on top of them no matter what.
How that could be fixed so other objects get the right z-sorting?

pahe

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 37
    • View Profile
Re: NGUI 3.0.2 and particles - how to make depth sort right?
« Reply #1 on: October 20, 2013, 05:21:27 AM »
Maybe this helps you, I asked the same question with 2.7 (when depth sorting was introduced) and my particles still work correctly with this custom shader.

wildmandnd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: NGUI 3.0.2 and particles - how to make depth sort right?
« Reply #2 on: October 20, 2013, 05:59:10 AM »
Thanks, I've added second camera for particles render and it works like a charm.

However question is still relevant as it is unclear how to make a "sandwich" with NGUI widgets and other objects like cubes.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0.2 and particles - how to make depth sort right?
« Reply #3 on: October 20, 2013, 04:09:38 PM »
I've answered this question before. Short version: put your particle systems on a render queue of 3000+depth, where depth is where you want them to be.