Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Really bizarre particle system behavior

Discussion in '2021.2 Beta' started by pez, Jul 10, 2021.

  1. pez

    pez

    Joined:
    Jul 6, 2013
    Posts:
    52
    So this one I can't wrap my head around.

    Here are the conditions:
    1. Have more than one particle system in a scene & have them both use a mesh as a render mode.
    2. Also have both particle systems use the URP/Particles/Unlit material (doesn't happen with other materials)
    3. Observe how the mesh from one particle system flashes to display on the other system.

    What I really don't understand is that when I tried to re-create this in a fresh project I couldn't get it to happen with all the same settings etc.
    BUT then when I had the project where it consistently happens play at the same time as the fresh project - it effected the fresh project too?! Video capture here:
    (fresh project on the left)

    Not really sure how to submit the project as a bug because it seems to be tied to one particular project that also effects others? Anyone who knows what might be happening it'd be great to figure this out!

    Thanks
     
  2. pez

    pez

    Joined:
    Jul 6, 2013
    Posts:
    52
    ok after more experiments in switching graphics api & all other shenanigans I found a solution if someone else comes across this! Make sure you have Enable Mesh GPU Instancing on the particle systems Renderer turned OFF.

    https://i.imgur.com/FZYreGD.png

    I still think this is some kind of memory barrier bug that causes this that should still be looked into by unity though!
     
  3. michalpiatek

    michalpiatek

    Joined:
    Feb 26, 2021
    Posts:
    81
    I am having similar issues with URP and Mesh GPU Instancing on the built-in particle system.
    Basically what happens in my case is that Unity renders "ghost" mesh particles but only when editor Game window is maximized.

    So if I were to assign a Cube as particle mesh, game would render the cube once in the actual expected location and it would render few copies just randomly scaled and rotated somewhere on the screen, they would also typically be white. This happens on any shader I tried with procedural instancing implemented, including built in URP particle shaders and my own simple test shader.

    I can't see those ghost particles when game window is not maximized. I haven't tested yet on actual build.

    Disabling GPU Instancing in the particle system "solves" the problem (I still want to use instancing tho!).

    This is weird since mesh instancing has been implemented for URP in 2020. https://portal.productboard.com/8uf...ort?utm_medium=social&utm_source=portal_share
     
    chrismarch likes this.
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Hi,

    Could you please submit a bug report with a reproduction project attached if you're affected by this?
     
  5. michalpiatek

    michalpiatek

    Joined:
    Feb 26, 2021
    Posts:
    81
    I had troubles reproducing this on a clean project but now I found the source of the issue. I'll get a report soon. In my case it was caused by a particle system having GPU Instancing Enabled but the material assigned had GPU Instancing disabled. There was no warning on the Particle System side but there were visible artefacts on the screen.
     
    richardkettlewell likes this.
  6. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    Thanks for the bug report. As far as I'm aware the instancing checkbox on the material shouldn't have any effect on the particle instancing, because the material checkbox is only for mesh instancing (not particle-meshes).

    However, my assumptions may be incorrect, so I'll wait for the bug report to appear on our side, and see what I can figure out! In any case I think it's just a bug, and we should fix it, rather than you have to adjust your setups in any way.
     
    LeonhardP likes this.
  7. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    165
    Hello, I have a very similar looking problem. Has this been confirmed to be a bug, or even fixed?

    I am on the built in render pipeline and this happens when instancing is enabled, using the Particles/StandardSurface shader.
    When it is disabled it works perfectly fine. But when it's enabled, the instanced quads for some reason flicker on and off and sometimes even flicker as if they were a sphere (I have another particle system that uses spheres, also gpu instanced).
    It does not seem to matter how many particles were spawned either.
     
    Last edited: Dec 20, 2021
  8. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    It would be best to submit your own bug report, in case it’s a different problem, and so you can be notified when it’s fixed.
     
    LeonhardP and Vincent454 like this.
  9. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    165
    Thanks, I will do that :)
     
    richardkettlewell likes this.
  10. michalpiatek

    michalpiatek

    Joined:
    Feb 26, 2021
    Posts:
    81
  11. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
  12. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    470
    Last edited: Jan 22, 2022
    richardkettlewell likes this.
  13. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    The fix for this issue just landed in the 2021.2 branch and will be part of 2021.2.11f1.

    Edit:
    The flickering issues actually seem to be unrelated to the case that I mentioned. They are being tracked here and are still being worked on:
     
    Last edited: Feb 1, 2022
  14. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    Thank you! Looking so much forward to this, as this bug holds me back from upgrading and I need that git package "Update" button to make things simpler for modders of my game :)
     
    LeonhardP likes this.
  15. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,281
    To set expectations - the fix that landed only affects the Metal rendering backend (Mac + iOS). If you are seeing these issues on other platforms, such as Windows, we are still investigating that.
     
    LeonhardP likes this.
  16. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    Hmm ok, then this is not going to fix the flickering I see. I see it on Windows.

    The issue I'm having is with GPU instanced Particles (Mesh) from the legacy particle system.

    See around 0:20 here and it happens consistently:


    Is that another bug I'm facing here or is it still related to this?
    To me it looks very much like what the author of this thread was also facing.
     
    Last edited: Feb 1, 2022
    Vincent454 likes this.
  17. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    165
    YES thats the same one I am having, I havent gotten around to reporting a bug yet sadly, but what is happening to me and in this video I believe is that for some reason the instanced mesh particles (the smoke in your case) are being replaced/rendered with other instanced mesh particles (the fire) for a really short duration which causes that flickering.
     
  18. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    Yeah, far most of my particles are renderes to a square mesh to enable GPU instancing, which works really well normally, just not in 2021.2.x :(

    I played around a bit and to some extend, the sorting make some of them a bit better, but could also just be some random stuff. As I recall when I was testing it, the sort other of the particles are currently set to "none" and changing it to "oldest in front" or what it's called, made some of it go away, but not fully and only in certain scenarios.

    Again, my game works all fine in 2021.1.x.
     
    Vincent454 likes this.
  19. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    It looks like your report was falsely marked as a duplicate of the case that I mentioned to be fixed. As @richardkettlewell pointed out to me, the flickering issues are being tracked here and are still being worked on.
     
  20. Vincent454

    Vincent454

    Joined:
    Oct 26, 2014
    Posts:
    165
    richardkettlewell and LeonhardP like this.
  21. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    Hmm, it's still flagged as duplicated - but it's not the same?

    https://issuetracker.unity3d.com/issues/particles-flicker-when-using-gpu-instancing

    So can't figure out if the above is being looked into or not - as it's regarding GPU particle in legacy render pipeline and are not URP?

    This bug is currently holding me back from upgrading as my game is using GPU particles for the core mechanic in the game :(
     
  22. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    richardkettlewell likes this.