Search Unity

Feature Request Tweak "Blend" params in ShaderGraph?

Discussion in 'Shader Graph' started by fmoo, Mar 21, 2022.

  1. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    18
    Is there a simple way to create additive shaders in Shadergraph? I'm using an Unlit Sprite (2DRP?) master node.

    In SL, I'd accomplish this by using something like Blend SrcAlpha One, but the shaders produced by shadergraph always seem to use Blend SrcAlpha OneMinusSrcAlpha.

    I would expect there to be some sort of option under the gear menu on the Master node to control this, but that only contains some parameters like "Precision".

    What I've ended up doing to make this work is:
    • make most of my shader (except the final additive part) in shadergraph
    • right click on the master node, hit "show generated code",
    • paste that into a different .shader file
    • update the `Blend` statement to e.g., `Blend SrcAlpha One` (and the Shader name at the top)
    While this works OK, I can't easily preview the final effect without a bunch of extra work.

    Is there a better way to do this? I'm currently playing with LWRP on 2019 and/or URP on 2021.