Search Unity

Question Someone please post a shader graph of the original SRP unlit particle shader.

Discussion in 'Shader Graph' started by Samustan, Apr 20, 2021.

  1. Samustan

    Samustan

    Joined:
    Jun 28, 2020
    Posts:
    2
    srp.png

    I have been trying to get my old particles working in HDRP for hours but they don't look quite right. It's especially unhelpful that the terminology is different in Shader Graph than in the SRP Inspector, such as Rendering Mode and Color Mode.

    If someone can replicate this in Shader Graph I would be very thankful!
     
  2. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Have you looked at the samples for HDRP? One of the Unity devs made a set of particle shaders for HDRP using Shader Graph that should work with the Shuriken particle systems, and then it was included with HDRP under the Samples section. You can see how the samples were done and then customize them to your needs.

    To get the samples:
    In the package manager, select "Packages: In Project", then select "High Definition RP", then you should see a "Samples" dropdown, and then click import next to "Particle System Shader Examples".

    Once done, you can find the HDRP Particle System shaders in your Project tab in the following folder:
    Samples > High Definition RP > (HDRP Version #) > Particle System Shader Samples > Shaders.

    At least that's the shader samples directory for HDRP 11.
     
  3. Samustan

    Samustan

    Joined:
    Jun 28, 2020
    Posts:
    2
    Thank you. I looked into the example shader graphs but I couldn't get the materials looking exactly the same. I tried combining the texture with an hdr color with multiplication or addition but in SRP the result was a lot more transparent and soft. I also couldn't figure out how to add a fade effect, there is an example for a fade based on the distance to the camera but I would like it to fade independently of that.
     
  4. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    When setting the material surface type either in the graph settings or on the material itself to transparent, you can choose from three blending modes in the graph settings or on the material: Alpha, Additive, or Premultiply. According to your screenshot, the blend mode you had on the Standard Unlit particle shader was Additive, so you should try that first.

    Reading up on the "blend factors" section of this page and how the blend factors are calculated could help with getting the same colors/brightness/etc.: https://docs.unity3d.com/Manual/SL-Blend.html

    As far as fade, couldn't you just use a float property as a slider with a range of 0 to 1, and then set that to the alpha input in the "Fragment" section? Or multiply the alpha value of the texture by that same float property and put the result into the alpha input to control the fade?

    Perhaps if you post some comparison screenshots between what you're getting with the Standard Unlit particle shader versus the Shader Graph shader, as well as posting a screenshot of your Shader Graph node setup, you can get more precise help.