Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Bug? Play Rate causes completely different simulation, not just speed change.

Discussion in 'Visual Effect Graph' started by dgoyette, Jun 18, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    I was noticing that some weird jitter in one of my graphs wasn't happening when I slowed it down via the Play Rate slider. I found that Play Rate doesn't just change the effective timescale the system is using; it can cause completely different simulation results.

    The simplest example is to start with a completely new VFX graph, and then just add a "Confirm to Sphere" node to its Particle Update block. Here's what it looks like at 100% Play Rate:

    upload_2020-6-18_11-28-36.png

    But if I increase the Play Rate to 500%, here's the result:

    upload_2020-6-18_11-29-9.png

    The further I increase Play Rate, the worse it gets.

    My expectation is that changing Play Rate is merely like running the simulation in fast-forward. The particles should all go to where they would normally go, but the whole system just goes faster. But instead, it seems that some aspects of VFX graph are incorrectly handling the play rate, and it's resulting in a different simulation.

    Something similar happens with the Turbulence node. Here's some turbulence at 100% play rate:

    upload_2020-6-18_11-32-1.png

    And again at 500%:

    upload_2020-6-18_11-32-32.png

    At 500%, none of the particles go down now, and them clump together a lot more rather than fanning out.

    This is using VFX Graph 7.4.1 under Unity 2019.4.0.
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    It would be nice too know if this is a bug, or if there's just a reason for this that I don't understand. As I see it, it makes the Play Rate slider really unreliable, as pretty much any system I create behaves very different depending on the Play Rate.

    Here's another system I'm working on, some lighting going out from the center. Here's a capture at 100 Play Rate:

    upload_2020-6-29_14-36-18.png

    And a capture at 5 Play Rate:

    upload_2020-6-29_14-36-59.png

    In this case, I think it's an Add Position node that's executing more often (relatively speaking) at a slower Play Rate than it should be.

    I'd really like to use Play Rate to examine the fine details of my systems, but currently it has side effects.
     
  3. pjbaron

    pjbaron

    Joined:
    Jan 12, 2017
    Posts:
    53
    Looks to me (from the sphere and the lightning) as though play rate is increasing a time step instead of calling the update X times, resulting in large straight line travel for higher values. It's harder to interpret the turbulence images.

    This might be impossible to fix for GPU updates (can you trigger them whenever?), however I read somewhere recently that they're considering a CPU emulation... play rate should work properly when that is ready if they implement it properly.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    It's interesting to think that this might not be something they can fix, if it's kind of just up to the GPU. I don't pretend to have any idea how VFX Graph stuff actually executes when it comes to the GPU. But that's an interesting thought. If that's true, I wonder if I'd even notice a different result from Play Rate if I ran Unity with my on-board graphics instead of my dedicated GPU.