Search Unity

LWRP Particles - Can't get rid of this Black Outline

Discussion in 'General Graphics' started by TickTakashi, Apr 17, 2019.

  1. TickTakashi

    TickTakashi

    Joined:
    Mar 14, 2013
    Posts:
    31
    Hi, Quick question about particles.

    For some reason, when creating a particle system in 2019.1.0f2 LWRP i'm getting this dark aura on all my particles unless I have emission turned on, but if I have emission turned on then I can't control colour via the particle system. Have I missed something? If I switch to legacy particle shaders (Non-LWRP) it works fine.

     
    hg001 likes this.
  2. TickTakashi

    TickTakashi

    Joined:
    Mar 14, 2013
    Posts:
    31
    I should add: the default material has the same behaviour. I created this one (with the same settings) to fiddle with emission etc. If i'm missing something totally obvious I apologise, any pointers would be hugely appreciated!
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    The particle texture you're using (which I assume is the default particle texture) is a blurred white dot on a black background; having a black border is the expected outcome of using that with an alpha blended shader. The default particle texture was original created with the intention of using it with a premultiplied alpha shader, which the default particle shader for the built in pipeline was for a time. However Unity broke that shader around Unity 5.3 in an attempt to make it more user friendly as a true premultiplied alpha shader requires the alpha and color to be simultaneously dimmed for the particle to fade out, so they made the alpha fade out even if you didn't dimmed the color, but they made this change incorrectly. Ever since then the default particle material has had a black outline.

    Now it might seem like the fix would be to set change the Blending Mode of the Lightweight Particle shader to Premultiply, but none of the built in shaders, including those that come with the LWRP, properly handle premultiplied alpha! So this is still broken after nearly 4 years of many of us complaining and reporting bugs that get closed out as "working as intended". :mad:

    ... *deep breath* ... :oops:

    Anyway, it seems like we recently got at least a few people over at Unity to understand what the problem is, so it may actually get fixed at some point, but for now the fix is do not use the built in default particle texture. Instead make your own with the color a flat white color, like the one attached to this post, and use the LWRP/Particles/Unlit shader with Blending Mode set to Premultiply setting ... since the Alpha mode is broken for the particle shaders, and the lit versions are totally broken for all blend modes. :rolleyes:
     

    Attached Files:

    Last edited: Apr 19, 2019
    spider853, Jake1974, noio and 4 others like this.
  4. TickTakashi

    TickTakashi

    Joined:
    Mar 14, 2013
    Posts:
    31
    I actually tried using my own white particle texture but still got the same dark outline and figured it was an issue elsewhere, I guess I just never tried the combination of the white particle + premultiply. Thanks!
     
  5. TickTakashi

    TickTakashi

    Joined:
    Mar 14, 2013
    Posts:
    31
    Just in case anyone else comes across this thread in the future, here's a screenshot of the material settings that play nice together.


     
    heerok7, Jake1974, Xayias and 2 others like this.
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Also for future humans, this should not be the correct settings to use; this is the result the default “Alpha” option should have produced with a custom all white texture, or what “Premultiply” should have produced with the built in default particle texture. So hopefully this won’t be needed for long.
     
  7. Xayias

    Xayias

    Joined:
    Mar 22, 2019
    Posts:
    7
    Thanks!
     
  8. G3ntle

    G3ntle

    Joined:
    Aug 3, 2020
    Posts:
    1
    Still a problem in 2021 :)
     
    spider853 likes this.
  9. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Yep. Unity continues it's tradition of not understanding how premultiplied alpha works and shipping "premultiplied" alpha shaders that are totally broken.