Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Enter the 2020.2 Beta Sweepstakes for a chance to win an Oculus Quest 2.
    Dismiss Notice

VFX Graph Sorting Order

Discussion in 'Graphics Experimental Previews' started by dancitron, Jul 9, 2019.

  1. dancitron

    dancitron

    Joined:
    Aug 7, 2017
    Posts:
    6
    Hey all!
    I'm building an explosion in VFX Graph with multiple different vfx graphs to simulate different aspects of the explosions. I'm having issues with the rendering order in which the effects will flip quickly back and forth in front of each other. Is there a way to set the render queue for the vfx graph? See below for a sample of the issue!
    Thanks in advance!
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    194
    Hey @dancitron,

    Depending on how you have structured your effect, you can try the following:

    To sort individual outputs within the same VFX Graph asset, select the graph in the project folder and in the inspector reorder the outputs:


    To sort separate transparent systems, you can change their Transparency Priority within the Visual Effect component:


    And of course, you can also sort transparent particles with each-other within the same output:


    Hope this helps!
     

    Attached Files:

    qsleonard, mouurusai and dancitron like this.
  3. dancitron

    dancitron

    Joined:
    Aug 7, 2017
    Posts:
    6
    Awesome - thanks so much!
     
    VladVNeykov likes this.
  4. ju_my

    ju_my

    Joined:
    Mar 7, 2017
    Posts:
    17
    Hi, i have my vfx transparent particles rendering behind transparent objects but sorting with other particles systems is ok.
    Is there a way to sort particles with other shaders? Thanks
     
  5. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    194
    Hi @ju_my, the transparency priority should work when sorting against other non-VFX transparent objects as well, as long as they are not writing to depth. If you are using HDRP, just make sure your transparent materials have Depth Write disabled.

     

    Attached Files:

  6. ju_my

    ju_my

    Joined:
    Mar 7, 2017
    Posts:
    17
    Hi, thank you for your response but I'm using URP, depth writing options aren't available.
    Also, may i ask you if you know if lit output are planned for urp?
     
    diesersam likes this.
  7. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    194
  8. ju_my

    ju_my

    Joined:
    Mar 7, 2017
    Posts:
    17
    Okay well we juste have to wait.
    Thank you very much for your support!
     
    VladVNeykov likes this.
  9. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    475
    What about legacy renderer? In my game targets are stacked on top of each other and sorted using render queue. I'm trying to switch to VFX as old particles system have glitched trails. Is there maybe any manual way to switch whole render queue of VFX system to 4000 from 3000?



    I think I will shift all transparent materials to 2501 render queue, sort objects in 2502-2999 and keep vfx in 3000... Any better solution?

    Nvm added Render Queue myself https://forum.unity.com/threads/added-render-queue-to-vfx-graph-unity-2019-2.820749/
     
    Last edited: Feb 2, 2020
  10. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    181
    When is the sorting coming for URP?
    It doesn't seem to be available/working yet in 2020.1
     
  11. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    194
    Full URP VFX support is currently being worked on. There are a lot of items on the list: Lit shader support, camera buffer access, sorting, mobile support for compute-capable devices, etc. Some of the items we aim to land in the 20.2 release, others might take a bit longer into next year's release.
     
  12. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    20
    Hi! I'm using 2019.4.. lts. And how to sort rendering for subgraphs? I have flames, sparks, and smoke graphs, so I did flamethrower using all like subgraphs. so smoke always above everything, but for FPS view it's better when smoke gonna be last.
     
  13. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    194
    Hi @Toylips ,

    I don't think this is possible at the moment, but it does sound quite useful; we've added it to our backlog.

    In the meantime, it looks like the order is determined by when a subgraph was added, so maybe try adding the smoke effect first, and then everything else? (full disclaimer, tried this in the editor in HDRP, and it seems to remain after an editor restart, but this behavior is not heavily tested).

    If the suggestion above doesn't work for you, then the most reliably thing might be to add the various effects within a single VFX Graph as this supports output sorting.
     
unityunity