Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Shader Graph Does Not Work

Discussion in 'Shader Graph' started by mudlee, Apr 14, 2019.

  1. mudlee

    mudlee

    Joined:
    Nov 14, 2016
    Posts:
    2
    Hi All.

    I downloaded the latest Unity (2019.1.0f1). I created a project with LWRP 3D. Then I created a shader that's attached to a material. The shadergraph in the shadergraph editor works, but in the editor itself the asset that has the material is pink. Also I read this error message in the console:
    Code (CSharp):
    1. Shader error in 'Shader Graphs/New Shader Graph': syntax error: unexpected integer constant at line 390 (on d3d11)
    2.  
    3. Compiling Vertex program with UNITY_PASS_SHADOWCASTER
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
    The LWRP asset is there and is set in the graphics settings. If I remove the connection from Albedo, then it works, but somewhy if I connect it to the output of the gradient, it fails.

    shadergraph.png
     
    Last edited: Apr 14, 2019
  2. jesusjavi

    jesusjavi

    Joined:
    May 21, 2019
    Posts:
    1
    Hi!
    Sample gradient is the error... if you use it the shader doesnt work. I try it in unity 2019 and 2018.3.9f1 but I have the same problem...
     
  3. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    I'm having a similar issue. Did you ever figure this out @mudlee ?

    upload_2020-1-4_22-26-34.png
     
  4. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
  5. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    My issue was caused by using '_AlphaClip' as a property reference because it seems that name is already used by shader graph. Took me a while to figure that out but eventually I found the cause :)
     
    oleg_v and AlexMasse like this.
  6. JTAU

    JTAU

    Joined:
    May 12, 2019
    Posts:
    24
    The latest Unity 2020.3.6f1 still has this issue. Is it intended that we shouldn't be able to use the _AlphaClip property? (I.e setup an exposed variable in shader graph with the _AlphaClip reference). Seems like an oversight.