Search Unity

Bug What happens to particleID after we go over 4096 particles?

Discussion in 'Visual Effect Graph' started by cubrman, Jul 31, 2022.

  1. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    So I have this simple shader graph for my Visual Effect:

    upload_2022-7-31_19-20-55.png

    upload_2022-7-31_19-22-2.png

    This forces all my triangles (and I work with triangles in my Visual Effect) to form a diagonal line.

    It works great until I hit 4097 particles and then, as if by a queue, all triangles start to jump. And I have no idea where they jump to, but it is quite clear to me that something happens to the way you count particleId in your effects after particle count goes beyond 4096.

    Please tell me how to overcome this issue as I have quite a cool effect that relies on particleID being consistent.

    upload_2022-8-5_15-30-25.png
     

    Attached Files:

    Last edited: Aug 5, 2022
  2. Personuo

    Personuo

    Joined:
    Mar 19, 2014
    Posts:
    129
    if you use strip and want to get particle Id, you must use " particleIndexInStrip" node
     
  3. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    I was not using strips - just regular triangles spawned with a burst spawn.
     
  4. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    What is your particle buffer capacity? Also ss of graph might help.
    Do you have simple reproduction steps?
     
  5. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    @Qriva I've updated my original post. The visual effect graph is super straight forward and the custom shader graph is in that post too. Just reproduce these, spawn over 4096 particles and watch the show.
     
  6. The_Storm_Rider

    The_Storm_Rider

    Joined:
    Jan 28, 2020
    Posts:
    66
    Did you try with the shader graph only ? Maybe it's a float overflow or something to do with float precision.
     
  7. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    Actually I can reproduce this and it's very weird. My guess is that there is maximum capacity for particle chunk and it has something to do with that. However it does not matter if particle is displaced by shader or just directly positioned in vfx graph based on id - it's exactly the same and particles kind of "blink". The question is why id is able to change, when I spawn particles all the time or more than the capacity it would be understandable, but when I spawn 8001 particles in one burst for capacity 8192 there should not be any problem.

    when I pause the game and don't move mouse this is what I get
    upload_2022-8-10_23-7-35.png
    but when I cause scene window repaint by moving mouse, these particles just disappear randomly :D
    upload_2022-8-10_23-8-36.png