Unexpected behavior of spawnIndex

Hello,

I’m experiencing some unexpected behavior with spawnIndex: spawnIndex depends on Particle Per Strip Count in the Initialize Particle Strip context of VFX Graph 10.5.0 of 2020.3.14f1 (and 12.1.0 on 2021.2.0f1).

Expected behavior: If a Spawn system outputs a single burst of N particles, then there will be N spawn indices, from 0 to N-1, inclusive. This behavior is independent of any other value in VFX graph.

I made a graph that spawns two particle strips, each with three particles, via the above assumption:

However, when I increase the Particle Per Strip Count in the Initialize Particle Strip context from 3 to 4__,__ I get this unexpected output:

Here is the graph that produces the expected result:

(space to prevent the expanded version of the above image from blocking part of the post)

And here is the only change I made to lead to the unexpected result: Changed Particle Per Strip Count from 3 to 4:

You’ll notice that one of the particles is black, despite there being no block in this graph causing the color black. This particle seems to have not gone through the Initialize Particle Strip context because otherwise it would be either red, orange, or cyan, not black, and it would have a non-zero y-coordinate instead being at the origin.

In the Strip Index group you’ll find a Modulo 2 node to ensure that only a 0 or a 1 can enter the Strip Index port. So this particle should be red or orange, not even allowing cyan.

The black particle seems to be an undefined particle with default values and yet has a rendered Particle Quad associated with it. I’m not sure what is going on.

Same unexpected result on VFX Graph 12.1.0 on Unity 2021.2.0f1:

7621885--947917--upload_2021-11-2_2-42-17.png