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

Shader Graph error after upgrade

Discussion in '2022.1 Beta' started by _geo__, May 5, 2022.

  1. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,343
    I have some ShaderGraph shaders which works fine in Unity 2019, 2020 and 2021 LTS but in 2022 they are broken and I get this error if I press "Spacebar to Add Node":

    shadergraph2022.png

    Code (csharp):
    1.  
    2. ArgumentNullException: Value cannot be null.
    3. Parameter name: identifier
    4. UnityEditor.Undo.RegisterCompleteObjectUndo (UnityEngine.Object objectToUndo, System.String name) (at <c246e10e54e2434da3843e99b05b8d15>:0)
    5. UnityEditor.Graphing.GraphObject.RegisterCompleteObjectUndo (System.String actionName) (at Library/PackageCache/com.unity.shadergraph@13.1.7/Editor/Data/Implementation/GraphObject.cs:104)
    6. UnityEditor.ShaderGraph.Drawing.GraphEditorView.GraphViewChanged (UnityEditor.Experimental.GraphView.GraphViewChange graphViewChange) (at Library/PackageCache/com.unity.shadergraph@13.1.7/Editor/Drawing/Views/GraphEditorView.cs:478)
    7. UnityEditor.Experimental.GraphView.SelectionDragger.OnMouseUp (UnityEngine.UIElements.MouseUpEvent evt) (at <10387cb513ff4e89af21d50d8b040e20>:0)
    8. UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.PropagationPhase propagationPhase) (at <dca3629175e1466388f11ff01cb0733a>:0)
    9. UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.PropagationPhase propagationPhase) (at <dca3629175e1466388f11ff01cb0733a>:0)
    10. UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <dca3629175e1466388f11ff01cb0733a>:0)
    11. UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <dca3629175e1466388f11ff01cb0733a>:0)
    12. UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <dca3629175e1466388f11ff01cb0733a>:0)
    13. UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <dca3629175e1466388f11ff01cb0733a>:0)
    14. UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <dca3629175e1466388f11ff01cb0733a>:0)
    15. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <dca3629175e1466388f11ff01cb0733a>:0)
    16. UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <dca3629175e1466388f11ff01cb0733a>:0)
    17. UnityEngine.UIElements.EventDispatcher.OpenGate () (at <dca3629175e1466388f11ff01cb0733a>:0)
    18. UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <dca3629175e1466388f11ff01cb0733a>:0)
    19. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <dca3629175e1466388f11ff01cb0733a>:0)
    20. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <dca3629175e1466388f11ff01cb0733a>:0)
    21. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <dca3629175e1466388f11ff01cb0733a>:0)
    22. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <dca3629175e1466388f11ff01cb0733a>:0)
    23. UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <dca3629175e1466388f11ff01cb0733a>:0)
    24. UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <dca3629175e1466388f11ff01cb0733a>:0)
    25. UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <dca3629175e1466388f11ff01cb0733a>:0)
    26. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <06de9b20840f41908c50a625ea771d40>:0)

    I seem to be unable to add Vertex or Fragment Nodes.

    Unity 2022.1.0.b16.3019
    Shader Graph 13.1.7

    I have attached the shader graphs as .zip.txt

    Repro:
    1) Make a new 2022 project (Template 3D)
    2) Copy in the shader graph files (ShaderGraph.zip.txt)
    3) Import ShaderGraph via Package Manager
    4) Open the graph: Vertext and Fragment Nodes are broken and can not be created (NullPointer).

    Maybe it's not a 2022 issue but a shader graph issue?
     

    Attached Files:

  2. atr0phy

    atr0phy

    Joined:
    Nov 5, 2014
    Posts:
    43
    Experiencing the exact same issue with old shaders graphs I'm importing into 2022 (from circa 2019 if memory serves.)

    Just did a sanity check to see if they import fine into 2020.3, which they do. But they break the same way yours do when pulling them into 2022.1. Had to go thru each and every one and copy the nodes into new shaders. Could've been worse, I suppose.

    Did you file a bug report for this by chance?
     
  3. atr0phy

    atr0phy

    Joined:
    Nov 5, 2014
    Posts:
    43
    Just encountered this again on another graph that I sourced externally. The author made the shader graph in Unity 2021. I have yet to successfully import a graph built in a prior version of Unity into 2022. Perhaps something significant has changed in SG for 2022 that is causing it to choke on graphs from prior versions.
     
  4. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,343
    Iirc I did not submit a bug report. It was inly a few shader graphs for me and I fixed (remade) them by hand. Think they also originated in 2019.