1
\$\begingroup\$

Why particle effect alway rendered after UI though they have same sorting layer and same sorting order?
I searched a lot of information about it,every one said that both of effect and UI are controlled by sorting order and sorting layer.If UI's sorting layer is same to effects' and sorting order is bigger then effects', then UI will render after effect and the result is that UI cover effect.
But what they will do if they have the same sorting layer and the same sorting order?I found that effect alway cover UI in this case.I think this is because effect render after UI. But why?
There are some pictures below:
hierawchy picture particle system setting SubCanvas setting
Hope anyone could answer me.Thanks.

\$\endgroup\$
7
  • 2
    \$\begingroup\$ From what I understand, the problem is that you have some UI and a particle system, and the particles render below the UI? It would help if you shared more details about how your project works. \$\endgroup\$
    – TomTsagk
    Sep 3 '19 at 14:24
  • \$\begingroup\$ What kind of UI are you using? What are its settings? \$\endgroup\$ Sep 3 '19 at 16:33
  • \$\begingroup\$ @TomTsagk Ok.Here is serveral pictures what i catcure. hierawchy picture particle effect setting sub_canvas setting. Like pictures show that my particle effect penetrate(i think the reason is the particle effect rendered below the SubCanvas so the effect cover the SubCanvas' UI) the UI though my particle system's sorting order and sorting layer is same to SubCanvas. \$\endgroup\$ Sep 4 '19 at 2:15
  • \$\begingroup\$ @Draco18s i'm using UGUI, just created an image and change its color.You can see the detail in hierawchy picture particle effect setting sub_canvas setting. \$\endgroup\$ Sep 4 '19 at 2:20
  • \$\begingroup\$ I believe you mean why particles is always rendered in front of ui if both of them have same sorting layer and sorting order? \$\endgroup\$
    – Swati
    Sep 4 '19 at 4:19
0
\$\begingroup\$

After your question I was curious about why particles system always render in front of the UI when both UI and Particles system are having same sorting layer and sorting order.

So I find out some thing interesting:

Project Hierarchy: same project hierarchy is used for both situations.

enter image description here

Situation # 1: Canvas (Render Mode : Screen space overlay):

screen shot:

enter image description here

Frame debugger: enter image description here

So from frame debugger its clear that if Canvas render mode is Screen space overlay the all of the scene objects are rendered before canvas.



Situation # 2: Canvas (Render Mode : Screen space Camera):

screen shot: enter image description here

Frame debugger: enter image description here

So frame debugger making things clear that canvas is rendered prier then particles if Canvas render mode is Screen space camera.



Summery: As for both of the Canvas and Particles sorting layer was "Default" and sorting Order was "0".

But in screen space camera particles was rendered after canvas so we see prticels in front of the UI.

while in case of the screen space overlay UI was rendered after Particles , so we saw canvas in front of the Particles.

Which means Unity do change rendering order for in different situation. I hope this will clear your confusion.

\$\endgroup\$
3
  • \$\begingroup\$ A little while ago you accepted my answer and you said it help but now you have unaccepted my answer and removed the comment... I don't care about reputation but that was not nice. \$\endgroup\$
    – Swati
    Sep 5 '19 at 9:32
  • \$\begingroup\$ I'm sorry,i watched your answer yesterday and i thought it is right, so i accepted your answer, and a little while i thought i should hava a try by myself to convince so i unaccepted it.But then i forgot to reaccept it due to other works.Sorry again. \$\endgroup\$ Sep 6 '19 at 2:11
  • \$\begingroup\$ that was totally fine some time thing happiness and people forget things. i would be quit straight with you that i love to help people and in return i love peoples apparition. Any way thanks for showing apparition. \$\endgroup\$
    – Swati
    Sep 6 '19 at 4:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.