Search Unity

[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. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    We already talked on Discord, I will post details as soon as our devs provide additional insight.
     
    Last edited: Sep 10, 2021
    matjumon likes this.
  2. bigmi

    bigmi

    Joined:
    May 30, 2018
    Posts:
    2
    E2DBF664-E468-4f88-ACCC-5554BB4F55F8.png We're using Unity URP more and more.
    But does not support custom lighting.
    It interferes with work very much.

    Many NPR effect like GGX cartoon shader rely on the custom lighting.
    CA2E5FE1-00CC-46d3-ABBC-5BD4FCC0DBB8.png

    5F2279E8-3BD5-4a87-BCF9-35D0310D4496.png
     
    Last edited: Sep 14, 2021
  3. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389


    Hey there!

    Custom Lighting is specific to the Built-in Renderer, sadly, it does not work with URP. This is specific to Unity, not ASE, you will need to construct your "Custom Lighting" shaders somewhat differently for it using the Unlit URP shader type and the SRP Additional Light node.

    We cover this in one of our streams using Lightweight, it's the same for URP, sample in the video description.

     
  4. bigmi

    bigmi

    Joined:
    May 30, 2018
    Posts:
    2
    Thank you. I'll try
     
  5. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    109
    Hi,
    could you please give me a general idea before I get in the wrong direction:

    When I want to add some features from a different shader into Amplify Shader Editor (or better, the complete shader ;-) ), do I need to know writing shader code, or is there maybe a tutorial on how to do that on the fly without coding?

    Thanks for helping out!
     
  6. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Greetings!

    Depends on what you mean, if it's between ASE shaders it's mostly copying and pasting nodes between them. However, if your source is other node editors like Shader Graph, you will have to manually reconstruct the node network.

    Coding depends on what you're copying; ideally you'd recreate coded shaders with the nodes available but you can use snippets in Custom Expressions.

    Please elaborate, we'd be happy to provide more specific details if you have an example in mind.
     
    Doomchecker likes this.
  7. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,806
    I have been wondering if it's possible to mask out objects in front of a translucent object that's hit by its shadow? I'm using world space light direction to make fake translucency.
     
  8. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Depends on how exactly you're going about this; there's no way to distinguish where the shadow is coming from.
     
    florianalexandru05 likes this.
  9. galakgorr

    galakgorr

    Joined:
    Jul 9, 2019
    Posts:
    1
    I'm trying to create a simple glass material that fakes a refraction by looking up the environment cubemap, but I can't get it to match the skybox cubemap. There's some visible pinching at the poles and the whole texture is distorted. Currently I'm negating the View Direction and then using that to drive a Texture Sample pointing to the cubemap, then binding that to emission. How can I get the texture to lookup the same way as the skybox does?
     
  10. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Check the CubemapReflections example on the built-in samples package.

    upload_2021-9-21_10-15-35.png

    Paste to canvas: http://paste.amplify.pt/view/raw/551dcc97
     
  11. eigenlaut

    eigenlaut

    Joined:
    Oct 22, 2014
    Posts:
    10
    Hi Amplify Team!

    I am currently evaluating HDRP and i am unable to get Amplify Shader Editor (HD/Lit) Shaders to correctly sort against HDRP Volumetric Fog via a Global Fog Volume

    If i set the material to "Transparent" it works, but Opaque does not.

    Info:
    Unity 2020.3.11f
    HDRP 10.5.1
    Amplify Shader Editor 1.8.9.012 (latest Store) and v1.8.9.017 (Website)
    Template HD/Lit
    Shadertype Opaque
     
  12. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    Hello there!

    That's odd, should work just as the default HDRP Materials, we'll check it out and get back to you.
     
  13. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    We ran a few tests and it seems to be working as expected, would it be possible to test a sample? We'd appreciate any details regarding your current setup, we're simply testing the default Lit Scene that includes Fog use. (Unity HDRP scene)

    For a sample we'd need your Volume Asset and a simple scene, along with shader and material, for a more accurate test. We're available via support@amplify.pt.
     
  14. eigenlaut

    eigenlaut

    Joined:
    Oct 22, 2014
    Posts:
    10
    interesting- i‘ll test it on an empty project myself and if i still have the issue, send you a sample.
     
  15. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    That would be great, thanks for taking the time to set it up.

    Please forward it directly to support@amplify.pt so that our devs may access it.
     
  16. eigenlaut

    eigenlaut

    Joined:
    Oct 22, 2014
    Posts:
    10
    i could replicate it in the default hdrp project that comes with unity
    Go to the currently in use "HD Render Pipeline Asset" and set "Lit Shader Mode" to "Forward Only"
    Then set "Multisample Anti-aliasing Quality" to "MSAA 2x" or higher
     
  17. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    That's great, can you forward us that test project to Support@amplify.pt?

    We can schedule additional testing but it's always faster with a sample; I'll update your ticket.
     
  18. eigenlaut

    eigenlaut

    Joined:
    Oct 22, 2014
    Posts:
    10
    I tested if the bug shows up on more recent unity versions
    • 2020.3.19 LTS - could replicate bug
    • 2021.1.22 - could replicate bug
    • 2021.2.0b13 - could replicate bug
    I'll send the test project to your support!
     
    Amplify_Ricardo likes this.
  19. a_d_69

    a_d_69

    Joined:
    Jun 7, 2017
    Posts:
    13
    Hi! I'm trying to get reflections from ReflectionProbe using Custom Expression with this code:
    Code (CSharp):
    1. float4 sky Data = UNITY_SAMPLE_TEXCUBE(UNITY_SPECCUBE0, worldReflection);
    2. float3 skyColor = DecodeHDR (skyData, unity_SpecCube0_HDR);
    3. return skyColor;
    . but I get Float3 at the output, and I need sampler2D to connect the SampleTexture node in the future and use mipLevel to blur the resulting Cubmap. Tell me, is there a way to get Sampler2d output? or somehow convert float3 to sampler2d. Tnx.
    Снимок экрана 2021-09-30 в 12.31.42.png
     
  20. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    I'm afraid you can't convert to a Sampler2d, however you might be able to access this in some other way.

    Which renderer is this? As an example, in URP you actually have a Reflection Probe node.(this is a Unity provided value)
     
  21. a_d_69

    a_d_69

    Joined:
    Jun 7, 2017
    Posts:
    13
    I use legacy build in render unity3d.
    Is there any other way to get a Cubemap from ReflectionProbe Unity into a shader? I need to blur this reflection and I would like to do it using miplevel so as not to load the shader. Maybe there is some way to blur rgba data and not resort to sampler2d conversion.
     
  22. a_d_69

    a_d_69

    Joined:
    Jun 7, 2017
    Posts:
    13
    I was able to find a solution to my problem. Instead of UNITY_SAMPLE_TEXCUBE, I use UNITY_SAMPLE_TEXTURE_LOD. thus, I can use the mip level I need. my code looks like this :
    Code (CSharp):
    1. roughness *= 1.7 - 0.7 * roughness;
    2. float4 skyData = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, worldReflection, roughness * UNITY_SPECCUBE_LOD_STEPS);
    3. float3 skyColor = DecodeHDR (skyData, unity_SpecCube1_HDR);
    4. return  skyColor;
    I have added another input for roughness and control the mip level with it.
    Снимок экрана 2021-09-30 в 15.19.06.png
     
    Amplify_Ricardo likes this.
  23. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,204
    @Amplify_RnD_Rick
    Hey, is there an easy way to do a simple outline shader in HDRP? The outline node doesn't seem to work with that SRP. Thanks.
     
  24. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    I'm afraid not, only Built-in and URP.

    There's a possible solution, albeit not as elegant, where you can add a second material for the outline and offset/inflate that. (either negatively or by culling the front faces)

    upload_2021-10-4_16-17-2.png
     
    DigitalAdam likes this.
  25. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,806
    Thanks, it's ok, I guess there's no way around it so I'll just live with it.

    On to other issues, I was wondering if there's any way to stop this sort of behaviour for billboard shading. I tried using a custom normal on the plane mesh but I could never get what I was looking for and the shading always turned out weird. Did I miss anything like a special billboard node or some additional includes or options? I only turned on the billboard thickbox, I'm using cylindrical and a plane as mesh.

    https://drive.google.com/file/d/1C-Zq7VUAXYnAmHXlyk49zLRAog60258R/view?usp=sharing
     
  26. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey!

    That's an odd billboard issue, would be possible to test it on our end? (support@amplify.pt)
     
  27. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,806
    Sure, will send you an email with and example as soon as I can. (SENT)
     
    Last edited: Oct 5, 2021
    Amplify_Ricardo likes this.
  28. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    531
    Hi,

    It looks like a bug with the latest ASE version on Unity 2019.4 and HDRP 7.7.
    Once I create a new ASE shader and compile it, I see the error in Unity console that ShaderGraphHeader.hlsl file is missing. I tried to use an older version of ASE (grabbet it from another project) and it works fine.

    Could you please check it on your side?

    Thanks!
     
  29. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    Hey there, thanks for reaching out!

    Anything else on the console? Please share the actual console log(copy paste, there might be additional details)

    Remove the ASE folder and restart Unity and check the console for any errors or warnings. If no errors are present re-import ASE and check the console for any errors. This should give us some clues to possible issues.

    We will also confirm it on our side.

    Thanks!
     
  30. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Can you replicate it on a new project? Seems to be working as expected based on our tests.
     
  31. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    531
    Yes, I tested it on a clean new HDRP project. Tried to remove ASE from the AssetStore5.x folder and install it in a clean new project.

    This happens everytime once I create an ASE shader. For some reason ASE injects this line in the shader code: #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl"
    But this version of HDRP doesn't have the ShaderGraphHeader.hlsl file.
     
  32. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there, can you you forward us that new project with the issue present to support@amplify.pt?

    At this point it does not seem to be entirely specific to ASE, best to test an example to be sure what's happening there.
     
  33. Luke-kaser

    Luke-kaser

    Joined:
    Apr 2, 2018
    Posts:
    19
    Quick Question
    does any one know how to use custom expression's call mode and output with void ?
    I want to do like this
    Code (CSharp):
    1. void DoClipTestToTargetAlphaValue(half alpha)
    2. {
    3. #if _UseAlphaClipping
    4.     clip(alpha - _Cutoff);
    5. #endif
    6. }
    7. SurfaceData InitializeSurfaceData(Varyings input)
    8. {
    9.     SurfaceData output;
    10.  
    11.     // albedo & alpha
    12.     float4 baseColorFinal = GetFinalBaseColor(input);
    13.     output.albedo = baseColorFinal.rgb;
    14.     output.alpha = baseColorFinal.a;
    15.     DoClipTestToTargetAlphaValue(output.alpha);// <<<<<<< call this function by use custom expression
    16. ...............
    17. }
     
  34. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    531
    Hi,

    I sent it. Check it please.
     
  35. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    Hi, I am trying to add colour to smoothness, rather than having a default white colour.
    By just passing red colour as a test to smoothness input, the smoothness is white.

    How should I do this?

    Here is the setup:
     

    Attached Files:

  36. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    531
    The smoothness input receives grayscale only. So if you connected RGB to it, then RGBs luminocity will be used as an input.
     
  37. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Just got back to your email, seemed to have been caused by having the wrong HDRP Templates imported; using 7.x seems to correct any related problems. (HDSRPTemplates 7xx - 9xx (Legacy))

    We tried replicating it on our end without success, it always imported the correct templates. One of our developers will examine it further for any possible details on what might have happened.



    Like @NOT_Lonely mentioned, Smoothness expects a 0-1 value, no color is used in that input. It sounds like you're looking for the Specular Shader Type, not Metallic.

    upload_2021-10-8_12-4-23.png

    Check these for additional details on how PBR works with Unity:
    1. https://docs.unity3d.com/Manual/StandardShaderMetallicVsSpecular.html
    2. https://substance3d.adobe.com/tutorials/courses/the-pbr-guide-part-1
    3. https://substance3d.adobe.com/tutorials/courses/the-pbr-guide-part-2
     

    Attached Files:

    LaurynasLubys likes this.
  38. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389


    Hey there!

    As per-developer insight: If we understood correctly you want to both register the void function and then use it over your graph. For this you'll need two custom expressions, lets call it A and B. One will register the void function (A) and the other one registers the call to it (B).

    On the first one, A, you need to name it exactly like the name of the function itself. You need to turn off the Set Unique toggle so we don't internally change its name to something unique and maintain the exact name you've given.
    Then its just a matter of setting the output type to void and fill the code and input ports accordingly. Something like this:



    Then the second custom expression, B, you will use to call A. Set it to Call mode, the custom expression name here is irrelevant.

    Now just set the correct input port and code to be used by the call.



    This next step can be done by two separate ways:

    Since A won't be connected to the graph, by default it wont be analyzed and placed over the final shader code. To force ASE to so that you can either
    - Set its Auto-Register toggle to on, this will make ASE always register that node.
    - Or over B, go to its Dependencies section and register A on it.

    The advantage on using the second approach is that will only be registered if some other expression is actually using it, as if Auto-Register is on it will always be registered even if no expression makes use of it.

    The latest shot we've shared shows B set with the second approach.

    And that's it, please let us know if you have further questions.
     
  39. eigenlaut

    eigenlaut

    Joined:
    Oct 22, 2014
    Posts:
    10
    As a quick update and reference for people who might search for this:
    Amplify fixed a series of HDRP Depth related issues with v1.8.9 rev 19
    Volumetric Fog and HDRP Decals now work correctly in Forward Rendering+MSAA!
     
  40. HiWill

    HiWill

    Joined:
    Jun 2, 2013
    Posts:
    18
    latest version :
    GetFileAssetRelativePath in CustomExpressionNode.cs will cause issue when reference urp shaderlibrary with custom expression node;
     
  41. HiWill

    HiWill

    Joined:
    Jun 2, 2013
    Posts:
    18
    get error path #include "../../../Assetses/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
     
  42. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    Is this error specific to one of your shaders? Please elaborate on what exactly you're using and let us know if you can actually create URP shaders, otherwise we would be happy to help debug the issue.
     
  43. LaurynasLubys

    LaurynasLubys

    Joined:
    Mar 7, 2012
    Posts:
    80
    Than you for previous reply (#6987), it helped.
    I have another problem with double-sided transparent shader. I get weird glitch where the back-face interferes with the front-face and causes bad blending, between these two faces. It is easy to check on a simple cone mesh, when you rotate camera around the object. Is it possible to solve this somehow?

    (p.s. it seems it is related to UV position, as the edge of glitch matches UV shell's edge position?)
     

    Attached Files:

  44. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    Hey there, glad the previous post helped.

    Depends on the actual problem, Unity has a few caveats when it comes to transparency sorting.

    Try enabling the Extra Depth Pass, assuming you're still using the Surface Standard shader type. (set your Blend Mode to Custom)
    upload_2021-10-14_14-11-14.png
     
    Last edited: Oct 14, 2021
  45. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    It's nearing end of Oct, and it seems like URP 12.0 will be officially released soon, and I was wondering and hoping that Amplify Shader Editor is being worked on to support URP 12.0 when it is actually officially released (Unity 2021.2). So I was wondering if there is any beta package version or some sort that I can take part in so I can help testing it.

    I really want to move to Unity 2021.2 but can not due to Amplify shader editor does not even open/recognize the shader from URP 11 (Unity 2021.1)

    Can I cross my fingers? :D
     
    mGMM likes this.
  46. HiWill

    HiWill

    Joined:
    Jun 2, 2013
    Posts:
    18
    I created a custom expression node which one referrence the function in 'com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl',when compile shader get the error!
    and previous version it's working fine!
     
  47. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    I'm afraid we don't provide beta/test packages for external testing in this case. Supports will be available when URP 12 is out of BETA. Usually a couple of days after the official release.

    Creating those new templates is an involved process, there's no intermediate release package. You can always get it before it hits the Asset Store by accessing our weekly/daily builds, when the time comes, via our website.

    Hey!

    What exactly did you update, ASE, SRP, Unity?

    Please forward us the shader to support@amplify.pt, we'll have a look. Be sure to include any Shader Functions used, and let us know which Unity and SRP version you're using.
     
  48. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    I absolutely love Amplify, thank you.

    Can we shrink the shader files size - maybe is there an option to compile a minimized shader without the amplify specific nots for example? I know we wouldn't be able to reimport it, but maybe I could export a separate "-min" copy for example.
     
  49. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Thanks, we appreciate the support!

    You're concerned strictly about file size or do you have other concerns like variants? You could delete our metadata in the bottom of the file as the code generated is already kept to a minimum. In any case, removing the metadata will prevent this shader from being opened in ASE again.

    /*ASEBEGIN
    (...)
    ASEEND*/
    //CHKSM=(...)

    Feel free to elaborate on your specific case, perhaps there's something else we can recommend.
     
  50. Sam0waR

    Sam0waR

    Joined:
    Nov 30, 2015
    Posts:
    26
    Is there an option in ASE to make long conditional branches on shader keywords.
    There is a static switch, which can basically make only one-line assignments, for example
    tex = tex2D();
    #if _FEATURE
    color = tex;
    #else
    color = fixed3(1,1,1);
    #endif

    but Amplify does not move texture fetch into conditional branch. There is a chance compiler will optimize it. But I'd like to see something like I can have in manually written code to exclude all references to texture (uniform sampler2D, UV's in shader structures, etc) if _FEATURE is not defined. I.e. I'd like to place long code blocks under static condition. Is it possible?