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

Additive + Color Over Time Particle System for URP

Discussion in 'Universal Render Pipeline' started by wagenheimer, Jan 15, 2021.

  1. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    Hi!

    Which shader should I use to support Particle System Color Over LifeTime and Additive Blending?

    I'm trying to use the "Universal Render Pipeline/Particles/Unlit" Shader, but it does not work as expected and I'm getting errors on Console.

    Shader error in 'Universal Render Pipeline/Particles/Unlit': redefinition of '_Cutoff' at 2/Library/PackageCache/com.unity.render-pipelines.universal@10.2.2/Shaders/Particles/ParticlesEditorPass.hlsl(8) (on d3d11)

    I also try to use the Legacy Shaders, but it works partially, but it stops working out of nowhere. Both in Scene View and Game View it only shows the bounds but no particles
    .
    upload_2021-1-15_16-30-47.png


    Which shader should I use? What am I doing wrong?
     
  2. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    107
    Any joy? I'm also seeing this exact issue and I cant work out why.
     
  3. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    107
    Got it! in Library\PackageCache, delete

    com.unity.render-pipelines.core@10.2.2

    and

    com.unity.render-pipelines.universal@10.2.2

    Unity will recreate them and you should be sailing again.
     
  4. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    107
    Sigh, no, I take it back. It broke again when I next restarted the editor. Help!
     
  5. Yorp

    Yorp

    Unity Technologies

    Joined:
    Jul 11, 2019
    Posts:
    3
    Do you guys have any graphics customised packages (copied into Packages folder) or everything is directly from package manager?
     
  6. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    107
    Everything is via packagemanager.

    upload_2021-1-20_18-4-14.png
     
  7. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    Everything is via packagemanager.

    I fixed the problem temporarily by creating an empty scene and copying everything from the other scene to the new one.

    The particles returned to work for a while. Until suddenly they stopped working again.
     
  8. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,495
  9. Yorp

    Yorp

    Unity Technologies

    Joined:
    Jul 11, 2019
    Posts:
    3
    Just to let you know, the fix is being prepared for URP 10 versions. Thank you guys for flagging it!
     
    wagenheimer likes this.
  10. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    107
    DO I take it this will also fix the other issue that came up at the same time?

    Code (CSharp):
    1. Shader error [] invalid subscript 'sh' at Library/PackageCache/com.unity.render-pipelines.universal@10.2.2/Editor/ShaderGraph/Includes/Varyings.hlsl(104) (on d3d11)
     
  11. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    I noticed something very strange.
    I have two cameras stacked in the scene (one for 3D and one for UI). If the particle is in the 3d camera, it works perfectly, is visible, and even changes color. But if you have the particle in the UI camera, the problem occurs, and it disappears sometimes, it doesn't work, it changes the color among other things. (Culling Mask)

    Perhaps this is a clue. Is it a URP CameraStacking bug or am I doing something wrong?
     
  12. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    Changing the UI Camera from Orthographic to Perspective and then Back to Orthographic seems to have fixed the problem.

    The problem seems related to Clipping Planes.

    Changed the NEAR to -10000 and the particles don't work.
    Changed the NEAR back to 0.01 which is the default and it worked again.

    Now I have my particles in full color and working! =)

    upload_2021-2-12_17-44-0.png
     
    Last edited: Feb 12, 2021
  13. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    95
    This error is recurring for me (Unity 2021.1.26, URP 11.0.0). Any fixes?
     
  14. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    Sometimes it still happens to me too and it doesn't make any sense.
    In some cases, I can solve it by creating a new scene, copying everything from the previous scene to the new one and then saving over the previous scene.
     
  15. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    Also a problem for me in Unity 2021.1.26, URP 11.0.0
    Additive looks like this
    upload_2021-11-4_23-37-19.png
     
  16. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    I somehow fixed it by disabling and enabling the layer mask in a different order....
    upload_2021-11-5_12-0-37.png
     
  17. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    Very good! The bug happens randomly and there are several solutions that solve it randomly too... o_O

    It would be interesting to have an official response from Unity about this.... but I know it's complicated, probably if someone sends a bug report with the project where the bug occurs when they open there the bug won't happen.