Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Problem With Shader Graph

Discussion in 'Graphics Experimental Previews' started by Flegy, Apr 12, 2019.

  1. Flegy

    Flegy

    Joined:
    Jan 5, 2017
    Posts:
    30
    When I want open shader graph it shows me an only gray editor. Any solution to fix it?

    upload_2019-4-12_2-56-19.png

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Experimental.UIElements.GraphView.IconBadge.AttachTo (UnityEngine.Experimental.UIElements.VisualElement target, SpriteAlignment align) (at C:/buildslave/unity/build/Modules/GraphViewEditor/IconBadge.cs:143)
    UnityEditor.ShaderGraph.Drawing.MaterialNodeView.Initialize (UnityEditor.ShaderGraph.AbstractMaterialNode inNode, UnityEditor.ShaderGraph.Drawing.PreviewManager previewManager, IEdgeConnectorListener connectorListener) (at Library/PackageCache/com.unity.shadergraph@4.1.0-preview/Editor/Drawing/Views/MaterialNodeView.cs:155)
    UnityEditor.ShaderGraph.Drawing.GraphEditorView.AddNode (INode node) (at Library/PackageCache/com.unity.shadergraph@4.1.0-preview/Editor/Drawing/Views/GraphEditorView.cs:322)
    UnityEditor.ShaderGraph.Drawing.GraphEditorView..ctor (UnityEditor.EditorWindow editorWindow, UnityEditor.ShaderGraph.AbstractMaterialGraph graph) (at Library/PackageCache/com.unity.shadergraph@4.1.0-preview/Editor/Drawing/Views/GraphEditorView.cs:150)
    UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.Initialize (System.String assetGuid) (at Library/PackageCache/com.unity.shadergraph@4.1.0-preview/Editor/Drawing/MaterialGraphEditWindow.cs:513)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    You're running this in a project that's using HDRP, LWRP, or some other SRP?

    If so, the first things I'd do are just restart Unity, then if that doesn't work, uninstall ShaderGraph and reinstall it.
     
  3. Flegy

    Flegy

    Joined:
    Jan 5, 2017
    Posts:
    30
    I am just playing with shaders nothing special, was following tutorial
    so it is LWRP.

    Yes, already tried uninstall ShaderGraph and restart Unity3D but no one didn't help
     
  4. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,485
    Which SRP-related packages do you have installed?
     
  5. ncarfagna

    ncarfagna

    Joined:
    Dec 14, 2018
    Posts:
    1
    I have the same problem i try several version but same problem, any news ?
     
  6. jayatubi

    jayatubi

    Joined:
    Dec 9, 2013
    Posts:
    143
    Same issue here.

    * A fresh project with 2018.3.10f1.
    * Install the shader graph 4.10.0 from package manager.
    * Create a new unlit shader graph and the double click to open it.

    Then a blank editor window shows up with the same error report as the top post.
     
    biao39 likes this.
  7. jayatubi

    jayatubi

    Joined:
    Dec 9, 2013
    Posts:
    143
    I found the solution. I should create a SRP asset and set it to the graphic settings.
     
    SkullvezVizslaGameDev likes this.
  8. EricJ13

    EricJ13

    Joined:
    Feb 28, 2009
    Posts:
    355
  9. Cemada

    Cemada

    Joined:
    Jan 7, 2019
    Posts:
    1
    Hi, I had same issue and in my case was solution very trivial. After deleted content of the Library folder it works.
     
    quickytools and tehusterr like this.
  10. tehusterr

    tehusterr

    Joined:
    Sep 27, 2019
    Posts:
    7
    I had the same issue. Deleting the content of the library folder also worked for me. Thanks Cemada for pointing it out.
     
  11. pyramidenkopfgaming

    pyramidenkopfgaming

    Joined:
    Dec 22, 2019
    Posts:
    1
    In my Case using LRP with Shader Graph: After installing Shader Graph, Lightweigh RP and Post Processing, R. Click on Assets -> Create-> Rendering -> LRP, then Edit -> Project Settings -> Graphics -> Locate LRP which you created in Assets. Since you cant use the old Shaders with the new ones or something.
     
  12. Carteloo

    Carteloo

    Joined:
    Dec 26, 2019
    Posts:
    1
    Hey, guys im trying to make a game and i wanted to create shader and there is my question, should i update all my textures and graphics to that Lightweigh RP or should i stay with default one? Should i build my game on that new shaders?

    For me to get that graph shader to work i had to add Render Pipeline asset in Project Settings and after that all my textures went pink ;s
     
    Last edited: Dec 28, 2019
  13. shaddar666

    shaddar666

    Joined:
    Feb 23, 2020
    Posts:
    1

    same here
     
  14. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    It's pretty much either-or: If you want to use Shader Graph, you'll need to be using a Scriptable pipeline, like URP or HDRP. However, doing so means that a fair number of things in the standard renderer will no longer work. Probably for most people, the decision to use URP/HDRP involves more than whether they want to use Shader Graph, so you'll need to decide whether that's what you want for your project as a whole.
     
    yyhvs1995 likes this.
  15. playBlaster

    playBlaster

    Joined:
    Jan 5, 2017
    Posts:
    7
    I know this is an old thread but I'm having the same issue. I was able to create shaders through shader graph but now it will no longer let me. I get the same error when i try to open any of my shader graph shaders. I'm on 2020.2.1f1 using URP 10.2.2. @tehusterr, What library folder are you referring to?
     
    Halo_Shrimp likes this.
  16. Halo_Shrimp

    Halo_Shrimp

    Joined:
    Aug 27, 2021
    Posts:
    11
    Hi,I did it your way. But the version I'm using is 2020.3.12f1c1,This version is no longer available LWRP,so I am using the URP. But nothing changed,the problems remains. What am I supposed to do?
    URP version:10.5.1
    ShaderGraph version:10.5.1
     
  17. UnityPro789

    UnityPro789

    Joined:
    Aug 24, 2022
    Posts:
    1
    Hi, I need help, for some reason my shaders have been behaving weirdly and my PBR and VFX shaders are gone, why is this happening and how can I fix it?
     
  18. chrisheld

    chrisheld

    Joined:
    Apr 15, 2013
    Posts:
    8
    My Shadergraph is completely broken after upgrading to 2022.1.21f1. I have uninstalled URP and ShaderGraph. Now, I can not uninstall Shader graph. The Remove It is greyed out.

    Any ideas?


    I rolled back to the 2021 LTS and reimported. All is good now.
     
    Last edited: Dec 10, 2022
    Niter88 likes this.
  19. Niter88

    Niter88

    Joined:
    Jul 24, 2019
    Posts:
    112
    Started having this problem on 2022.2.2f1 with built in shaders on shadergraph for android.
    error message is shown two times on playmode (Editor)
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.OnDisable () (at ./Library/PackageCache/com.unity.shadergraph@14.0.4/Editor/Drawing/MaterialGraphEditWindow.cs:417)
    No error is shown on android, but sometimes it just freezes after some time.
    I'm not having any kind of artifacts or visible broken shader. I've revisited and recompiled all shaders after updating.

    Any ideas?
     
  20. Niter88

    Niter88

    Joined:
    Jul 24, 2019
    Posts:
    112
    Unity stops showing the error after closing the shader editor tab.
    The error is not fixed but at least the error won't show.

    EDIT: The error was shown two times because I had two shader tabs opened
     
    InvisibleKid likes this.
  21. Junsilo_Z

    Junsilo_Z

    Joined:
    Mar 18, 2022
    Posts:
    1
    The project directory cannot have Chinese characters