Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    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. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    Completely makes sense! Thank you!
     
  2. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    514
    Hi,

    I'm creating a displaced shader with a tessellation feature and it looks like the shadow caster pass doesn't use the actual tessellated geometry, but the original one. This leads to shadow artifacts on the surface. Is it possible to pass an actual vertex data into the shadow caster pass somehow? I use deferred rendering path here. It looks even worther in the forward rendering.

    upload_2023-8-9_16-27-3.png
    Left: original displaced deometry | Right: tesselated geomtery

    Thanks!
     
  3. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    hello
    Please check Amplify Creations Dev Stream #6 - Normal Reconstruction
    this should help explain what that is and how to fix.
    Unity Products:Amplify Shader Editor/Tutorials/Apr2020 - Amplify Creations Wiki
     
  4. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    514
    Hi,
    Thank you for your reply.
    Yes, the mothod described in this video works, but it only works if you modify vertices positions using the VertexPos.x, which is suitable for waving things like flags or water. But how can I deal with a stuff such as footprints on a mud? The footprints height mask is generated procedurally. So for example, I generate the heightmap based on some properties and doing something like that next:

    upload_2023-8-10_9-43-57.png

    I tried the method from the video your suggested (and even tried it earlier, before I posted my question here).
    But this method relies on the VertexPos.x for the waves generation, which is not my case.

    Could you suggest something?
     
  5. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    Hello please reach out to me in discord for chat then i we can better understand the case use.

    cheers
     
  6. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    514
    I just wrote you there.
     
  7. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,776
    One of my clients is having issues building for URP mobile devices. He claims my shaders worked fine in Built-in but it fails to compile when building for URP. He didn't give me many specifications but he said he build for "oculus quest 2".

    These are the errors he's getting. At first, I thought it was the shader model to blame so I lowered the shader model to 3.5 but he's getting the same issues on all my shaders. Are there limitations with URP on certain devices, any suggestions?

    upload_2023-8-11_17-59-4.png upload_2023-8-11_17-59-27.png
     
  8. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    514
    It looks like you can share single sampler state between your texture samplers to fix that.
     
  9. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    i see the error for LOD cross fade and they are in unity version 2021.3.23 aka 12x
    LODCrossFade.hlsl is not added by unity until api 14.0.4 and higher

    i would suspect they unpacked the incorrect shaders for the version they are working in
     
  10. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    hello
    just following up
    you can reach out to me on discord if you still need help to solve this
     
    florianalexandru05 likes this.
  11. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,776
    Thanks, I think I will!
     
  12. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    fixed in ase v1.9.1.9
     
    IllTemperedTunas likes this.
  13. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    v1.9.1.9 - New build uploaded to Unity Asset Store

    Editor
    * Adjusted UIUtils toolbar style fix to include Unity 2021.3
    * Switched from http to https as workaround for connection issues

    Templates
    * Fixed Decal related errors in Lit template (HDRP 14x 15x)
    * Fixed OUTPUT_SH errors on URP 15x
     
  14. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    514
    Hi,

    I have a problem in HDRP. I use Unity 2022.3 and if I complie my shader without the Custom Editor set to Rendering.HighDefinition.LitShaderGraphGUI, then HDRP decals pass through the objects with this shader. If I set the Custom Editor to Rendering.HighDefinition.LitShaderGraphGUI then everything works fine, but I can't use it, because I want to write my own custom editor. It looks like Unity's LitShaderGraphGUI switches something else, but not only the "_SupportDecals" property.

    So the question is: how to make my shader receives HDRP decals properly?

    upload_2023-8-17_12-32-34.png
     
  15. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hello,

    i'm trying to create an URP decal shader for a livery system for a racing game with ASE.

    The point is that it needs to use the stencil buffer for masking (as rendering layers do not work in OpenGL ES 3.0 - android platform), but i always have to go and add stencil operations by hand which get removed once i make some changes to the shader from the ASE editor.

    1. Please, is there any way to add the stencil buffer variables from within the ASE editor as it doesn't have them by default for URP/Decal template:

    No stencil buffer settings
    upload_2023-8-17_10-41-37.png

    2. Also as i am absolutely new to shaders, can you tell please, what i should plug to normal slot in order to get the decal render smoothly instead of looking faceted ?

    upload_2023-8-17_11-36-3.png

    Thank You !
     
    Last edited: Aug 17, 2023
  16. DEGUEKAS

    DEGUEKAS

    Joined:
    Jul 12, 2018
    Posts:
    26
    Depth buffer problem

    Hello, I am new to shaders and I am using Amplify Shader to create them, I have two shaders, 1 for the mesh and another for sprites that we are using in SpriteRenderer.

    Currently I already solved it in the shader for mesh but I have a problem with the depth in the shader for the sprites.




    Before, in the shader for the mesh it only showed the water in front but the one behind the mesh did not render it, to solve it set RenderType = Transparent, RenderQueue = Geometry and AlphaToCoverage = true + the rest of the settings that you see in the following image .

    In the case of the shader for sprites I have configured the RenderType and the RenderQueue the same as the one of the mesh but I don’t know what else can be configured to have the same result as the one of the mesh where you can see the water that is behind the object.



    I have tried different configurations but it still does not work like the shader for the mesh
    Also create a question: https://discussions.unity.com/t/depth-buffer-problem/280151

    Anyone who helps thank you very much, any recommendation is welcome
     
  17. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    hello,
    can you send me in email copy a small shader and prefab to show the issue?
    support@amplify.pt
     
  18. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    I am not aware of the limitation for decal and OpenGL ES 3.0
    see Unity - Manual: Targeting shader models and GPU features in HLSL (unity3d.com)

    i suspect it should work as ASE by default sets #pragma target 3.5 for decals same as unity
    if you have any specific error and also if we know what version you're working it could be helpful
     
  19. doodaddy

    doodaddy

    Joined:
    May 2, 2015
    Posts:
    10
    I'm new to shaders and don't expect to do anything too deep. I plan to use the Built-In renderer.

    After checking the website and the store, however, I'm still unclear on a few features. I'd like to know if it has compatibility with Unity Terrains? And how about Unity Probuilder and Polyform?

    I'm not even sure how much Unity is compatible with Terrains and Polyform, literally.
     
  20. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    For terrain shaders yes you can make with amplify shaders
    Terrain shaders are not so easy so i suggest study the ASE examples.
    we will have a number of updated terrain shader examples coming out soon in the amplify shader pack that are free if you already own copy of amplify editor.

    About Polyform, I do not have any info as i think that is a 3rd party tool beyond unity dealing with 3D scanning and LiDAR.
     
  21. doodaddy

    doodaddy

    Joined:
    May 2, 2015
    Posts:
    10
    > About Polyform

    Thanks for the fast reply! I actually meant "Polybrush" but you probably guessed that. It appears to paint on ProBuilder meshes. I've messed with it for a couple of hours and it only painted when I used a Polybrush-based material such as Polybrush/Simple Texture Blend.

    It may be a 3rd party tool but it seems supported at Unity. It's page has an example of a "terrain-like" model.


    Anyway... I'm going to speculate this isn't a supported Amplify shader type. Thanks! I probably didn't need it.
     
  22. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    Polly brush uses vertex color for blending in some of the shaders
    it is possible to make a compatible vertex blend shader for Polly brush but we do not have any example in ASE demo
    if you have trouble feel free to reach out in the discord for chat
     
    doodaddy likes this.
  23. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi,

    it is the new "Rendering Layers" part of URP that are not supported in OpenGL ES 3.0 and not the decals. By using those new rendering layers, you can tell the decal projector on what mesh renderers it should show up but as these are not supported for mobile platform i have to use stencil masks for clipping out decals ( to not show on ground but only on car body ). The Decal template in ASE however doesn't have stencil settings. I can open the shader in visual studio and add the code, but when i make some change to the shader in ASE, the stencil code gets removed and i have to add in back again manually...

    The question was, how can i add stencil support to the URP/Decal template in ASE or even better if you can add it in the next update of ASE ( as decals are not always used only for level design ) ?

    Thanks
     
  24. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    hi can you send me an email showing the changes.
    support@amplify.pt

    if a shader is modified after compile yes it would change back if opened again in editor
    what i think you're looking for is more about making custom templates. in order for it to not remove your modified code you would need to change it in template rather than final shader

    making a custom template should solve this for you
     
  25. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    514
    @Amplify_David looks like you missed my question. Could you help with this, please?
     
  26. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    I actually did it ( as you suggested ) i just did edit the decal template for URP and then the stencil settings did show up in the ASE editor and not removing after compilation !
     
    Amplify_David likes this.
  27. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    yes, this is a very big topic to go into on the forum.
    can you reach out to me in discord as i need to tell you all about the unity battle switch and how deep that rabbit hole goes in HDRP.
     
  28. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    note with any modification in a template you may wish to make a copy and name it to something other so on future ASE updates you do not lose your changes or get replaced by a any new ASE revisions.
     
    Vagabond_ likes this.
  29. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    Amplify Shader Editor
    v1.9.2.0
    - New build uploaded to Unity Asset Store
    Amplify Shader Editor | Visual Scripting | Unity Asset Store

    Highlights
    * Added support for 2023.2 and URP/HDRP 16x
    * Added URP/HDRP 16x samples
    * Fixed URP/HDRP 15x samples
    * Added "Always Align to Grid" option to Preferences

    Editor
    * Node lengths now align to grid during snap
    * Node header height now same regardless of subtitle
    * Shader Function node Icon now white
    * Removed [ASEBegin]/[ASEEnd] SRP tags

    Samples
    * Fixed Built-in samples
    * Removed some Built-in samples conflicting with ASP
     
    hopeful likes this.
  30. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    Amplify Shader Pack
    v2.0.0.0
    - New build uploaded to Unity Asset Store
    Amplify Shader Pack | VFX Shaders | Unity Asset Store

    Highlights
    * Added samples for URP/HDRP 16x (updated per Beta 2023.2.0b5)
    * Added samples for URP/HDRP 15x
    * Added samples for URP/HDRP 14x
    * Updated samples for URP/HDRP for 10x and 12x
    * Built with Amplify Shader Editor v1.9.2
    * Improved Start Screen sample importer
    * Added About window

    Samples
    * New demo scenes
    * New Baked GI Specular Cutout
    * New Baked GI Specular
    * New Baked GI Standard
    * New Interior Mapping Cubemap
    * New Interior Mapping LatLong
    * New Material Sample Hair (HDRP only)
    * New Material Sample Fabric
    * New UV LatLong Projection
    * New Vector Displacement Simple

    Note
    this pack is free if you already own copy of Amplify Shader Editor
     
    hopeful likes this.
  31. StenCG

    StenCG

    Joined:
    Mar 26, 2015
    Posts:
    66
    Hi
    I noticed that UI/Default template has blocks to support Rect Mask softness, but they never come to generated shaders. Is it my mistake or bug?
    Screenshot 2023-08-25 192737.png Screenshot 2023-08-25 192113.png
     
  32. lrb

    lrb

    Joined:
    Jun 21, 2014
    Posts:
    27
    Hi there,

    I've just realised that while using switches with their #ifdef conditions, the performance is not optimized at all... for example:

    Code (CSharp):
    1.  
    2. float result87 = VeryVeryComplexCalculations();
    3. #ifdef _StaticSwitch_ON
    4.     float4 staticSwitch91 = result87;
    5. #else
    6.     float4 staticSwitch91 = float4(0,0,0,0);
    7. #endif
    8.  
    In this example, the VeryVeryComplexCalculations() is processed even if the _StaticSwitch_ON is OFF.
    Because of this we're having to manually optimize the resulting code each time the shader is changed, by doing something like this:

    Code (CSharp):
    1.  
    2. #ifdef _StaticSwitch_ON
    3.     float result87 = VeryVeryComplexCalculations();
    4.     float4 staticSwitch91 = result87;
    5. #else
    6.     float4 staticSwitch91 = float4(0,0,0,0);
    7. #endif
    8.  
    Just by surrouding the complex code inside the #ifdef condition, it can run much faster for some cases.
    My question is if there's any way to force this optimizations from inside the ASE?

    Thanks,
     
    StenCG likes this.
  33. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    try use a lerp with just a float no keyword toggle
     
  34. Level3Manatee

    Level3Manatee

    Joined:
    May 10, 2018
    Posts:
    10
    Hello,
    I am trying to use Texture2D.Load / LOAD_TEXTURE2D in a custom expression (via file). How can I access a texture object as Texture2D instead of the default sampler2D that I get when using a wire port? I have tried using the Texture Object node with auto-register and then using the property name, but that just yields an "undeclared identifier" compile error.
     
  35. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,833
    I haven't used ASM in a few years and have forgotten most of it;)
    Now I have a simple problem
    As you can see in the picture below, the result of the normal map and smoothness calculation in ASM is much different than the Unity Lit shader.

    How can I set the normal map shader to look like Unity Lit shader?


    Amplify_Result.jpg
    LIT.jpg
    Amplify.jpg
     
  36. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    hello sir, can you reach out to me in discord or send me copy of the shader thru email so I can better help you.
     
  37. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,833
    As you can see this is a simple shader with a albedo and a normal map texture's sample and a smoothness slider
    Also i tested in built-in pipeline with a same result

    I need a simple shader sample similar to the Lit shader in above images
     
  38. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    Hello, welcome back to ASE
    I suggest you download and have a look at the amplify shader pack.
    this shader pack is free if you already own copy of the editor.
    Amplify Shader Pack | VFX Shaders | Unity Asset Store

    a good example for what you're asking can be found in the material sample demo and should give you a good starting point for building your shaders. ;) upload_2023-9-7_21-33-22.png
     
    UnityLighting likes this.
  39. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,833
    Good examples
    Tested on a new project and everything now is OK
     
  40. StenCG

    StenCG

    Joined:
    Mar 26, 2015
    Posts:
    66
    So, what about UI Rect Mask softness support? Generated shaders always don't work with this, the UI template has corresponding code though
     
  41. Level3Manatee

    Level3Manatee

    Joined:
    May 10, 2018
    Posts:
    10
    Apologies, I did not get a notification for your response.

    To answer my own question (partially), it is possible to use Texture2D.Load() and LOAD_TEXTURE2D in a custom expression by using a custom parameter type and setting it to Texture2D, then connecting the Texture Object to that port. I am not sure why this did not work for me before, must have been an oversight on my end.

    I am however wondering how to use the auto-register functionality. My expectation was/is that I create an unconnected object node, e.g. a Texture Object, variable mode set to "Create" and "Auto-Register" checked, and then am able to reference its property name, e.g. "_Texture", within a custom expression. Just like adding a property in Unity's Shader Graph black board.

    That does not work for me however ("Shader error in 'My Shader': undeclared identifier '_Texture' at custom.hlsl(xy)"), so I am wondering if that is just not how it is supposed to work, or something else is wrong. Happy to send you a file if it's the latter.
     
  42. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    hi yes bets to reach out to me in the discord.
    you can send it direct to me in private so i can better understand what this is
     
  43. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    Amplify Shader Editor
    v1.9.2.1
    - New build uploaded to Unity Asset Store
    Amplify Shader Editor | Visual Scripting | Unity Asset Store

    Templates
    * Added initial support for URP/HDRP 17
    * Updated all URP/HDRP templates
    * Force AlphaToMask Off on URP ScenePicking/SceneSelection passes
    * Fixed URP 14x 15x 16x Decal not working properly on Mac (#217)
    * Fixed HDRP 12x 14x 15x 16x Unlit errors on Shadow Matte option (#218)
     
  44. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    Amplify Shader Pack
    v2.0.0.1
    - New build uploaded to Unity Asset Store
    Amplify Shader Pack | VFX Shaders | Unity Asset Store

    * Updated per ASE editor v1.9.2.1
    * New material lighting function replaced baked GI function
    * New example scripts for Global Light Settings (BIRP)
     
  45. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168
    hopeful likes this.
  46. Raven8000Tris

    Raven8000Tris

    Joined:
    Apr 12, 2023
    Posts:
    3
    Hello ! I have a question regarding the Screen Position node, about Screen Type, regarding the results it returns. According to the documentation, the results should be between 0 and actual screen size(in x and y) minus one.
    The results i get when looking through renderdoc are between 0 and 5.375, which is odd (Unity version of 2022.3)(screen of 2560 x 1440).
    The results on an unity version 2021.3 are between 0 and 1.375 (for a screen of 1920x1080).
    Is it a bug, or is it something that i don't understand?
     
  47. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    Hello, thank you for the feedback and we see your confusion.
    from your comment we think this is what you are looking for
    http://paste.amplify.pt/view/raw/9c1f262e
    upload_2023-9-25_10-11-4.png


    Please find our action item #234 to improve this
    Improve Screen Position to be more intuitive · Issue #234 · AmplifyCreations/AmplifyShaderEditor-Feedback (github.com)
     
    Raven8000Tris likes this.
  48. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,833
    Is there a way to implement translucency in deferred rendering path?
    I have problem in the deferred rendering path (black area around transparent textures)
    Or maybe the problem is related to the my shader settings?

    Untitled.jpg
     
  49. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    168

    if you can reproduce in a small scene, feel free to send me in private thru email or discord.
    i would be happy t have a look.

    Please also include what unity version and pipeline
     
  50. thang_unity516

    thang_unity516

    Joined:
    Oct 29, 2021
    Posts:
    41
    Hi guys, I would like to ask about the shader LOD setup in ASE

    I have a script update the shader maxLOD in the editor like this. In short, I have 4 quality and the highest one is ultra. The highest one will have shaderMaxLOD = 550, otherwise, it will be 350
    Code (CSharp):
    1. [InitializeOnLoad]
    2. public class ShaderKeywordChangeTest
    3. {
    4.     private static int quality = -1;
    5.  
    6.     static ShaderKeywordChangeTest()
    7.     {
    8.         EditorApplication.update += Update;
    9.     }
    10.  
    11.     static void Update()
    12.     {
    13.         //you dont want to do anything when editor is busy
    14.         if (EditorApplication.isCompiling || EditorApplication.isPaused || EditorApplication.isUpdating)
    15.         {
    16.             return;
    17.         }
    18.  
    19.         int curQualityLvl = QualitySettings.GetQualityLevel();
    20.  
    21.         if (quality != curQualityLvl)
    22.         {
    23.             Debug.Log("QualitySetting is changed: " + quality + "__" + curQualityLvl);
    24.  
    25.             quality = curQualityLvl;
    26.  
    27.             switch (quality)
    28.             {
    29.                 case 0:
    30.                     Shader.globalMaximumLOD = 350;
    31.                     break;
    32.                 case 1:
    33.                     Shader.globalMaximumLOD = 350;
    34.                     break;
    35.                 case 2:
    36.                     Shader.globalMaximumLOD = 350;
    37.                     break;
    38.                 default:
    39.                     Shader.globalMaximumLOD = 550;
    40.                     break;
    41.             }
    42.         }
    43.     }
    44. }
    In ASE, if I change my quality to ultra, I can set shader LOD to 500 but if I change back to low quality, the shader will auto reassign LOD to 350. In short, I can't set LOD level in shader more than the shader maximum LOD. How can I turn this off 'cause the shader don't work if the LOD level don't meet is what I expected

    Thanks for your helps in advance