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

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    119
  2. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! We currently provide two HD Template packages within the AmplifyShaderEditor \ Plugins \ EditorResources \ Templates \ SRP folder:

    HDSRPTemplates (Legacy).unitypackage for the HDRP 3.0.0
    HDSRPTemplates.unitypackage for the HDRP 4.6.0

    Can you confirm that you've imported the non-legacy one?

    If not, simply extract the correct one and it will overwrite the templates. Let me know if this helps!


    Since its not common to use different factors for blending the alpha channel, we have no samples that make use of it.

    Although I'm not entirely familiar with using this particular feature, there are a few test cases shared in this thread that could perhaps shed more light on how it could be used.
     
  3. o2co2

    o2co2

    Joined:
    Aug 9, 2017
    Posts:
    14

    The same situation
     
    Last edited: Jan 8, 2019
  4. Wawruch2

    Wawruch2

    Joined:
    Oct 6, 2016
    Posts:
    29
    Thank you for the answer! I tried bove, Legacy don't work cause it's HDRP 4.6.0. It gives me more errors, while I'm trying to import the HDSRPTemplates.unitypackage (NON Legacy) it gives me only this error:


    Unfortunately shaders are pink :(
     
  5. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    189
    How do I do this in amplify shader?
    Code (CSharp):
    1. half3 specular;
    2.  
    3.  
    4.  
    5.     float3 tangentX = worldVectors[0];
    6.  
    7.     float3 tangentY = worldVectors[1];
    8.  
    9.     float3 N = worldVectors[2];
    10.  
    11.     float3 V = data.worldViewDir;
    12.  
    13.     float3 iblNormalWS = GetAnisotropicModifiedNormal(tangentY, N, V, anisotropy);
    14.  
    15.     float3 iblR = reflect(-V, iblNormalWS);
    Specifically what is the "GetAnisotropicModifiedNormal" function? I feel like I'm missing something here.

    Like I would assume it's some kind of math function thats taking 4 vector3's and combining them into a new vector3 somehow. But I don't know what that math function is.

    Maybe 4x4 matrix?

    Oh I see it's a reference


    Code (CSharp):
    1. float3 GetAnisotropicModifiedNormal(float3 grainDir, float3 N, float3 V, float anisotropy)
    2.  
    3. {
    4.  
    5.     float3 grainNormal = ComputeGrainNormal(grainDir, V);
    6.  
    7.     // TODO: test whether normalizing 'grainNormal' is worth it.
    8.  
    9.     return normalize(lerp(N, grainNormal, anisotropy));
    10.  
    11. }
    As an FYI i'm looking at this shader, it's a anisotropic version of the standard shader and i'm trying to mimic the normal adjustment stuff for the reflections.

    https://github.com/Kink3d/AnisotropicStandardShader

    FINAL EDIT: Ok I figured it out I think XD


    Still any help with recreating this would help a ton to get reflections to stretch too!
     
    Last edited: Jan 8, 2019
  6. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    678
    It would be really nice if you guys created a .dll with all the code from Amplify Shader Editor.
    It's really a lot of scripts and Unity already takes a load time compiling.

    The team of Odin Inspector provides the .dll and a .zip file with the source code in case the user would like to take a look at the code. That would be the ideal.

    Is that something you guys can do?
     
  7. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538

    I've just ran some further tests with the latest ASE version currently available for download on our website, and can't seem to replicate the issue.

    In case you're using the Asset Store version, I believe that its current build doesn't yet support SRP 4.6.0, so you'll have to update through our website as it usually takes longer for our submissions to get accepted and make it into the store.
    If this is not the case, however, we could really use a sample project sent to support@amplify.pt so that we can debug it on our side.


    Unfortunately, assisting with replicating custom shaders is outside of the scope of our support due to our limited resources, although we'll be happy to answer any specific doubt or question, if we can!


    Thank you for your feedback, I'll bring this up with the developer for future consideration!

    For now, you might want to try and put the Amplify Shader Editor as a whole inside an Editor folder to prevent its samples from being included in the build as possible a workaround, since otherwise they will increase build times.
     
  8. Skyfly

    Skyfly

    Joined:
    Jan 25, 2014
    Posts:
    101
    um yeah... but it was quite drastic. I found Unreal worked out of the box for that specific case... (keep in mind: just use the tool that's best suited for a job, both engines are awesome).
     
  9. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    377
    Incorrect code generation when using HDRP:
     

    Attached Files:

  10. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for reaching out to us!

    We've confirmed the issue and will correct it for the next build, which should hopefully be released towards the end of the week, apologies for any inconvenience.

    EDIT: As a temporary workaround you may wish to use the Transform Position node as follows:

     
    Last edited: Jan 9, 2019
    julian-moschuering likes this.
  11. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    Well I wanted to make an efect like how these buildings are created;



    They start off as a wireframe pulsing green.

    Then they become filled in with green with the wireframe still visible.

    Then filled in with texture colour with the wireframe still visible.

    Finally the building is finished and no wireframe is visible.

    My current method to do this would be in my 3d modelling package rendering a wireframe to texture to be used in the shader, but that requires every mesh to have it's own wireframe texture which is a little clunky. I'd like to be able to use the actual wireframe of the mesh in the engine as part of the effect but it doesn't seem possible to render the real wireframe in game.

    What I mean when I say actual wireframe of the mesh;
    https://i2.wp.com/1darray.com/blog/wp-content/uploads/2016/11/unity-wireframe-shader.gif?resize=493,323
     
  12. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    189
    I've decided I may just look into making a custom "indirect specular light" node or something...that would be the easier solution to this maybe.

    You guys have documentation for that type of thing right?
     
  13. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    561
    Is there a way to use a predefined variable like unity_LightmapST directly? I want to scale the lightmap uv in the vertex shader myself, but can't

    (I am working with LWRP)

    EDIT: never mind, setting Vector4 to fetch mode and using Vertex to Fragment node is what I needed.
     
    Last edited: Jan 10, 2019
  14. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you for elaborating!

    Such wireframe effects are authored in geometry shaders, which unfortunately are not currently supported by ASE, so it can't access the necessary geometry data to handle this type of effect. Your suggested workaround of using a wireframe texture is the only alternative I can think of as well.


    Hello, you can look into our own Indirect Specular Light node's code and our API documentation, which has all sort of relevant information regarding custom node creation.


    Hey there, thank you for letting us know you've sorted this out!

    For other users that might be interested, we do include a Shader Function for fetching lightmap values called FethLightmapValue, which can be double clicked to access its node setup content.
     
  15. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    678
    How can I share a tree of a created shader with someone that doesn't have Unity/Amplify Editor?

    I want him to see all of my nodes but it's a big shader with lots of nodes. Is there a built-in way to share a shader?
    Like a huge quality picture or somethting?
     
  16. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, just to be clear you can share the shader freely, as well as any content created with ASE, as long as the editor is not distributed. The shaders can be still have their shader code manually edited and can be tweaked through the inspector.

    Although we don't have any built-in means of taking a screenshot of the canvas for sharing a node setup, we have considered adding something in the lines of that in the future, but for now you'll have to resort to do it manually, apologies for the inconvenience.
     
    FeastSC2 likes this.
  17. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    83
    Is it possible to create a lit cutout shader? For example using a texture to create round particles (so a billboard/sprite) but that is lit in the scene?

    If its not possible I'll give up and use a mesh, but thought I'd ask.
     
  18. CianNoonan

    CianNoonan

    Joined:
    May 19, 2017
    Posts:
    31
    Does anyone know how to set the reflection cubemap on a material basis? We want to be able to change the cubemap that is reflected in our PBR reflections for each material
     
  19. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! Our Particles Template does not support this, but you could create a Standard Surface shader, using the Lambert or Blinn Phong lighting model for performance considerations, and assign its material to the particle system.

    You'll have to make sure that you set up the nodes correctly and respect Unity's nomenclature though, so the Texture Sample will have to have its property set as _MainTex, for example.


    Hello, you should be able to set it on a per material basis, and we also offer a sample that you can find in the CubemapReflections folder that shows you how to set it up, but please let us know if you have any specific issues regarding this, we'll be happy to help!
     
  20. CianNoonan

    CianNoonan

    Joined:
    May 19, 2017
    Posts:
    31
    Hey Borba,

    That seems to be running it through the EM channel in the example. I would just like to use normal Metallic Smoothness but change what the highlights are rendering. Like changing the skybox but on a per material basis
     
  21. Wawruch2

    Wawruch2

    Joined:
    Oct 6, 2016
    Posts:
    29
    Thank you! Downloading a version from your website solve my problem. Previously I tried an assetstore one.
     
  22. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    678
    How can I change a texture for all of the existing materials of a certain shader in my project?
    I thought about using global but it only works in playmode. For values I can use "constant" of course but for textures this is option is not available.
     
  23. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you for elaborating, upon looking into this a bit further, I believe that the simplest way to achieve what you intend would be by setting a custom cubemap per object through their meshes. I'm not entirely sure on how to achieve this through materials, but this solution should allow for similar flexibility through scripting.

    First you'll set the Type for each Reflection Probe as Custom, and define its cubemap:



    And in the object's mesh, you'll set the Anchor Override parameter to the one Reflection Probe you want to use:



    You won't have to do anything on the shader's side in order for this method to work, simply set up the unique metallic and smoothness values required for each material.
    Please let me know if this helps.


    No problem, thank you for letting us know that the new build fixed the issue you were having!


    Hello, could you please elaborate on this? If you change a material's texture on the inspector or in the ASE Canvas, for example, all objects using that same material will also have their texture changed.
     
    CianNoonan likes this.
  24. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    678
    I don't mean for one material I mean for all materials sharing a single shader.
    Say I have 3 materials with the unit shader.
    If I change the "OnFreeze" texture in one material, the 2 other materials won't share that texture.
    I'm wondering how I can have a way to have a shared textures between all materials of a shader.

    Just like, for example, when I create a constant float variable in the ASE Canvas. That value is shared between all materials using that shader directly.
     
  25. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    121
    How many problems is ASE having with 2019.1.0a13 ? Cause i've been trying to make it work with the latest version of everything and i've got a cascade of errors everywhere.
     
  26. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I see, thank you for elaborating!

    You'll then have to set your Texture Sample to Global rather than Property, and change it via script.


    Hello, I'm afraid that we don't support Unity Beta Releases, but we'll definitely be keeping an eye out for any potential issues as 2019 draws closer to release.

    That being said, I've tested importing the latest ASE build ( v1.6.1r5 ) to a new 2019.1.0a13 project and setting up a simple shader, but no errors or warnings were thrown. If you were attempting to use the LW or HD RP, we only support 3.0.0 for 2018.2 and 4.6.0 for 2018.3 at this time.
     
  27. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    Just to let you know that we've uploaded a new build into our website.
    This build was also uploaded and is already available at the Unity Asset Store.

    Here are the release notes.
    Release Notes v1.6.2 rev 00
    • New Template:
      • Unlit Lightmap
    • New Sample:
      • Unlit With Lightmap
    • Fixes:
      • Fixed issue on 'Depth Fade' node with custom Vertex Positions
      • Fixed issue with using the X,Y,Z,W output ports on 'Object To World' node
    Happy shader creations!
     
  28. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    678
    Right but if I do that then I cannot preview unless in playmode like I said in my first message. What can I do to also have that texture be known at editor time? Global doesn't allow this.
     
  29. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Apologies for not elaborating, Global allows this but you'll need to add [ExecuteInEditMode] to your script in order to see the changes in the editor, for example:

    Code (CSharp):
    1. [ExecuteInEditMode]
    2. public class GlobalTextureSetter : MonoBehaviour
    3. {
    4.     public Texture2D MyGlobalTexture;
    5.     public string GlobalTextureName;
    6.  
    7.     void Update()
    8.     {
    9.         Shader.SetGlobalTexture(GlobalTextureName, MyGlobalTexture);
    10.     }
    11. }
     
    FeastSC2 likes this.
  30. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    377
    While moving from LWRP to HDRP I stumbled upon a difference in ObjectToWorld node. Due to camera relative rendering it now does some additional stuff but throws away w component. Previously I used this node with w=0 when transforming a direction which now get's translation applied too.

    I replaced the parts with a manual multiply by ObjectToWorldMatrix, just wanted to let you know. Maybe you want to fix this or go the other direction and split ObjectToWorld into ObjectToWorldPoint/ObjectToWorldDirection or something. But it should have the same behaviour on all pipelines.
     
  31. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, the Object To World issue should've been fixed in our last build, can you please confirm if you're on the latest ASE release ( v1.6.2 )?

    We really appreciate the feedback but, since we already have the Transform Position and Transform Direction nodes, we don't think that splitting the node would be necessary.

    Edit: Disregard my first statement, the issue that was fixed is unrelated to the one you've reported! We're going to look into this situation as soon as possible.
     
    Last edited: Jan 16, 2019
  32. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    377
    Oh, I'm sorry, wasn't on the latest. Thanks!

    Another issue with HDRP:
    When writing Vertex Normal output the change is not reflected in WorldToTangent/TangentToWorld transforms as the Tangent transform is constructed before the overwrite is assigned.
    EDIT: To be precise ase_worldBitangent is constructed with the original vertex normal
     
  33. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    Thank you for reporting this issue. This is a tricky one but we will definitely take a look on how we can solve it.

    We've uploaded a new build into our website.
    Here are the release notes.
    Release Notes v1.6.2 rev 01
    • New Template:
      • HD Lit
    • New Sample:
      • SRP HD Lit Refraction
    • Improvements:
      • Can add options on template which lets users change its behavior when using it on ASE
      • Added Vertex Position option into Unlit and SRP templates
        • Specified value on Vertex input port can now be either a relative value or an absolute one
      • Passes can now be excluded from final shader through Available Passes menu over SubShader Properties
    This build adds a new feature on which you can add options into the template directly on the template itself. This is an advanced feature which will let you add options to templates into them without having to hardcode them on the ASE source code.

    The new HD Lit template makes heavily use of this new feature.

    We've also updated our Wiki with additional information on how to set your own options on your custom templates.

    Please note that if you are using our HD SRP templates you will need to extract the new ones contained over this build.

    We've also added a new sample, SRP HD Lit Refraction, which makes use of the the HD Lit template, more specifically Refraction, Specular workflow and Iridescence.




    This new feature is still a bit rough around the edges so please report any issues you encounter over this build, more specifically when using the new HD Lit Template, so we can tackle them as soon as possible.

    Happy shader creations!
     
    Last edited: Jan 16, 2019
    petersx, rizu, hopeful and 1 other person like this.
  34. CianNoonan

    CianNoonan

    Joined:
    May 19, 2017
    Posts:
    31
    Cheers, its a shame there's not a cleaner solution to this but it got the Job done.

    In deferred rendering, you must disable "Deferred Rendering Reflections" in the Graphics option for this to work. It still renders in a deferred pass but unless you disable that setting you wont have and reflections
     
  35. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    377
    If you solve it could you add Vertex Tangent output too please. Added it myself but having fewer modifications to your template is better.

    Regarding procedural rendering: Currently it needs additional work or adjusted templates. To streamline this, AttributesMesh (in HDSRPPBR) should be completely empty and a way to write 'input vertex data' would be required. ASE should then only add attributes to AttributesMesh when the attribute was not provided by the graph. Did you have anything planned in this direction?
     
  36. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    474
    Sure, we already this requested registered. Adding a tangent input port to the template is quite easy but it will suffer of the same problems you mentioned over the normal input port.
    But this is quite the tricky problem, like you mentioned as soon as we come out with a solution we can definitely add that additional port.

    Regarding your second point, I do apologize but I'm not quite sure mean as ASE already writes input vertex data over the attributes structure when needed.
    For now our SRP templates will always try to have a similar behavior as Unity's own templates so our AttributesMesh struct will be similar as theirs.
    But, by any means, this does not stops us from creating custom templates in the future.
     
  37. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    377
    To clarify: when using VertexID input to render using DrawMeshIndirect, the other attributes are not provided by the vertex stream and I have custom functionality that provides this data using the vertexID. If the graph would allow to write eg 'Input Position' using this VertexID the position should no longer get fetched using the vertex stream and the Vertex Position node should return the constructed Position thus allowing the same shader functions to be used.
    I could write a template but it is not possible to link eg 'Vertex Position' to the constructed one.
    Basically a sub graph that fills the MeshAttributes struct instead of using semantics to fetch the data automatically.
     
    Amplify_RnD_Rick likes this.
  38. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    377
    Just stumbled upon another related problem: DepthFade uses a screenPos that is calculated before the Vertex Offset is applied. Problem is: all of our geometry is warped.
     
  39. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,322
    Hey amplify team, Sorry if I already asked this before but wanted to confirm if I could create a custom shader using Amplify and share it with others freely and via asset packages?
     
  40. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! You may pass a custom vertex position to the Depth Fade node, so if you're applying an offset to the vertex position you can, for example, pass the vertex output to Absolute ( in the Output node parameters ), calculate the final vertex position and apply it to the depth fade input port as well as to the respective port in the Output node.


    Hey there, no problem! You may do as you please with shaders that you create through ASE as long as you don't share any of the editor files, which are not required for the shaders to be used.

    In short, you may sell them or share them freely within asset packages or by themselves.
     
    Baldinoboy likes this.
  41. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    151
    Hi, do you have 16x16 bayer dithering matrix?

    Also, do you have any example for foliage shader which support wind and touch bending using Amplify?
     
  42. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,322
    Great! Thank you @Amplify_Borba
     
  43. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, our Dither node only provides 4x4 and 8x8 at the moment, together with noise textures, but we're hoping to add more patterns in the future.



    Regarding your other question, inside the SimpleTerrain sample you can unpack the 'ApplyGrassWindToTerrain.unitypackage' to replace the SimpleTerrain asset with an alternate version that contains custom shaded grass set up as a tree prefab, so that it can use a material with a custom ASE shader that can also be affected by Unity's Wind Zones.

    We've added the grass for this sample as a tree prefab since the alternative would be to override the grass shader, which we don't recommend due to the lack of flexibility and also since, in our case, it could override users' custom grass.

    There's also the VertexNormalReconstruction sample, which provides a custom solution for manipulating the vertices of a mesh.


    No problem!
     
  44. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    376
    Is there a foliage shader available for amplify editor?
     
  45. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, we don't have a specific shader / sample for foliage at this time, but please refer to our SimpleTerrain as mentioned in my previous post, where we setup grass as a tree prefab for Unity's Terrain in order to use its Wind Zones.
     
    Crossway likes this.
  46. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,210
    I would imagine all you need is 2 sided rendering, perhaps with faked or real transmission, and vertex deformation in the form of rippling for wind. Should be able to create that using amplify very easily.

    I recommend using perhaps vertex color for masking areas for wind to affect if its a complex plant with many different parts

    EDIT: this was meant as a reply to the user rather than @Amplify_Borba
     
    wetcircuit likes this.
  47. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for pitching in, those are pretty valid suggestions!
     
    GameDevCouple_I likes this.
  48. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,210
    No problem, I dont show up here often but amplify is one of my favourite purchases, and in my opinion supports SRPs better than shadergraph itself. I am sure you will see me pop up here more and more now that I have a major project going on that requires lots of fancy shaders :)
     
    Amplify_Borba likes this.
  49. Royall

    Royall

    Joined:
    Jun 15, 2013
    Posts:
    114
    Where can I find an example of using the new "Orientation Based Sprite" node? Camera angle doesn't seem to affect it?
     
  50. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    280
    Hey there !
    I don't understand what does the HD Lit template add in terms of features. You already had a template for the HDRP right? What's the difference? Can you use it on legacy render?
    Thanks !