Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated shader is gibberish #42

Open
mletera opened this issue Feb 8, 2022 · 0 comments
Open

Generated shader is gibberish #42

mletera opened this issue Feb 8, 2022 · 0 comments

Comments

@mletera
Copy link

mletera commented Feb 8, 2022

I'm trying to convert the following shader https://www.shadertoy.com/view/MdSfWK using Unity 2020.3.26f1 and receive the following error:

ArgumentNullException: Value cannot be null.
Parameter name: shader
UnityEngine.Material..ctor (UnityEngine.Shader shader) (at :0)
ShaderConverterEditor.CreateShader () (at Assets/Editor/ShaderConverterEditor.cs:110)
ShaderConverterEditor.OnGUI () (at Assets/Editor/ShaderConverterEditor.cs:51)
UnityEditor.HostView.OldOnGUI () (at <55729f52d042492e9efc384182ae2feb>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at :0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at :0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at :0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at :0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at :0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at :0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at :0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at :0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at :0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at :0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at :0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at :0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at :0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at :0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at :0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at :0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at :0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at :0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at :0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at :0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at :0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <1c34070ddd5b426b8f32df1db927aad1>:0)

There is a CodeGenerator in the scene and I am supplying a shader name. The program will generate a shader file with the name but the contents are repetitive gibberish like the following line:

i.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvSi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvhi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvai.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvdi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvei.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvri.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uv i.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uv"i.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvSi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvhi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvai.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvdi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvei.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvri.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvMi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvai.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvni.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uv/i.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvSi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvci.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvri.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvii.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvbi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvbi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvli.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvei.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvSi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvhi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvai.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvdi.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvei.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uvri.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uv"i.uvfi.uvri.uvai.uvgi.uvCi.uvoi.uvli.uvoi.uvri.uv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant