Search Unity

Issue with moving particles and Motion Blur in PostProcessStack

Discussion in 'Image Effects' started by Chupos, Feb 15, 2017.

  1. Chupos

    Chupos

    Joined:
    Sep 9, 2012
    Posts:
    10
    I'm currently having issues implementing the PostProcessingStack in our game, particularly with instances of particle systems on moving objects. Almost all of the particles in our game are opaque meshes (ie. not alpha billboards) using Shuriken.

    Most particles work fine, but several particle effects that we have parented to other Transforms are displaying incorrectly.

    What the particles look like with no Motion Blur, with Blur and with the Motion Vector arrows:
    http://imgur.com/a/glwuy

    The motion vector debug view is particularly interesting, the arrows are wildly different and all seem to be pointing towards the world origin (The giant orange drill sits roughly at 0,0,0).

    I'd usually just turn off the motion vectors if this was a regular mesh, but since it's a Shuriken particle system I can't see a way to actually access the Mesh Renderer.

    This is with the latest build (Beta 4), and in Unity 5.5.1p3 in Editor and builds on Windows (untested on OSX/Linux). We're also seeing the problem on console platforms. I'm using Deferred rendering with FXAA, Bloom, Grain and Vignette, although changing the other settings don't seem to have any impact on this issue.

    Anyone have any ideas how I can work around this?
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Hey!

    So, you have uncovered a couple of problems :)


    1. We have not added the motion vector selection drop-down to the Particle System Renderer Inspector. I will fix that, but of course this doesn't help you right now.

    Right now, your only option is to set the value from script: https://docs.unity3d.com/ScriptReference/Renderer-motionVectorGenerationMode.html

    Add something like this to a Start or Awake function of a script attached to your Particle System:

    Code (CSharp):
    1. ParticleSystemRenderer renderer = GetComponent<ParticleSystemRenderer>();
    2. renderer.motionVectorGenerationMode = MotionVectorGenerationMode.Camera;

    2. We don't support per-particle motion vectors. What I think you are seeing, is per-object (i.e. camera + transform).

    If you are able to write your own shaders, you can try to implement this yourself. In Unity 5.5, you are able to send custom particle data to the shader (See Custom Vertex Streams in the Renderer Module). If you send the particle velocities, you could use them in a motion generation pass.

    Note, that for perfect motion vectors, you would also have to use the rotational speed (which I think we only exposed to shaders in 5.6) and also changing particle size (which we currently have no way of tracking). So you would still expect to see some issues (eg ghosting) if trying to write motion vectors for particles with changing size/rotational speed.

    Here is a doc with an example of how to use the Custom Vertex Streams feature, but we don't currently have any examples for using the feature to generate per particle motion vectors: https://docs.unity3d.com/Manual/PartSysVertexStreams.html

    Hope it helps!
     
    unity_DSYbFQm0BalyjA likes this.
  3. Chupos

    Chupos

    Joined:
    Sep 9, 2012
    Posts:
    10
    Awesome, that's a huge help. I ended up just using that script snippet on the affected particle systems, we can probably live without the per-particle motion blur in our case.
     
    richardkettlewell likes this.
  4. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I'm having issue with this too. In 2018.2.0f2
    upload_2018-8-30_0-6-1.png

    upload_2018-8-30_0-6-7.png

    I've tried all motion vector options in the drop down. same ressult. This is a particle system with a tiled texture attached to a falling building.

    upload_2018-8-30_0-8-6.png


    postprocesing stack v2

    aside: stats are devastating since I moved all shaders to gpu instancing.
     
  5. laessnb

    laessnb

    Joined:
    Jun 10, 2014
    Posts:
    101
    Having this issue in 2019.2+.
     
  6. ninjagabriel

    ninjagabriel

    Joined:
    Nov 25, 2018
    Posts:
    1
    same problem
     
  7. valairan

    valairan

    Joined:
    May 1, 2016
    Posts:
    2
    I had the same problem when I tried to make a muzzle flash. I'm not sure if this is a solution, but setting the motion vector to force no motion fixed it for me.
     
    angelonit and Baerchen1 like this.
  8. SDTF

    SDTF

    Joined:
    Sep 3, 2020
    Posts:
    9
    Oh My God thank you!
     
  9. KyleDev1

    KyleDev1

    Joined:
    May 15, 2021
    Posts:
    2
    Same Issue
     
  10. thomasphifer

    thomasphifer

    Joined:
    Mar 26, 2016
    Posts:
    13
    WOW! I have been stuck trying to figure out what was going on for MONTHS. Motion Vector: Force No Motion solved everything. Thank you!
     
  11. benjamin_flashbulb

    benjamin_flashbulb

    Joined:
    Aug 4, 2020
    Posts:
    25
    Resurrecting this for 2021.3 URP 12.1.6. No drop down and wonky motion vectors.
     
  12. BaconNicholas

    BaconNicholas

    Joined:
    Nov 30, 2022
    Posts:
    2
    11 Years later and I'm stoked this answered my Q - Motion Vector: Force No Motion and suddenly my laser firing looks as desired!
     
  13. valentin56610

    valentin56610

    Joined:
    Jan 22, 2019
    Posts:
    157
    Solved it for me!
     
  14. Liakos89

    Liakos89

    Joined:
    Nov 27, 2016
    Posts:
    17
    Anyone knows if you can force no motion vectors to something drawn with Graphics.DrawMeshInstance ?