Search Unity

Question Breaking calculations of VFX.

Discussion in 'Visual Effect Graph' started by koirat, Mar 30, 2023.

  1. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    I'm completely fantasizing in here, but:

    During my play with "Alive" Attribute of VFX I was thinking that even if I set Alive to false all the calculations after setting Alive = false are still going to be performed. (except rendering)

    Now naturally this is to be expected.

    But would there be an option to have conditional kind of return or break, so I could prevent VFX from further calculations.

    Now it is all about performance, and I'm wondering if there would be benefits of such a functionality.
     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    Definitely not a compute shader expert, but I guess most of the time it would not give any benefits.
    My reasoning is that when you run the same code on all GPU threads and some of them could skip calculations because particle is not alive, then you still must wait for all other "pipes". You could maybe benefit from it only if all particles died at the same time, but this does not usually happen, plus most of vfx effects require simple integration like update velocity, rotation and aging+death check.
     
  3. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Unfortunately many vfx requires Matrix operations like moving between world and local space.

    I cannot relate to the rest of your comment since I don't feel strong enough in this subject.