An Idea for Avoiding Sort Issues in a Common Explosion FX Setup

An Idea for Avoiding Sort Issues in a Common Explosion FX Setup

Let’s assume the shockwave is red and the explosion is blue.

If the red shockwave has a Sort value of 1 and the blue explosion has a Sort value of 0, or vice versa, where the red is 0 and the blue is 1,
it can cause unwanted visual interference between the two effects.
1
2

So, I came up with an idea to separate the ring-shaped shockwave into front and back sections relative to the camera.

I divided the ring-shaped resource into two halves based on the camera position, and then selectively killed the particles so that one half exists in front of the camera-facing side and the other half exists behind it.




With this setup, if the final Sort order is:

Red = 2 → Blue = 1 → Green = 0

the resources are sorted in a consistent order, which prevents them from visually interfering with each other.
3
4

This is the approach I came up with so far.

If there are more effective ways to handle this kind of sorting issue, I’d love to hear your ideas and share solutions so we can improve the technique together.

Thank you!

5 Likes

I have done similar things with unity’s vfx graph in the past, there is one caveat that might be an issue though: rotating cameras.

lets assume the game has a photo mode and the player pauses during the explosion (which sounds like a cool frame to capture) and rotates the camera around to the other side - sorting broken.

As much as it pains me, it might make more sense to emit two full circles of red and green but only make one half visible each and constantly evaluate that visibility in particle update.

in the end, this is --generally-- not worth pursuing as updating it for dynamic scenes (as Fleity said) is very costly.

VFX has always been smoke and mirrors; just hide the problem with smoke and mirrors.

1 Like