Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Velocity wrong at < 60fps

Discussion in 'Visual Effect Graph' started by tertle, Sep 7, 2023.

  1. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626


    I'm finding if my FPS is less than 60, the velocity calculation of vfx graph is wrong and the particle slows down.

    I have tried all these settings


    I'm just using a SetVelocity (2,0,0) in Initialize Particle, no drag node.

    I can't imagine this is expected? Is there any known issue around this or am I doing something wrong?
     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,108
    Are you sure you are not changing playrate property or change it in the inspector (debug)?
    I think recently there was someone with quite similar problem, this one I guess, maybe it's related?

    Actually how to reproduce this? Set target frame rate to low?
     
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    I am definitely not
     
  4. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    128
    Morning. Just saw your post. I would like to help you but I need to be able to reproduce this issue on my end. Could you provide me with a small unity package with your test scene ?
    If not, I'll be happy that you gave us the reproduction steps so that we could try to help you. To finish, knowing your Unity Version, and SRP version (URP/HDRP version) would also help.
    Thanks a lot.
     
  5. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    I can send you the full project via bug reporter if you wanted but I can probably get you a smaller sample repo in a day or two.

    For now, this is Unity 2022.3.8f1 and HDRP 14.0.8

    The initialization of the graph in the above demo is a bit complicated, basically it's setup to have lots of the same projectiles represented by Entities merged into the same graph.

    Each projectile spawns a control projectile that just moves without an output with a simple Set Velocity in Initialize and then constantly triggering effects as it moves.

    upload_2023-9-12_19-6-49.png

    I'll try get a repo with a much simpler graph but it's basically something like this
    - do something to cause your fps to be low (i just spawned a lot of skinned mesh renderers). The lower the easier it is to see the difference. I was testing at 15fps
    - create a particle in vfx graph, set velocity in Initialize
    - at the same time create a gameobject or entity at the same time
    - move the gameobject either by giving it velocity in physics with no drag or just a simple update script
    - watch as the particle falls behind
    - measure the distance over 10 seconds and compare to where it should be vs where it ends up
     
  6. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    306
    Hello. VFX delta time is capped to prevent FX from "exploding" on frame stutter. By default it's 0.05ms. Which means application running under 20fps will see the effects slow down. You can change the value in the VFX project settings. I hope it fixes your issue.

    upload_2023-9-13_11-2-59.png
     
  7. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    Thanks Julien, this does indeed solve my issue.

    This wouldn't have been an actual issue in a build then as I don't expect fps this low but in editor when testing (with burst off) could get drops this bad and having the effect line up with the underlying object was important and it was concerning they were separating.