Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Best Tool Asset Store Award] Amplify Shader Editor - Node-based Shader Creation Tool

Discussion in 'Assets and Asset Store' started by Amplify_Ricardo, Sep 13, 2016.

  1. PeterTo_Auroch

    PeterTo_Auroch

    Joined:
    Nov 3, 2022
    Posts:
    1
    Hi! We are using Amplify for our project but are currently having issues where Amplify is causing failure in our automated build pipeline. Do you mind giving us a hand in resolving this? Here's a summary of the issue we're facing:

    ---

    Issue Summary

    Unity Version: 2022.3.6f1 (LTS)


    Our team is using TeamCity for our automated build pipeline. Within the build pipeline, we invoke Unity in batch mode to create a build.

    Although the build itself was completed successfully, and Unity successfully created the artifacts(i.e. the
    .exe
    file and the like) we needed,
    ASEPackageManagerHelper
    is throwing
    NullReferenceException
    after the build is completed and Unity is attempting to shut down. Relevant logs are as follows:

    Batchmode quit successfully invoked - shutting down!

    Start importing ProjectSettings/ProjectSettings.asset using Guid(00000000000000004000000000000000) Importer(-1,00000000000000000000000000000000) -> (artifact id: '6936e1e0fda63e6a0f7006fef4cf4e2d') in 0.003258 seconds

    NullReferenceException: Object reference not set to an instance of an object

    at AmplifyShaderEditor.ASEPackageManagerHelper.Update () [0x00038] in D:\BuildAgent\work\41cf0519bb6951e5\FAKE_PROJECT_NAME\Assets\AmplifyShaderEditor\Plugins\Editor\Utils\ASEPackageManagerHelper.cs:406

    at AmplifyShaderEditor.TemplatePostProcessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) [0x00006] in D:\BuildAgent\work\41cf0519bb6951e5\FAKE_PROJECT_NAME\Assets\AmplifyShaderEditor\Plugins\Editor\Templates\TemplatePostProcessor.cs:30

    at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)

    at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <eef08f56e2e042f1b3027eca477293d9>:0

    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

    at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <eef08f56e2e042f1b3027eca477293d9>:0

    at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <eef08f56e2e042f1b3027eca477293d9>:0

    at UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00033] in <347e3e2bef8c4deb82c9790c6e198135>:0

    at UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets, System.Boolean didDomainReload) [0x00116] in <347e3e2bef8c4deb82c9790c6e198135>:0

    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)

    UnityEngine.DebugLogHandler:LogException(Exception, Object)

    UnityEngine.Logger:LogException(Exception, Object)

    UnityEngine.Debug:LogException(Exception)

    UnityEditor.AssetPostprocessingInternal:postprocessAllAssets(String[], String[], String[], String[], String[], Boolean)

    After some investigation, we found that:

    1. TemplatePostProcessor.OnPostprocessAllAssets
      is triggered after the Unity Editor tries to shut down, this can be observed in the above log, where the
      NullReferenceException 
      is thrown after the following log message:
      Batchmode quit successfully invoked - shutting down!

    2. The
      NullReferenceException
      is thrown as
      m_packageListRequest.Error
      is not null - we can observe that the
      errorCode
      is
      Unknown
      and sadly there's no error message provided by Unity.
    3. Package Manager's log(
      %LOCALAPPDATA%/Unity/Editor/upm.log
      ) doesn't seem to have anything abnormal - all request ends with
      200
      and is responding within a reasonable timeframe( ~200 - 400 ms).
    4. The exception isn't always thrown and only happens approximately 9/10 times.
    We are not sure what the root of the issue is - was it the case that the package manager should have never returned an error, and the fact that it is implies we need to work on making sure it never returns the error in the first place, or this the case where we need to make sure when there's an error it needs to be handled gracefully?

    Any input/clarification on how we should fix this will be greatly appreciated! This is a major issue for us as it is blocking our automated build system from working, and is hence significantly affecting our team's productivity.
     
    Last edited: Oct 4, 2023
  2. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    111

    Hello, thank you for the detail report.
    can you verify you're in the latest Amplify Editor?
    we fixed a number of similar issues in the latest editor revisions so checking your current version could be helpful for our team.

    edit
    please reach out to me asp thru email or discord so i can try to get this in before end of week
     
    Last edited: Oct 4, 2023
    PeterTo_Auroch likes this.
  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,790
    Fixed by switching the Render Type from "Opaque" to the "Tree Opaque" in the shader settings

    Thanks for this amazing shader editor
     
    Amplify_David likes this.
  4. XiongmaoHZH

    XiongmaoHZH

    Joined:
    Dec 21, 2021
    Posts:
    8
    Hello, would you like to ask when ASE will support the limit on the number of additional light sources under the forward+ path of URP? Now if the rendering path is selected as forward+, the shader edited by ASE will flicker and freeze, and only supports eight light sources.
     
  5. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    111

    hello please reach out to me in discord or thru email with a bit more info
    please also verify you're in the amplify latest editor version and how to replicate.

    edit
    also, please can you download and test with the demo scene in amplify shader pack.
    this pack is free to download if you already own copy of the editor.
     
    Last edited: Oct 15, 2023
  6. Nicopol

    Nicopol

    Joined:
    May 30, 2020
    Posts:
    3
    Hi, I've a question regarding shader variants:
    I'm building a custom lighting material and I would like to be able to enable or disable some properties depending on the material.

    I'm using static switches but:
    1. I'm not sure if by disabling the property I'm actually avoiding calculating it within the material. Is it true?
    2. Also I would like the properties inside the shader function not to be displayed when the switch is off. how?
    3. The guide mentions the possibility of exposing "two sided" as a property within the inspector, how to do it?

    upload_2023-10-17_12-49-32.png
    here my setup (URP Unlit)

    Thanks in advance for your answers.
     
  7. thang_unity516

    thang_unity516

    Joined:
    Oct 29, 2021
    Posts:
    30
    Hi, I've a question about shader variant and static switch node

    As shown as the image below, I have A and B flow switched by the QUALITY_HIGH keyword and it works fine. upload_2023-10-18_11-31-20.png

    But then when I check the code generated, it only switch the result of the calculation, not all of the flow. So one of the flow still calculates for the other one though it uses one result only, right? If that the case, how can I fix it?
    upload_2023-10-18_11-32-21.png

    Thanks for your help
     
  8. KenanTheFab

    KenanTheFab

    Joined:
    Apr 29, 2018
    Posts:
    8
    Hello, I'm attempting to create a sprite shader with transparency to give it a flowing effect which has been going great except for one little hitch: it does not account for the sprite/object's size upload_2023-11-1_7-58-10.png
    I've tried incorporating the Object Scale node several points (so it is absent, however I attempted to plug it into the tiling input in the Texture Coordinates node you can find between the Append and Noise Generator nodes. but it appears to have done nothing.
    upload_2023-11-1_7-59-39.png
    Here is the current node setup for reference (apologies for the mess.)

    Edit: never mind. it did work but there was a bug that just sort of... cancelled it from working if another object used the material lmao
     
    Last edited: Nov 1, 2023 at 3:32 PM