Search Unity

  1. New Unity Live Help updates. Check them out here!

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

    KrikeyAdmin

    Joined:
    Feb 5, 2018
    Posts:
    27
    @Amplify_Ricardo
    I'm attempting to update my project to use the Light Weight Rendering Pipeline. I've watched the youtube tutorial and have all the correct assets imported. The issue I'm having is that when I open existing ASE shader graphs, and I change the Shader Type to be "Lightweight PBR", the node links are broken (it appears this is normal behavior), but then after I hook them back up and attempt to save my shader, when I then reopen the shader graph, the node links again are not connected and my shader isn't displaying correctly.

    Any tips? Using Unity 2018.2.3f1 and ASE 1.6.1
     
  2. Raul_MadGoat

    Raul_MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    264
    Hello,

    Any idea why we only get shadowcasting to work in Fade and Transparent mode but not in Opaque and Cutout?
    We are trying to make a big single shader with multiple features and we have a dropdown to select blending mode directly on material inspector (like in standard shader)

    These are the results we get:


    We use code similar to the standard shader GUI to change the renderType and queue in material:
    https://pastebin.com/Qj9DgFtz

    This is our base setup for the shader.


    Thanks,
    Raul @ MadGoat Studio
     
  3. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    339
    Big time noob with, what could be a simple question. I'm looking to create something like the Dithering node but rather when the camera approaches, the subject starts to fade. Anyway, this is what I've got.

    Any help would be great.
     

    Attached Files:

  4. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    177
    This is gamma:



    The way its supposed to work.

    This is linear:



    As you see it's not working.

    IT's supposed to be a lavalamp shader.

    Should i post the graph? I can't figure this out
     
  5. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Apologies for the delay in our response! As BOXOPHOBIC has kindly suggested, you can refer to our SimpleTerrain sample as an example on how to modify the vertex tangent. You'll need to use the Vertex Tangent node in order to access its vector in object space and, after performing the desired operations, connect it to either the Vertex Offset or Vertex Normal.


    I'm not entirely sure on what the issue with softness could be, as I'm not at all familiar with this type of shader, however, our developer is going to run some tests on the Kajiya-Kay function that you have previously shared with us in order to see if there are any issues with the SRP.

    We'll let you know as soon as we have any findings to share!


    Hello! Can you confirm that you've imported the Legacy package - LWSRPTemplates (Legacy).unitypackage?

    The non-legacy one is meant for Unity 2018.3+ and SRP 4.3.0.


    Hello! We've ran some simple tests on our side and the shadowcaster seems to be working as expected with both Opaque and Cutout types, so the issue might be elsewhere. Could you share a sample with us through support@amplify.pt with the issue present so that we can investigate this using the same data as you?


    Hello! You'll likely need to have your shader set to Transparent, and use the Opacity for having the object fade.

    Please let me know if the example below helps:




    Hello, depending on how you have your textures and shaders are set up, its definitely possible that there will be different results when changing between Gamma and Linear workflows.

    You can find more information regarding Linear and Gamma workflows here.

    We also provide two nodes, the Gamma to Linear and Linear to Gamma, which can be used when its necessary to do either conversion within the shader.
     
    Raul_MadGoat likes this.
  6. Raul_MadGoat

    Raul_MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    264
    Thanks. I will make a package with the shader, shadergui and the test scene as soon as I can and will send it over to the email address.
     
  7. TheNathanParable

    TheNathanParable

    Joined:
    Mar 21, 2014
    Posts:
    17
    @KRGraphics

    As far as I know, perfect soft hair rendering is something that even AAA companies haven't managed yet.

    I know of two potential workarounds for rendering soft hair with correct depth sorting:

    1) Render the hair in two passes. The first pass would be the hair with soft transparency (and all the sorting issues that come with it), and the second pass would be the hair with cutout transparency (correct sorting, but hard edges). You'd then layer the second pass over the first one, so only the soft edges of the first pass are visible. I think this is more or less the technique the Blacksmith hair shader uses (it might use more passes though, like separate ones for front and back culling), though I was never able to get it working properly in newer versions of the Unity engine.

    I think i've seen this method used in Rise of the Tomb Raider, among some other games. The problem with this technique is that as soon as the character stands in front of a background with DOF, the soft edges get blurred away (as they are ignored by the depth buffer), leaving behind the crisp cutout edges. As long as your game doesn't make heavy use of DOF, it'll look fine.

    2) Render the hair in one pass using dithering. Basically you use cutout transparency, but feed the transparency map into a dither node. You then use Temporal Anti-Aliasing to smooth out the dithered hair, making it look soft. This is the technique used in Final Fantasy 13, Metal Gear Solid 5, and the Unreal 4 Photorealistic Character example.

    https://docs.unrealengine.com/en-us/Resources/Showcases/PhotorealisticCharacter#hairandtransparency

    The upside is that this works with DOF, as the hair only uses cutout transparency (so there's no z-depth issues). The downside is that the Temporal AA can only smooth out the dithering when barely anything is moving, otherwise the dithering can be seen (depending on the game though, it shouldn't be too noticeable. I never noticed this technique being used in either FF13 or MGS5 until I saw still screenshots).
     
    Amplify_Borba and KRGraphics like this.
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    This shader has been my toughest to author... I was even wondering how to get the depth of the hair cards... I was looking at how Alloy did it's hair and it was all passes.
     
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    I'm trying to go for option one, but it requires a lot of writing and saving... and I have A TON of hair cards that cover the head and it needs to look full. ( Haven't figured out Correct Depth softing) The characters I'm using aren't in extreme closeups, but when I set the hair to white with spec turned up, it looks full...

    In my initial tests, I was just copying blocks of code and changing the render tags.

    I want to try option two but don't know how to approach this in the editor. My hair textures are hand authored in Substance Painter and they look really soft...

    I'll try this tonight but I don't know how far this will get me. I'm using Rendertype Transparent and Queue Transparent+1
     
  10. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    339
    Untitled.png @Amplify_Borba Thanks for looking at the simple Camera_Depth_Fade issue I was having but the enclosed picture shows why I originally was hoping to do this with some sort of Opaque shader. When the camera gets close to the player, the player does indeed fade away but there is always a hint of "see through" to the player. Most importantly when the camera moves away from the player, I get the following picture. The material has turned very dark. The shader is only applied to the head.
     
  11. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    That's perfectly understandable, it is a very complex effect to tackle. We've ran some tests on the Kajiya-kay function, on both SRP 3.0.0 and the latest 4.6.0, and everything is working as expected, no errors are being generated on our side.

    Also, we do provide a Dither node, which accepts Noise Textures and might help you achieve the second option that TheNathanParable kindly suggested.




    You could try using a Custom Blend Mode and experiment with the different settings made available, and you will likely need to use a Saturate node to prevent the value range being passed into the Opacity port to be outside of the 0-1 scope it expects.

    Please refer to the following example:



     
  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    Then why does it keep breaking on my end? And I am getting Unity 2018.3 now so I will have some time to play today... I am guessing I plug my hair alpha into this dither node and see where it takes me. Tempted to try the first option again. The first pass is my hair just straight rendered... I could make my own hair template..

    EDIT: I may have to remove some options from my hair shader so the Kajiya Kay will work. Could it be that I am using HDSRP and will not work properly.
     
    Last edited: Dec 13, 2018
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    So I am trying out the dither node, and I got an error when I plugged in the Alpha Texture...

    upload_2018-12-13_10-40-4.png

    EDIT: Needed to be in 4x4 mode for it to work... and not liking in the dither pattern since I can't seem to get proper depth sorting... same thing happens to my grass shaders
     
    Last edited: Dec 13, 2018
  14. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    That shader looks like a good way of a having a 1st/3rd person camera where the head uses that as a shader when the camera goes first person, while it still draws the shadow of the geometry on the ground.
     
    hopeful likes this.
  15. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    I am going to try the other method of hair rendering that was done in the Blacksmith Demo... once I can look at the shader code, I should be able to emulate it
     
  16. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    @TheNathanParable I might have to share my shader code with you so you can see what i am trying to do. The main pass does EXACTLY what I am looking for... just need to add the second one
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    So I have updated to Unity 2018.3 and I have installed the latest version of ASE 1.6.1. Unfortunately, when I load in my scenes, I am greeted with a nice pink dreamland, and several errors. Like this:

    Has anyone dealt with this?

    EDIT: Fixed... just had to recompute my shaders :), but now the hair is broken... again.

    Here is the error that i am getting in my hair shader:

     
    Last edited: Dec 14, 2018
  18. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Please ensure that you're using the latest ASE release, currently available for download through our website ( v1.6.1r3 ), which contains an updated HD Template in the Assets\AmplifyShaderEditor\Plugins\EditorResources\Templates\SRP folder ( HDSRPTemplates.unitypackage - not the ( Legacy ) one! ) meant to be used with the latest HD SRP Package ( 4.6.0 ).

    It's important to note that our template only supports the latest 4.6.0 package.

    Let us know if this works for you!
     
    KRGraphics likes this.
  19. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    513
    Hey guys,

    Like @Amplify_Borba mentioned there's a new build into our website, that we just uploaded.

    Here are the release notes:

    Release Notes v1.6.1 rev 03:
    • New Shader Functions:
      • Terrain Wind Value
      • Terrain Wind Animate Vertex
        • Updated Simple Terrain sample to use this shader function
    • Improvements:
      • Updated HDRP PBR template to v4.6.0
      • Added Alpha To Coverage/Alpha To Mask option into templates
        • Set under the Blend Mode area
    • Fixes:
      • Fixed issue on Emission color being added over Forward Add pass when using 'Standard Surface Light' node

    Regarding the Wind Animate Vertex usage under the Simple Terrain sample, we added an ApplyGrassWindToTerrain.unitypackage inside its folder that, when imported, replaces the terrain with one using the GrassBlades material (which uses a Terrain Wind Zone).

    We didn't add this on the default terrain itself as it generates a warning when being imported on which we are still figuring out how to remove.

    Hope you all have an amazing weekend and happy shader creations!
     
    Last edited: Dec 14, 2018
    KRGraphics likes this.
  20. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    My man... about to try this out now... I was also having issues with my shaders not compiling
     
  21. deadlycrow

    deadlycrow

    Joined:
    Feb 10, 2014
    Posts:
    123
    Hello, can anyone help me with this? http://amplify.pt/forum/viewtopic.php?f=23&t=994&p=4371

    Meshes turn black and start flickering when the outline is enabled, it happens in custom lighting mode when you have a lot of static objects, even in the examples provided in the package.
     
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    So I got it all working... except now the shaders will fail to compile no matter what I do
     
  23. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    790
    Hi Amplify Team!

    1)
    I get different results in the preview and ingame!
    I've recorded a short video to show what I mean:


    How can there be any differences between what the shader editor shows and what's actually happening ingame?
    The object I'm using is a default unity quad (that's what was used in the video)
    I also tried with a custom object made in blender, and I've made absolutely sure that the UVs of the object I'm using ingame are correct (going from exactly 0 to 1) but the same thing happens.

    This was recorded in 2019 a11 with the "old" render pipeline (not lwrp or hdrp).

    Here's the shader: https://ghostbin.com/paste/tnfq8

    2)
    I know you responded to someone else, but please put my vote in for this as well! :)


    3)
    Would it be possible to add gradients to ASE?
    Like having this: https://i.imgur.com/rnr68Gj.png but inside a shader, and being able to modify it live inside the shader (adding, moving, removing colors), and being able to set it from the inspector in a material as well.

    For designers it would be awesome to be able to just put in some sort of gradient into a material.
    The node in the shader graph would just take a "gradient asset" and a float (0 - 1) and output a float4.
    I believe that's how it works in unity's shader graph as well.

    Is that something you'd consider adding?
     
  24. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    151
    Hi, there were a lot of errors when I created new HDRP project in 2018.3 and imported Amplify + HD SRP Samples package. This is the latest version from Asset Store.
     

    Attached Files:

  25. AkiLap

    AkiLap

    Joined:
    Sep 14, 2014
    Posts:
    24
    Updated our project to Unity 2018.3 with HDRP v4.6.0 and latest ASE from Amplify site.

    Just want to thank Amplify team, everything works nice and the whole project upgraded with minimal effort!
     
    KRGraphics likes this.
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    I LOVE the new updates... everything is clean and detailed
     
  27. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    483
    That looks really cool! I may check it out later, but unfortunately right now I'm swamped with work and projects.
     
  28. deadlycrow

    deadlycrow

    Joined:
    Feb 10, 2014
    Posts:
    123
    anyone please? :(
     
  29. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    121
    Got a different type of questions here:
    First: Are we able to use multipass now? o_O sorry i was super busy in the past 6 months so i couldn't keep track and on a quick search it looks like we are but better ask....

    Second: I've noticed that all the major node editors are beginning to push towards the top down approach (makes sense), is that something that you guys are interested in ?
     
  30. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, we've just got back to you on the forum, we'll stay in touch through there to prevent posting the same information on different places.


    Hey there, are you still having this issue? Can you share the errors you're getting?


    Hello! Unfortunately this is an expected behavior for now, which you can solve by importing the latest HDRP Template and recompiling those shaders, so that they account for the correct template. It's present on the latest version, although I don't believed that version has hit the Asset Store just yet.

    We always recommend that you update through our website, since new builds take a while to become accepted and made available in the Asset Store. The latest build supports SRP 4.6.0 on 2018.3.x, so you need to update to that SRP version in order to use our latest HD templates. We are unable to support older SRP 4.x versions due to the extensive modifications that have occurred on Unity's side, so at this time we can only offer support for the legacy 3.0.0 and the latest 4.6.0.


    Hello!

    1 - Unfortunately, the Node Previews are not always accurate nor clear, so they should only be used as a reference for the data being handled by the node holding the preview, rather than a guide for the final effect.

    2 - Sure, no problem!

    3 - You can set this up through specific node compositions, we've shared an example for a 3 color gradient that you can download from this post and use as-is or as a base to set up your own effect. We can consider distributing this with ASE as a shader function, I'll get in touch with the developer regarding it, thank you for your suggestion!


    Hello, no problem! We support multipass through shader templates, you can read more about this in our wiki page.

    Regarding your second question, it's not something that we have considered yet, but its always possible that it could come up at a later stage!
     
  31. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    1,441
    Any updates on the HD Lit Master node support? :)
     
  32. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey there, it's being actively worked on, we'll be sure to announce it in an upcoming build so stay tuned!
     
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    They render fine but when I got to the shader list, there is a spot called Failed To Compile and most of my shaders are in there. My shaders are pretty much finished except for the hair which I am still struggling to properly set up passes for. I had a bright idea for setting up passes in the shader editor, such as have a button to add a pass and an optional combine of the parameters. Probably impossible to do, but it will save me time from hacking about in code
     
  34. deadlycrow

    deadlycrow

    Joined:
    Feb 10, 2014
    Posts:
    123
    Thanks!, i've posted again in the amplify forum, the problem still exists :(
     
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    upload_2018-12-17_15-39-32.png

    Tested the Kajiya-Kay function and it is working very nicely... however, I am trying to add passes to the hair and nothing has changed...

    I added some additional passes (created a pass after the GBuffer pass) just to get some depth on the hair and I saw no changes. should I be creating the passes about the GBuffer pass or after all of passes?
     
  36. Branxord

    Branxord

    Joined:
    May 13, 2018
    Posts:
    14
    Hey everybody, i got a question, i want to have this hologram shader slightly OVER the character, like for a shield over the skin, but as you can see i duplicated the model and gave it the hologram material, made it bigger, but it doesn't line up with the original character, and i'm thinking i have to use the same animation component inside the duplicate so it's not T posing and i don't think that's good, any ideas?
     

    Attached Files:

  37. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    You can't simply scale up the whole model, you'll have to push the verts on the model relative to their vertex normals.
     
    Branxord and KRGraphics like this.
  38. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    If you want to write to depth in the fragment, you need to manually calculate the clipspace ndc, and I believe that it shoud be written in the GBuffer pass. Also, if you're using deferred hair with temporal dither, you don't need to change anything in the depth normal, however, if its forward / transparent hair, this might be necessary.


    Hello! As MattyWS kindly replied, scaling the object will not be enough and you will likely have to resort to vertex manipulation, accounting for the vertex normals of the mesh.
     
  39. Branxord

    Branxord

    Joined:
    May 13, 2018
    Posts:
    14
    Oh ok, how can i do that tho? (quite new with shaders sorry)
     
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,996
    I don't know how to do this, unfortunately. I'm using the HDSRP for this hair
     
  41. Johny-Gull

    Johny-Gull

    Joined:
    Apr 22, 2014
    Posts:
    4
    Is it possible to somehow add additional passes to the Post-processing Template other than Screen? eg Depth Texture
    https://docs.unity3d.com/Manual/SL-CameraDepthTexture.html
    I think it should be somewhere in the Pass, but I do not quite understand how this should work
    I have too many different shaders in the project and I don’t want to add a depth pass for the effect to each of them, especially since some are not built on Amplify
     
  42. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    151
    I updated both Amplify and HDRP template to latest version. How can I recompile shaders to fix the errors? I tried to re-import Amplify package but those HD SRP shaders still couldn't find correct paths.
     
  43. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    790
    Oh, that is surprising as the preview were perfect for tons of scenarios.
    I guess it can't be helped, not a big problem for me as long as I know that it's definitely the previews which are off (as opposed to something like the generated shader having an actual bug or something).

    Is it known what functions can have glitched previews? Or is it a specific combination of nodes?

    That's what I've been doing so far but it's a bit troublesome to use as you can't easily reorder colors or even add new ones. Thanks for forwarding the idea!
     
  44. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    104
    Hey, quick question :

    Terrain looks broken when "draw instanced" is toggled in unity 2018.3 with an amplify terrain shader.

    Is there a way to make it work already ? (like an additional surface option or an additional directive)

    It's also looking broken with the standard unity surface shader, so...


    Thanks in advance for you time,

    Jonathan
     
  45. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Here's a simple example for your convenience:



    Do note that the results will always depend on how the object's mesh is set up.


    Hello, do you mean to access the depth buffer?
    You can use the screen depth node in order to access it without having to add a depth pass.


    You'll have to open each HD SRP sample shader in the ASE editor and compile them, so that their template updates correctly. Unfortunately there's no way we can force this on our side, it must be done manually whenever the templates are updated.


    Nodes that end up showing blank or different results from what you'll see in the scene / game view are not exactly being affected by glitches, you can see it as a limitation that might occur depending on the data that they receive and how they're handling it internally.

    The previews are definitely something that we hope to improve in the future in order to make them more user friendly.


    Hello, support for Terrain Instancing is still being worked on, apologies for the inconvenience!
     
    corjn likes this.
  46. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    209
    Spoiler, a bit of self promotion! :D

    My wind asset Advanced Dynamic Shaders, made with Amplify Shader Editor, has been nominated for Unity 2018 Award in Best Development Tools Category! :cool:

    Vote your favorite here: https://awards.unity.com/#best-development-tool

    Thanks everyone and thanks to Amplify for this awesome tool!!! :)
    ADS FInalist - opt.gif

    @Amplify - I have a suggestion. It would be nice to be able to link different properties to tessellation parameters.
    upload_2018-12-19_15-27-16.png

    Thanks!
     
  47. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey there, congratulations!
    The team wishes you the best of luck!

    Regarding your suggestion, I'll register it for the developer to consider, but it should be possible to expose those parameters.

    In the meantime, you may consider using the Tessellation nodes with properties connected to it, in order to be able to tweak it through the material inspector
     
  48. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    209
    Thank you! I really appreciate it!
    I didn't know about the tessellation node... In this case I'll just use them instead.
     
  49. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    151
    Thank you. It seems to work. But there is an error in the shader. How to fix it?
     

    Attached Files:

  50. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    We can't replicate that error on our side, can you confirm if you're using the latest 4.6.0 HDRP package?



    And that you've extracted the HDSRPTemplates.unitypackage rather than the HDSRPTemplates (Legacy).unitypackage?
     
unityunity