Modifying position of visual effect changes appearance

I have a simple electricity effect that changes appearance based on the transform position. It looks the way I want it to when the transform is [0, 0, 0], but when X is greater than 5000 or so, some of the particles end up far away from their expected position, making the effect extremely “sparkly”.

Here’s what it should look like…

Here’s what it looks like when the transform position is changed (imagine the outliers jumping around wildly from frame to frame)…

Here’s the graph…

Any idea why this is happening?

  • VFXGraph 16.0.6
  • Unity 2023.2.20

If it’s position based, then it’s float precision related issue. It is common problem and it becomes visible around 3000-10000 unit, although I think yours is quite strong for such a distance.

Most likely the noise node is causing this, there are similar problems in shader graph noise with larger values.
However, it might be good idea to check if the same happens if you disconnect time from Y and make it constant, because if you run unity for longer time, this number can become really big, especially if you multiply it by some number greater than 1.

1 Like

Thanks. Sounds plausible.

I’ve reproduced your VFX setup on my end and didn’t have any issues. Could you send me your VFX and Unity/VFXGraph package version ? Thanks a lot.

Thanks for looking into this…

Unity 2023.2.20
VFX Graph 16.0.6

Would you screenshot your version? I’d like to see how the transform positions are accessed.