Particle System vs Visual Effect Graph in Performance

Hello all. I am working on a project that requires 100s of projectiles. At the moment I am using small cubes with emission to give the illusion of a bullet. I was testing around which vfx to use. Visual effect graph looks really good and I really love the flexibility in it but the problem that I am facing with visual effect graph is with performance.

I made a simple test with visual effect graph and particle system. I have also attached the images for the test below. I created a scene with 200 similar visual effect graph objects and 200 similar particle effect objects.

When I enable only the visual effect graph objects then my fps drops a lot from 350fps to around 150fps. I checked the stats and there I found out that objects are not batching and all of them calls SetPass individually which means 200 setpass calls and 0 Saved by batching.

When I enable only the particle system objects then my fps drops from 350fps to 250fps. I checked the stats for particle system objects as well and the SetPass call is 3 while the Saved by batching is 199.

I used the frame debugger to check if this is true but things got a bit stranger. For the Particle System under the Draw Dynamic tree it says “SRP: Node is not compatible with SRP batcher”. Not sure entirely what it means but my guess is the Particle System objects are not batched but then again the fps value does not reflect that.

For the Visual Effect Graph objects I did not find any messages where it says it is not compatible with SRP batcher. So from the Frame Debbuger perspective it is the Visual Effect Graph that should be batching but the fps value does not reflect that.

So my question is, is there a way to batch the Visual Effect Graph like the Particle System? Am I reading the frame debugger wrong or is it showing wrong debug value? If I look from the performance point of view then I should be using Particle System.

Thank you,
Kamran

Here are the images for the test and the Visual Effect Graph that I am using:


200 Particle System Objects


200 Visual Effect Graph Objects


A simple Visual Effect Graph

3 Likes

Things work little differently between the two. The old particle system runs on CPU and the new one runs on GPU. If you notice, you have to set a material in the old particle system. I am assuming you have that set to instanced? I don’t think you can do such thing in the VFX Graph.

This is probably not the answer you are looking for but on the new one (VFX Graph), you should be able to easily do millions or even billions of particles! Note I said particles, not systems. With the VFX graph you should be able to create millions of projectiles with one system (graph). Just move it around as you fire. I don’t see a benefit to having hundreds of separate systems if projectile looks exactly the same.

Something like this:
ProjectileVFXManager.Fire(Position, Direction, Speed)
{
//then move the target VFX, set the parameters and fire.
}

That being said, you should be able to do hundreds of systems without issues (though I haven’t tested this out myself). I am not sure if you can batch, maybe someone else will be able to answer this.

P.S. This is unrelated to the question. I am not sure if this is on purpose but, you have a flipbook but you do not have a flip book player in the update. :slight_smile:

2 Likes

@FlightOfOne thanks for the info. I am not sure why I didn’t get an alert from your reply. But the information you provided is very useful.

This is very interesting. Didn’t think about using one system to create many particles as projectiles. But the downside for this I assume is there will be no collision? If not it could still be used as some sort of visual effect for faking some projectiles.

I use the flipbook as Texture Sheet only. Don’t need the animation. Not in this case that is. :slight_smile:

Correct, no collision not through the vfx system. You’d need to handle it separately, like using a raycast or invisible collider following the same trajectory.