Author Topic: Particles, panels and render queue  (Read 4653 times)

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
Particles, panels and render queue
« on: December 08, 2016, 09:54:08 AM »
I ran into some problems with particles in a setup where I have multiple panels on screen. Using Unity 5.5/NGUI 3.11

I have used to have setups which worked in the past, with particle effects attached to my UI elements and then using the render queue modifier script (http://www.tasharen.com/forum/index.php?topic=776.msg34546#msg34546). I am currently trying to set up a scene containing multiple panels (windows) with particles in some of them. However particles are always rendered wrong now, behind or in front of things they shouldn't be when there is more than one panel in the scene.

I tried giving the panels and particles individual render queue start numbers to make sure they have the proper order but it doesn't seem to help. In a setup with only one panel and the particles in it everything works as it should.
The UIPanel documentations say individual render queue numbers are the way to go but I am not sure if this is working anymore.

Any non-hacky ideas on how to get multiple panels working with particles in between them?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Particles, panels and render queue
« Reply #1 on: December 08, 2016, 07:13:53 PM »
Can you submit a simple repro case for me to have a look at? (support [at] tasharen.com)

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
Re: Particles, panels and render queue
« Reply #2 on: December 09, 2016, 10:16:26 AM »
Email sent.

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
Re: Particles, panels and render queue
« Reply #3 on: December 15, 2016, 03:30:38 PM »
I'll update the thread here, so that everybody who might have a similar problem has some hints.
I got particles on/between various UIPanels to work fine with the following setup, as recommended by ArenMook:

- Set individual render queues for the panels
- Changed UIPanel.cs line 1570 from
  1. dc.sortingOrder = (mSortingOrder == 0) ? sortOrder : mSortingOrder;
to:
  1. dc.sortingOrder = (mSortingOrder == 0 && renderQueue == RenderQueue.Automatic) ? sortOrder : mSortingOrder;
- Added RenderQueueModifier script to particle effects

daifan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Particles, panels and render queue
« Reply #4 on: February 22, 2017, 03:59:39 PM »
Thank you for the help! This solved my problem!

@ArenMook, is there any specific reason this is not fixed in the official release of NGUI? Thank you!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Particles, panels and render queue
« Reply #5 on: February 24, 2017, 08:30:02 AM »
The last release was on December 10th, this post is from December 15th. :P

I really should put up a new version... In fact, let me do that shortly.