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. Dimlos

    Dimlos

    Joined:
    Aug 13, 2014
    Posts:
    51
    Hello, I'm using URP for my 2D project, and I was trying to use the Grab Screen Color node but I can't seem to display anything else than grey:

    here are my 2D settings, I tried to follow the guide here but no "Foremost Sorting Layer" I tried helped:

    Here are the nodes :

    I'm trying to use this as a workaround for something else and also because I want to understand why it's not doing its thing.

    Thank you.
     
  2. eastes

    eastes

    Joined:
    Sep 1, 2012
    Posts:
    59
    upload_2023-5-28_22-25-57.png

    I'm trying my best to write an unlit shader with fog support using one of the linear fog options. I just can't figure out what nodes should follow these two. I'm happy to pay for support if anyone has the ability. Thank you.
     
  3. zeux-n00b

    zeux-n00b

    Joined:
    Nov 4, 2017
    Posts:
    73
    Hi! In as a skybox shader i need to rotate cubemap around X, Y and Z axis. I don't know how to combine this three Rotate About Axis nodes. I appreciate anyone's hint, so thank you in a forward Screenshot 2023-05-28 201736.jpg
     
  4. eastes

    eastes

    Joined:
    Sep 1, 2012
    Posts:
    59
    Found this on the Discord. I think it'll be the right direction:
    upload_2023-5-29_9-24-22.png
     
  5. IllTemperedTunas

    IllTemperedTunas

    Joined:
    Aug 31, 2012
    Posts:
    782
    Does anyone know of resources on the subject of converting their project from URP to HDRP in regards to Amplify? Or best practices for maintaining a project that must be converted to URP occasionally in order to create web builds?

    After migrating to URP I started trying to utilize shader graph as I figured there would be less shader headaches using built in tools. Now some of my shaders are shader graph, some are Amplify. It's become a bit of a nightmare just managing these 2 pipelines, and now I'm seriously considering migrating to HDRP, but I'm not even sure how much effort is required to convert existing shaders to that pipeline. Each render pipeline is its own nightmare of figuring out sorting issues and MSC other issues that invariably arise.

    So does anyone know any resources or guides on how to upkeep all these shaders? Is it manageable to migrating between HDRP and URP to do a web build, and stand alone PC build? Should I create duplicates of shaders? Or just change the existing ones based on render pipeline? Does it take forever to migrate the project between these pipelines?

    Best way to find out is to just try this stuff, but was hoping someone would have insights into this stuff. It's fast become a nightmare managing all these shaders, materials, and pipelines and their idiosyncrasies with how they interact with one another, and how Unity goes about determining which render pipeline you're using.

    TLDR: What's the best practice for upkeeping shaders and materials on a project that plans on swapping between render pipelines for best graphics on PC with HDRP, but also URP for web builds?

    P.S. Amplify is so nice to use, it's far more performant, and using shader functions just makes so much more sense than in shader graph, but increasingly all the pipeline revisions makes the official shader graph the smarter choice as it's first party and you know it will work with the internal revisions to the engine pipelines. It's a real pain in the butt time trying to decide which pipeline to use, which tool, if it's going to take revisions in the future. Would be so nice to just have a shader editor that you just tell it, "hey this is a transparent material, here's the opacity, here's the color, spec, etc. Can you pop out a shader/material that works in X pipeline?" It's all so discombobulated right now, which is frustrating because all use shader creators are all basically creating the same thing: An RGB value that essentially represents Color, Normal, or Transparency. You would think that at this point there would be a better means of taking those core things, and spitting out a shader that fits a given type (Transparent, additive, surface) without any nonsense of having to wrangle with sorting, pipeline type, version, platform, etc.
     
    Last edited: Jun 6, 2023
  6. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    I have some experience in maintaining large shader assets such as “DE Environment” that has around 200+ shaders in each pipeline with multiple api’s. My strong suggestion is for you to make your shader all within shader functions then use different switches such as switch by SRP version an switch by pipeline making URP and HDR all within the same function. This will significantly reduce your workflow as you only need to make changes into your core functions and then it gets applied same across every shader you support.

    I keep a set of shaders for each pipeline separated as URP and HDRP will have different settings on the main input block. As noted above all my changes are within functions so I use ASE tools such as the Batch Save and Pack that uses one click, it finds every ASE shader then opens and compiles all of them. This will save you a lot of time in your workflow.


    We support SRP versions from 10x and higher for official versions and ASE has been around for many years. Actually, SG compiles the changes also per api, however Unity has SG pre-installed were as ASE needs to download from package manager. The shader you make with ASE once compiled do not need ASE to be installed to work when you wish to share them.

    Many ASE users have made “Uber” shaders however they can be heavy on performance. Once you get your workflow what you need when you need it can have benefits to help make your projects run better.
     
    IllTemperedTunas likes this.
  7. IllTemperedTunas

    IllTemperedTunas

    Joined:
    Aug 31, 2012
    Posts:
    782
    Appreciate you taking the time to reply, the notion of just getting all the core things in functions makes a lot of sense, then it's a simple matter of plugging them into the core node, it's essentially what I was whining about at the bottom, "Why can't we just have a core rgb node that plugs into the right slot?".

    Duh, why didn't I think of this before! I'll start thinking of "diffuse", "transparency", and "Emission, etc. as things that should exist completely in a function from now on, i'll try to think of every shader as having one functions for every input that it connects to in the main node, it'll make creating variations of these shaders much more streamlined as well. Thanks again for the insights. Feeling more more confident moving forward now.
     
    Last edited: Jun 6, 2023
  8. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    Just wanted to show this but I love Amplify shader editor, I'm slowly getting to learn more and create cool things as I do. Right now I'm remaking my foliage shader from scratch, so I started by breaking the wind into components. First, it's wind rotation, have to admit I'm proud, almost looks like actual physics. After I'm done making all the wind phases I'll have a fully functional wind shader.

     
    Amplify_David likes this.
  9. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    correct, the way i find work best for me is to have my functions organized into 3 ideas.

    Core
    this is my master function that simply has the outputs to connect into the master block.

    Modules
    this is any additional functions for thigs such as weather, detail, outline, xxxx that can be added inline between any core function and the master input block.

    Functions and Nodes
    the building blocks used within any functions.
     
    IllTemperedTunas likes this.
  10. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    FYI, with Unity 2022.3.1 release, Amplify shader has missing GUIStyles when opening the shader window:

    these styles no longer exist as part of Unity:
    Code (CSharp):
    1. ToolbarSearchTextfield = new GUIStyle( (GUIStyle)"ToolbarSeachTextField" );
    2. ToolbarSearchCancelButton = new GUIStyle( (GUIStyle)"ToolbarSeachCancelButton" );
    Pretty sure the intended approach for seach bars in IMGUI is to use the SearchField class:
    https://docs.unity3d.com/2022.3/Documentation/ScriptReference/IMGUI.Controls.SearchField.html
     
  11. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193


    Thanks for the report
    yes, we have been tracking this internally as unity started this in alpha 16x then started backporting over the last week down into 15x. The new api 14.0.8 just got this a few days ago.

    the warning seams harmless for now with respect to compiling the final shaders as its looking for the new Unity DarkSkin layout. I don’t like warnings also so be certain it will get fixed asap. As Unity does not track “backporting” in its change notes we will also keep a look out incase this gets into any other already released api’s pre 14.0.8
     
    CDF likes this.
  12. TheGonzoGamer

    TheGonzoGamer

    Joined:
    Apr 24, 2019
    Posts:
    35
    I posted this in the discord as well. Unsure which is the preferred method. But I have a shader written in ShaderLab that creates an electricity effect across the mesh.
    i wanted to incorporate this effect in a shader I have written in ASE. But since I am unfamiliar with ShaderLab I am pretty much lost.
    Here is the sahderLab code. Thank you in advance for any help
    https://pastebin.com/7A0GQ32w
     
  13. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    hello
    We reply in discord.
    Please try to only post in one or the other.

    thank you
     
  14. IllTemperedTunas

    IllTemperedTunas

    Joined:
    Aug 31, 2012
    Posts:
    782
    Just wanted to post here and warn anyone about transitioning to the Shader Graph tool thinking it's official and going to have "long term support". Amplify Shader is superior in most respects and for the foreseeable future Amplify Shader is absolutely 100% the best solution for custom shaders. Wish I'd stumbled upon this sentiment somewhere before squandering days migrating to an inferior system.

    The only problem I've had with this tool are some sorting issues with transparent materials in the URP.
     
  15. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    looks like unity fixed this in 2023.3.2
     
    CDF likes this.
  16. BigDill

    BigDill

    Joined:
    Jan 1, 2013
    Posts:
    31
    I have built a custom lighting shader using the built-in render pipeline and based this on your ASE custom light tutorials on youtube. However I am currently unable to get my point light "lightmaps" to work and was wondering what the recommended approach is to add lightmap support to the custom light graph you guys created in the tutorial. I can confirm that I have lightmaps and meta pass enable in the shader and all lightmap objects are static with lightmaps UVs added and mapped correctly. Scene has one directional light which is real-time (do not want this baked) and one point light that is baked and lightmapped using Enlighten. I did have a go at trying to work this out and did make some progress but I have hit a wall where the directional light appears to turn off my light maps when I enable it or disable it in scene. see the below graph image if it helps to see what I have attempted but I think I would rather start again following your advice.

    The final combine just takes the output from your tutorial and combines with a texture and the Lightmap. I did think I should output the lightmap on the emission cannel but it did not seem to work? Andy advice would be appreciated.

    Thank you for the help.

    upload_2023-6-17_14-54-38.png
     
    Last edited: Jun 18, 2023
  17. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    Hello
    For chat and or day-to-day questions i suggest better to reach out in our discord then we can do a chat in Realtime.
     
  18. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    see Bug - AddressablesGroupWindow missing styles in 2022.3.1 - Unity Forum

    upload_2023-6-24_15-4-33.png
     
  19. Finley3D

    Finley3D

    Joined:
    Jan 12, 2019
    Posts:
    3
    Hello, I am using URP and just found out there's a cool x-ray sample that uses extra pre pass to achieve the effect, but it looks kinda buggy that Suzanne's ear behind its face is also being rendered.

    Screenshot - 2023-06-29 17.36.39.png

    Then I found this thread, it looks like the same problem to me, it's some depth related problem but I don't know how to do it in amplify editor or I need to modify the shader code directly maybe?
    I have tried to turn on z write in extra pre pass node but Suzanne rendered as the main output node behind the wall somehow, and I can't control the transparency by adjusting the extra pre pass node's alpha value no more, that's pretty confusing. Thanks.

    Screenshot - 2023-06-29 19.09.08.png
    (It doesn't look like it but it does behind the wall.)
     
    Last edited: Jun 29, 2023
  20. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    yes, thank you we are aware of the issue and working on the fix for this next update.
     
    Finley3D likes this.
  21. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    Hi,

    I tried switching to 2023.1 (to workaround an Editor issue). While the Editor issue seems to be resolved.. i now seem to have a problem with the shader that's generated for URP.

    I get the following error:

    Shader error in 'Raygeas/AZURE Water': 'OUTPUT_SH': Too few arguments to a macro call. at line 399


    I guess OUTPUT_SH changed from this to this. Can a kind soul help to fix it?

    Thanks!
     
  22. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    ASE v1.9.1.7 or higher
    Please verify the correct template for your version URP 15x is unpacked.
    that error usually suggest it was compiled with an older template api version.

    upload_2023-6-29_11-14-12.png
     
  23. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    Thanks for the fast reply! It wasn't exactly the solution. But it gave me confidence I was on the right track. Will explain what I did just to share.

    Was attempting to get Azure Nature to work on 2023.1. I'm not the author.. but hey.

    Turns out `Raygeas/AZURE Vegetation` shader depended on `Raygeas/AZURE Water` shader. So had to fix the water shader and that fixed the vegetation shader too. Thanks again David for replying quickly. Appreciate it!

    Minor Edit: Shaders are not pink. But they still look off. Doubt it's an ASE issue. So will continue digging :)
     
    Last edited: Jun 30, 2023
    Amplify_David likes this.
  24. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    @Amplify_David managed to get it to work somewhat. I believe issue is in
    AmplifyShaderEditor\Plugins\Editor\Nodes\Constants\ShaderVariables\Lighting\IndirectDiffuseLighting.cs:231:

    Code (CSharp):
    1. dataCollector.AddToVertexLocalVariables( UniqueId, "OUTPUT_SH( " + worldNormal + ", " + vOutName + ".lightmapUVOrVertexSH.xyz );" );
    Note that OUTPUT_SH has changed to accept 4 values. In the case of the Azure Nature package, there was a node for "Get Local Var" and from there var (Indirect Light) was selected. So removing that node (which disconnected it from an Add Node input port) fixed it (to generate the second image)

    I'm on v1.9.17 of ASE. Would appreciate if you can verify if the one line on IndirectDiffuseLighting.cs needs to be fixed. Thanks again!

    upload_2023-6-30_16-9-59.png

    upload_2023-6-30_16-19-37.png
     
  25. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    thank you.
    see linked for tracking.
    Update Node – IndirectDiffuseLighting · Issue #209 · AmplifyCreations/AmplifyShaderEditor-Feedback (github.com)
     
  26. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    Thanks! Noticed you have also closed the issue as fixed in github. Looking forward to the next version! If it's just one file I can help with testing. if not will wait for the official release.
     
  27. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    Its live in the asset store just now
    Enjoy
     
  28. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    It works! Thanks mate!
     
    Amplify_David likes this.
  29. zackblack

    zackblack

    Joined:
    May 17, 2015
    Posts:
    76
    Question on updating ASE: Is it possible to to update all ASE shaders in a project without having to open each one and click the save button manually? I have some huge projects in URP and will often get messages and errors when upgrading to new Unity/URP versions and have to go back and re-build all the shaders.
     
  30. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    You can find an extra tool that may be handy for this
    Window/Amplify Shader Editor/ Batch Save and Pack

    --- Create an Asset Present file
    --- Main Content Browse and select file to search
    --- Fetch will search file selected and generate a shader list
    --- Press Update All

    upload_2023-7-1_16-18-29.png
     
    hopeful likes this.
  31. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    Sorry for the delay reply
    if you can reach out to me in discord, we can discus in more detail.
     
    Finley3D likes this.
  32. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    hello just a follow up.
    ASE 1.9.1.8 was pushed to the asset store and had a number of depth issue fixed.
    also, I found that in the URP Xray sample it was not set correct for transparent in pre pass as it is needed for the depth fade node. it will be fixed in the next update to amplify shader pack.
     
    Mohamed-Anis and Finley3D like this.
  33. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    602
    Hi! I noticed when trying to use File mode for the Custom Expression node I can't use anything that would have spaces, as I get an error. It works fine otherwise. I believe this is a bug?

    upload_2023-7-16_14-40-54.png

    upload_2023-7-16_14-40-29.png
     
  34. InitusInteractive

    InitusInteractive

    Joined:
    Aug 16, 2018
    Posts:
    128
    Hi, does anyone have an example of a simple planet atmosphere using Amplify Shader Editor? Anything on github or a community examples database please? Thank you so much :)
     
  35. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193

    thank you for the report.
    we actually have been working on something similar for registers and will look at the custom function see if it's possible also. Note if we do add this and space is used any one you send it to would need to use the min version of amplify xxx and higher for it to open correctly.
     
  36. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    yes, you may find lots of recourses in Git and or the amplify discord.
    for day-to-day chat and or questions I suggest you try the discord for more guidance
     
  37. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    I have a shader made with amplify that flickers when using srp batcher and forward+ in URP on unity 2022.3.5 on mac silicon.
    When I turn off srp batcher the flickering stops. Is this a known issue or is it a shader setting? or a unity bug :)
    If anyone has has similar results please let me know.
     
  38. Teaufou

    Teaufou

    Joined:
    Jun 30, 2014
    Posts:
    3
    Hi, in Built-in shaders, I try to detect the link between an object direction and the view direction. For this, I use the Object Space View Dir node.

    Both orientation are well detected but a kind of World Space Position seams to be drawn too and move with the view. I've tryed to sub this stranges 3D lines with differents Transform directions but nothing works. The issue is the same with every version of Unity.

    Any idea?
     

    Attached Files:

    Last edited: Jul 26, 2023
  39. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    Hi!

    There's probably something I'm doing wrong, but I can't seem to have a working Vertex Offset on the Y axis.
    On a simple plane with tesselation, everything works fine on X or Z axis:
    upload_2023-7-27_11-1-40.png

    But modifying Y axis does nothing:
    upload_2023-7-27_11-2-12.png

    (Working on URP.)
     
  40. Teaufou

    Teaufou

    Joined:
    Jun 30, 2014
    Posts:
    3
    No scale by 0 on the object transform?
     
    Amplify_David and Grhyll like this.
  41. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    Daamn it was that simple, I don't even know why I put a scale of 0 in the first place. Thanks a lot, I knew I was doing something wrong ^^'
     
    Amplify_David and Teaufou like this.
  42. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    I'm trying to create a bark and branch mask for my trees and I wanted to use vertex position but I noticed it wasn't good enough as vertex y only goes up and down and will affect my leaves. I discovered the Sphere mask node which is excellent for masking the bark and not touching the branches. My only problem is that the gradient mask isn't fixed to the mesh but it seems to be in world space which I don't want. The bushes are not affected by the wind because of this. Does anyone have any idea?

    Basically, I want the gradient to be the same regardless of the mesh size, like per object. I don't get what the deal with vertex position is but it behaves the same, smaller objects get darker.

    Problem.jpg

    Even if I transform world to object it's the same thing as vertex position.

    problem 2.jpg

    Things I have tried, normalizing the vertex position works in keeping the gradient the same across all mesh sizes but it messes up the spherical mask.
     

    Attached Files:

  43. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    I think this might be a problem with models exported from Blender, thou I'm not sure.
     
  44. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    hello
    we have no reports for this issue yet
    can you send me copy of the shader and small repo in discord or thru ASE support

    thanks
     
    Lars-Steenhoff likes this.
  45. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    for vegetation i like to use vertex color
    upload_2023-8-2_9-48-10.png
     
    florianalexandru05 likes this.
  46. IllTemperedTunas

    IllTemperedTunas

    Joined:
    Aug 31, 2012
    Posts:
    782
    Newest Unity Version breaks all Amplify shaders


    Error takes me to this line of code:
     
  47. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    IllTemperedTunas likes this.
  48. IllTemperedTunas

    IllTemperedTunas

    Joined:
    Aug 31, 2012
    Posts:
    782
    Glad to hear you guys are on this! Not in a huge hurry to upgrade, if this issue persists in the coming weeks i'll hit you up.

    As always, thanks for the great support on this asset.
     
    Last edited: Aug 2, 2023
    Amplify_David likes this.
  49. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    Sorry.. I couldn't find anything about this. Maybe if there is some info in the Manual you could point me to it? I'm wondering if DOTS Instancing shaders is supported in ASE? Thank you!
     
  50. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    193
    Not a lot of testing has been focused on Dots, DOTs instancing is in ASE and can be enabled to include definitions and defines however you will need to do testing in each case to verify its correct .. if you find any problems, please report them to ASE.