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

Question Migrate from legacy particle shaders

Discussion in 'Shaders' started by MDADigital, Apr 27, 2021.

  1. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Hey guys. I have trouble getting same look from the new particle shaders. Can you guys help me?


    upload_2021-4-27_15-53-8.png

    My best bet is that this one is represented by Standard Surface and mode set to Fade?
    Tint goes into Albedo? Soft particle factor have 1 how does that translate, now you tick a checkbox and select near fade far fade.

    Am I on the right path at all?

    upload_2021-4-27_15-56-49.png
     
  2. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Anyone been successful in migrating from legacy alpha blended to Standard surface without affecting visuals of particle effect?
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,208
    Legacy particle shaders are unlit. The Particles/Standard Surface shader is lit. Use the Particle/Standard Unlit shader instead and it'll match exactly.
     
  4. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Aaaah offcourse. Thanks will try
     
  5. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Hmm, I cant for the life of me get same look. So the orginal has this tint

    upload_2021-4-28_14-40-22.png

    I try this these settings in the Standard Unlit
    upload_2021-4-28_14-42-57.png

    upload_2021-4-28_14-43-33.png

    But it looks completely off, much more transparent
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,208
    Ah, right.

    A weird thing about the old particle color tint is it multiplies the color by 2x in the shader. So the legacy particle alpha shader's "128, 128, 128, 128" is equivalent to "255, 255, 255, 255" in the Particles/Standard Unlit.*

    * Except when it's not because of color space conversion. Really the legacy alpha blended particles have been weird for the last decade and produce wildly different results for gamma and linear space rendering. Though new Standard particle shaders aren't actually any better about this.
     
    MDADigital likes this.
  7. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Tried it, too bright now instead :D
     
  8. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,208
    Try 173, 173, 173, 255
     
    MDADigital likes this.
  9. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Perfect match, whats the logic? :D

    Edit: seems like soft particles is broken in single pass instanced anyway (VR) so all this might be for nothing
     
    Last edited: Apr 28, 2021
  10. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,208
    The "128" value is in sRGB gamma space. In linear space that's a value of about 0.21. The shader is multiplying that value by 2.0, so about 0.42. 0.42 in sRGB gamma space is about 0.67998, or 173.
     
    MDADigital likes this.