VFX Graph Sorting Order

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!

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!

4736447--448910--2019-07-11_15-50-14.gif
4736447--448916--2019-07-11_15-52-58.gif
4736447--448922--upload_2019-7-11_15-56-14.png

13 Likes

Awesome - thanks so much!

1 Like

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

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.

5330526--537039--dPtdaeoX6Q.gif

1 Like

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?

1 Like

Hi, you are correct, sorting VFX with other transparent objects is currently not working in URP. We have logged the issue, you can keep track of its resolution here: Unity Issue Tracker - [URP][Sorting] VFX cannot be sorted with other transparent objects in URP

And yes, lit outputs for URP are planned for this year.

1 Like

Okay well we juste have to wait.
Thank you very much for your support!

1 Like

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://discussions.unity.com/t/774916

When is the sorting coming for URP?
It doesn’t seem to be available/working yet in 2020.1

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.

1 Like

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.

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.

1 Like

Hi @VladVNeykov ,

I noticed that when others have flamethrowers, those graphs should be resorting somewhere in update, cause I can see them from all sides ) is it possible to sort using distance to the main camera?

Thank you very much for your support!

The best solution I can imagine would be an option that allowed to generate VFX effect as normal transparent quads (sorted with other transparent objects in scene).
Or sorted separately with other transparent objects inside bounds and other particles from other VFX that bounds are intersecting.

Yes I know. Performance. But still having this choice would be awesome.

Sorry, I didn’t quite follow; is this for sorting between different flamethrowers altogether, or the different outputs within the flamethrower effect (i.e. smoke with fire)? If it’s the latter, are you saying that the order changes for other’s flamethrowers?

The GPU sorting in the individual outputs sorts them based on distance, but that’s per-particle. Otherwise, I believe the bounds of the VFX are used for sorting.

1 Like

Hi there, sorry to take this thread back from the abyss :stuck_out_tongue:

Is there a way to sort particles between 2 different outputs (graphs actually) but per-particle? I do not want to give the priority to graph A over graph B, I want the particles between the 2 systems to blend correctly. Here’s an example:
k7ghy8

Thanks so much!

Hi @marcrem ,

You won’t be able to mix the sorting of particles in different systems as they are in separate draw calls. Your can try making the particles from the whirlwind base spread out and go larger the higher they go to make a seamless transition:

7081897--842716--upload_2021-4-27_11-32-57.png

2 Likes

Hi, thanks for the answer, much appreciated!

I see, so it’s not possible. My issue is that I’m making a physically realistic simulation, and the cloud above the tornado is called a wall-cloud. It is independent of the tornado and has its own shape and behaviour. Here’s an example:

https://www.youtube.com/watch?v=CRzElxPzFVg

As you can see, the wall-cloud above is a much larger rotating cloud having its own behaviour, and the funnel that constitutes the tornado comes out of it. I do have control over the shape of my tornado and I can make it larger on top when needed.

In your example, the tornado would be at the end of its life cycle so the wall-cloud is pretty much all gone.

Scratching my head here as to how I could “cheat” my way into making it work. Any idea?

Thank you again so much for your time.

I see!

Not sure if this will meet your needs, but you might alleviate the popping a bit if you set the priority at the Visual Effect component of the wall-cloud to be higher than the one of the funnel (the second example from this post in this thread) so it always draws on top. It should then always look like this from the side:

This, however, won’t hold very well when you are looking at it from below though.

Alternatively, you can think of making the funnel be an actual opaque (or alpha cutout) mesh or at least alpha cutout particles, so you won’t get the sorting issue. Something like this, but less stylized.

You can still cushion it with some transparent VFX which will have the same sorting issue, but the main structure will be distinct enough to sell the illusion well without popping behind the wall-cloud.

7083937--843064--upload_2021-4-27_22-0-8.png

1 Like