Master VFX graph render all bullets via the Graphics Buffers?

Hi!
I’ve been trying to make a master VFX graph that managed all the bullets in the game using the Graphics Buffer feature to both get more into the Graphics buffer feature and the VFX graph in general.

Based on the siggraph 2021 showcase of the feature, so many thanks @VladVNeykov , i’m sure the C# side of things are fine. Unfortunately I can’t wrap my head around how to interpret the data.

The weapon triggers an event. “OnShot”

but it only shows one bullet at a time and all the bullets. Also it only shows the first bullet.
7705288--965389--SHots.gif

I’ve tried to set the spawn of the bullets to the bullet count but then it spawns all the bullets every time the weapon shoots. However it does show the bullets - tho not correctly all the time. also when the amount of bullets increases it breaks altogether.
7705288--965395--SHots02.gif

I feel like i’ve misunderstood something fundamental in regards to how to intrepret the VFX graph because it is not that complex of a graph!

2 Likes

Try replacing particleId with spawnIndex.

spawnIndex starts at 0 each frame, which should match your graphics buffer count.

3 Likes

That was an amazingly quick response!
I’ll give it a go as soon as possible thanks!

So the change worked, though it spawned the graphics buffer initial size, where every particle that has no data is just positioned at world zero point.

I’ve added an uint “IsAlive” to the buffer to kill all the particles that does not correspond to a projectile.
This unfortunately results in the first projectile being spawned.

If I resave the graph during play mode the particles spawn as intended with one exception.

7712698--966829--Shots03.gif

1 Like