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

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    XD XD XD Just I've updated the original post with the fixed file before read your post.
    Thanks!
     
  2. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Eheh no worries! :D
     
    benderete likes this.
  3. TheAlmightyPixel

    TheAlmightyPixel

    Joined:
    Jun 21, 2014
    Posts:
    263
    Awesome, thanks!

    Your node definitely helps. It allows the rain to run in edit mode and without any extra code on my end, which is fantastic. I'm actually in the process of optimizing my rain shader and incorporating your node into it ;)
     
    benderete likes this.
  4. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Hi guys,

    Has promised, I've just uploaded a new built into our Download area.

    Here are the release notes.

    Release Notes v0.2.0 dev 002
    • Improved duplicate code detection system
    • Slight improvement on save/update times ( important for Live Mode )
    • Fixed issue with 'Texture Sample' node incorrectly outputting a float4 when no texture assigned and on Normal mode
    • Fixed issue on not opening the correct shader from a material inspector if a new one is selected from its dropdown
    • Fixed issue with 'Length' node incorrectly changing its output type
    • Community Node additions
      • The Four Headed Cat
        • Flipbook UV Animation
    Hope everything runs smoothly on your end and happy shader creations!
     
  5. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    I was looking at some custom node code that has been posted and think it's an amazing feature to be able to extent the plugin this way, but I also noticed that shader types (float2, float3, etc) are hard-coded.

    I wonder if it makes sense, that a node features a "precision" drop-down field (low, medium, high), to allow an ASE user to specify on what precision a certain node should operate, which is useful for mobile devices.

    The custom node C# base-class could provide something like a "GetPreferredPrecision" method, that would return "fixed", "half" or "float", which should then be used in the custom node C# code to construct the shader variables with the corresponding precision.

    Using low and medium precision is still popular in mobile development to improve performance and decrease battery consumption.
     
  6. TheAlmightyPixel

    TheAlmightyPixel

    Joined:
    Jun 21, 2014
    Posts:
    263
    Thought I'd chime in with a feature request.

    Would it be possible to get some sort of Reroute nodes? Something similar to what UE currently has:


    Also, is the 10 texture interpolator limit something that can't be bypassed? It's not a huge issue, but I do feel like it may prevent the creation of very complex shaders.
     
    benderete likes this.
  7. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @Amplify_RnD_Rick
    Request, Tabbed windows for the shader editor. This also can be usefull when Material Function are added into ASE :)
     
  8. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Yes it makes perfect sense. We are already planing on soon adding this, and also choose precision per local variable manually registered through 'Register Local Var' node.

    :D Great request, this will come in handy.
    Concerning the interpolator limit there is not much we can do about it. When moving to custom shaders you will have more control on how they are used but there will always be a limit.

    Oh so many times yes! This is such a major feature we want to implement since it will open the possibilities to many cool features!
     
    Last edited: Oct 13, 2016
    Reanimate_L likes this.
  9. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Hi.
    A quick question, is there a way to make mask clip value visible in material inspector?



    Thanks
     
  10. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Hey Maverick,

    You raised a pretty good point. Unfortunately it is always written as a constant, but we'll add it as a property on our next update so it can also be accessed it from the material inspector as you requested.

    EDIT: Since your request was quick to implement we decided to add it right away so it won't be a road block on your work.
    I've just uploaded a new version with it. When updating the shader with this new version you should now see a 'Mask Clip Value' property on your material inspector.
     
    Last edited: Oct 13, 2016
    benderete and Peter77 like this.
  11. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389


    SUBMIT YOUR CONTENT!

    Use our submission form to submit your own content. Nodes, Shaders or even Editor extensions, we encourage you to share your creations with the growing ASE community. In addition to this thread and our own Sample Page, we will feature the latest notable samples in the ASE Asset Store page.
     
    benderete likes this.
  12. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Rescuing this from first page, with outline i understand the typical outline of cell-shading and similar.
    I vote for this suggestion too. But or I am wrong or it must wait until multipass support.

     
    hopeful likes this.
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    I think it does need multipass, but I'm nearly a total novice.

     
    benderete likes this.
  14. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We released a new build today fixing several issues from people upgrading from our early v0.1.0 dev 001 to the current version and prevent the need of deleting the older version and re-importing all over again.

    We apologize for not releasing this earlier.

    EDIT: Some files were deleted and others were renamed between versions. Unfortunately Unity package importer doesn't remove deleted files and also doesn't update names on renamed assets when importing a new package.
     
    Last edited: Oct 14, 2016
  15. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Is there any skin shader available for this asset?
     
  16. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @Amplify_RnD_Rick
    I'm getting Undefined variable using get set local var and vertex color on frag
    upload_2016-10-14_21-37-6.png
     
  17. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Hi Crossway. Kebrus, one of our community members is currently working on skin shader sample.
    Keep an eye at this thread and he should post it as soon as he has it done.

    Hey rea. I tried to replicate your issue but with no success. The 'Get Value Var' is connected to which nodes/ports?
     
    Crossway likes this.
  18. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    I mean can we create a deferred SSS skin shader with Amplify Shader?
     
  19. UltronTM

    UltronTM

    Joined:
    Dec 26, 2014
    Posts:
    78
    How can I make a "do not draw" shader that masks/culls pink colored pixels? I would need this for my game's level design to be able to view through the ceiling. I use VoxelImporter and MagicaVoxel, and I don't want to make a separated ceiling that is simply disabled during edit time.

    I thought it would be a smarter choice to color the top voxels with pink (255 0 255), and use a don't draw shader to mask/cull those colored pixels of the exported mesh model during edit time.

    I guess I would use "Blend Mode Masked" for this!? However, there is no "if" node (yes I'm a noob. this is not how it's done). So I can't check for the color code pink, 255 0 255, and then mask/cull it out. Any idea how to do this?
     
  20. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Actually, there is If node and other logical operators (equal, not equal, greater than, lower than).
    Have you downloaded the last release from Amplify web page?
    http://amplify.pt/download/

    In fact, i think that the logical operators are included on the actual asset store version (beta 2).
     
    Last edited: Oct 14, 2016
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Multiply node.
    I found the problem, i have to set the order index for the register local var lower due the code result are like this
    Code (csharp):
    1.  
    2.       float4 FLOATToFLOAT4240=RedSplat;
    3.        float4 FLOATToFLOAT4250=4.0;
    4.        float4 FLOATToFLOAT4320=( RedSplat * 2.0 );
    5.        float RedSplat = input.vertexColor.r;
    6.  
     
  22. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Hey there.

    I've been trying doing stuff with custom lighting models and one of things that are important for many effects to work is changing vectors according to normals, tangents, etc. So I decided to create a new node that takes 3 or 4 vectors to create a matrix since those effects usually need a matrix.

    This doesn't allow you to create custom lighting models just yet, but it's one step closer :p

    newnode.PNG
     

    Attached Files:

    benderete likes this.
  23. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    A fully functional SSS skin shader is not possible to do for now at ASE. Kebrus already gave us some feedback about some roadblocks he encountered are we already registered them on our roadmap so we could implement them on a future update.


    A simple quick solution is to follow benderete suggestion. We will also make color masking available on a future update.

    Yes, I admit order index is not intuitive at first. We will maybe rethink on it and make it also possible to be auto-generated.

    EDIT: A fast solution to color masking ( not very robust ):
    upload_2016-10-14_18-14-29.png
     
    Last edited: Oct 14, 2016
    Crossway likes this.
  24. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    i see yes to be honest it's kinda tedious to reordering index all the time, if it can be automated that would be great.
    also the property index might need to be revamped by using some kind of reorderable list in master node property panel
     
  25. UltronTM

    UltronTM

    Joined:
    Dec 26, 2014
    Posts:
    78
    Yes you are right. I was on Beta 1. It's just weird that I looked for the orange update button today a few hours ago before I imported this extension, but there was only the blue download button.
     
  26. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Check this forum or Amplify website often, because devs launch several updates per week for customers.
     
  27. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Finally i can make the HeightMap Texture Splatting node working

    Hmm it seems IMG tag are not working, here's the link incase people wondering how it works
    http://imgur.com/uQmMJFW
    HeightMapBlendNode.jpg
     

    Attached Files:

    Last edited: Oct 15, 2016
    benderete likes this.
  28. ZaZy

    ZaZy

    Joined:
    Jan 14, 2015
    Posts:
    20
    Hi Amplify Team,

    I'm trying to use ASE to create a cubemap reflection shader using Blinn Phong for specular highlights, but the specular highlighting doesn't work at all without manual hacks to the generated shader.

    The reason for this is the unusual way Unity have implemented Blinn Phong in lighting.cginc. The code there references a variable in UnityLightingCommon.cginc called _SpecColor which doesn't have a default value defined so appears to default to black. The way that Unity has used Blinn Phong for their legacy Specular shader (i.e Normal-Glossy.shader) is to define a property like so:

    Code (shader):
    1. Properties {
    2. _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
    3. }
    The variable is never used in the CgProgram code and appears to function like a pass-through property to the variable defined in the common cginc file.

    So I have created the following shader in ASE to replicate the functionality of the legacy specular shader:

    upload_2016-10-15_21-27-38.png

    And everything in the generated shader file matches except for _SpecColor, which is not generated by ASE as it is not connected to anything (and cannot be or a variable with the same name will be created in the CgProgram code and cause a compile error). Without that property the specular lighting is not visible (only the GI contribution is).

    Any chance you could automatically add a property definition for _SpecColor (but not a variable definition within CgProgram) whenever Blinn Phong is selected as the light model ? An appropriate default value would be (1, 1, 1, 1) to ensure specular is controlled via the specular channel by default (see post by kebrus)
     
    Last edited: Oct 17, 2016
  29. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @Amplify_RnD_Rick
    Another request
    This one for the CustomNode API
    - Hide Flag for default input value from property panel for inputPort ParentNode Class, just like the dynamic node class where they doesn't have any default value shown in the property panel ie LerpNode.
    Basically another Bool true/false option to define default value are visible or not something like HideinInspector flag
    - Warning popup message (with configurable message) when people are connecting a node into an InputPort and the WirePortDataType doesn't match, this can help people to avoid getting shader error when compiling.
     
  30. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Hey! I'm not sure if the guys at Unity made the absence of the term on purpose. The results don't seem correct to me, but I could be wrong.

    Anyway, it's seems to be an easy fix. For now here's a temporary fix until Amplify gets a better solution:
    1. Search and edit the file "StandardSurface.cs"
    2. Ctrl+F to find for the line that says
    Code (csharp):
    1. UIUtils.CurrentDataCollector.CloseInputs();
    3. Copy and paste the following code BEFORE the searched line.
    Code (csharp):
    1.             if(m_currentLightModel==StandardShaderLightModel.BlinnPhong)
    2.                 UIUtils.CurrentDataCollector.AddToProperties(-1,"_SpecColor(\"SpecularColor\",Color)=(1,1,1,1)",-1);
     
    Last edited: Oct 15, 2016
    ZaZy likes this.
  31. ZaZy

    ZaZy

    Joined:
    Jan 14, 2015
    Posts:
    20
    @kebrus Thanks !! That works well, I had a peek at the code yesterday to attempt the same thing but didn't appreciate how complex a node based shader editor is o_O

    If Amplify are happy to go with something like this then I suggest the index is hard-coded as 0.

    Do you mean the results of the specular highlights ? The default specular color for the 'Legacy Shaders/Specular' shader ,i.e Normal-Glossy.shader, is (0.5, 0.5, 0.5, 1) so that could be why you are seeing a difference if using white instead. I also saw a note in the lighting.cginc that highlights can become too bright on some GLES2.0 platforms (iOS) due to precision issues.

    Otherwise I got an exact match with the attached ASE shader to the legacy specular. Let me know if you can see any issues with it.

    Edit: I should have mentioned that the unity shader code I refer to is 5.4.0 but the build I tested in was 5.4.1p4
     

    Attached Files:

    Last edited: Oct 16, 2016
  32. ZaZy

    ZaZy

    Joined:
    Jan 14, 2015
    Posts:
    20
    Amplify Team,

    I have a couple of other requests/suggestions based on my testing so far:
    • _SpecColor for Blinn Phong as per kebrus code
      • EDIT: Unity Legacy Specular defaults to (0.5, 0.5, 0.5, 1) but a more appropriate value would be (1, 1, 1, 1) to ensure specular is controlled via the specular channel by default (see post by kebrus)
    • Add 'SimpleSpecular' example to show how to implement supported Blinn Phong channels (at least albedo, specular and glossy) along the lines of my attached shader in post above. The normal and opacity channels are optional as they are not required to produce the specular highlights.
    • Support for master (surface) node optional parameters like noambient and interpolateview (all documented here) for optimisation purposes
      • EDIT: + support for #pragma targets below 3.0 (i.e 2.0) for mobile optimisation
    Thanks and keep up the good work !
     
    Last edited: Oct 17, 2016
  33. DaOndare

    DaOndare

    Joined:
    Aug 7, 2013
    Posts:
    2
    @rea can you maybe share some of of that heightmap blending goodness? What is your setup and how does it work.
    also what are you using to paint the splatmaps.

    cheers and thanks :)
     
  34. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    What I mean is that I tried messing around with the value and the results were weird, it's like they weren't properly tinting the specular reflection, I even put others specular shaders side by side and these seemed off, thats why I think it might be on purpose.

    I actually disagree about the default being 0.5 because the amount of specular is controlled by the specular output from the shader which means that by default the highest value should be produced by changing the specular term without ever touching the specColor. By thats just my opinion anyway.
     
  35. ZaZy

    ZaZy

    Joined:
    Jan 14, 2015
    Posts:
    20
    Good point ! I have edited my earlier post to suggest (1, 1, 1, 1) as the default

    Ah I see, I actually only use pure white (I always change it from the default) so I never noticed any tint issues. Hopefully once ASE supports custom lighting we can roll our own replacement.
     
  36. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Simple experiment with shader: hatching an image


     
    hopeful and kebrus like this.
  37. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Hi guys,

    Hope you all had an awesome weekend.

    Concerning Blinn Phong, for now we will add the additional _SpecColor property but in the future we will discard Unity Blinn Phong implementation and do our own since there are certain aspects we don't quite agree on it.


    Eheh didn't expect you guys would be scavenging on this one. This section is still very wip but yes I will surely take your suggestions into account.

    We need to really to give a bit more thought on Blinn Phong model on Surface shaders. This will be a bit irrelevant when we will give the ability to build your custom light models.
    Changing between Shader Model 2 and 3 is a great and easy addition. Expect this soon on a future update.

    It's great to see another awesome shader from you! Really cool effect!

    Today we won't be uploading a new build but expect one tomorrow!
     
    Last edited: Oct 17, 2016
    benderete likes this.
  38. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Amplify Shader Editor Tutorial - Animated Fire Shader Example [Recorded with BETA 1]


    Amplify Shader Editor - Asset Store Page
     
  39. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    From the shader of my last post I made a Post-process Camera Effect (sorry for the bad frame rate, but I It's captured with software and the laptop try its best):



    I can't wait for Post-process implementation on ASE XD
     
  40. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Another Post-process Camera Effect based on previous shader created with Amplify Shader Editor: Pixelation



    On both cases the process have been basically to "convert" the surf program to frag program and write a simple script to make a Graphic.Blit with the shader in the OnRenderImage function.
     
    Amplify_RnD_Rick likes this.
  41. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Here's the simple setup,
    upload_2016-10-18_15-34-24.png

    For the vertex painting you can use this tool https://github.com/slipster216/VertexPaint
     
    benderete likes this.
  42. ZaZy

    ZaZy

    Joined:
    Jan 14, 2015
    Posts:
    20
    @Amplify_RnD_Rick Yes custom light models will be a better solution, thanks!

    I also wanted to ask whether you are considering support for the recent shader_feature pragmas for toggling the specular highlights and glossy reflections of the standard shaders ? My testing indicates that that Unity will not generate the Pass variants to handle these keywords unless the pragma directives are added to the CgProgram code of the surface subshader.
     
  43. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Hi.

    Is there a way to use a texture sample in conjunction with 2 different uv coord? I mean suppose we have these lines of code in a shader:

    Code (csharp):
    1.  
    2. float4 val1 = tex2D( _TextureSample1, input.uv_TextureSample1);
    3. float4 val2 = tex2D( _TextureSample1, input.uv_TextureSample1 * some_const);
    4.  
    How can I achieve it in the editor? Currently the only way I found was to use another texture sample with same texture.

    Thanks
     
  44. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Hey, you can do that by putting two texture samples and marking the second one as an instance of the first. Check the node property panel.
     
  45. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Hi guys

    We've just uploaded a new build into the download area.

    Release Notes v0.2.2 dev 001:

    • Fixed issue with 'Mask Clip Value' not being correctly synced between material and shader
    • Added colored Debug Mode ... this is an experimental feature where each port and wire are colored according to its data type. Each color/type pair are not final
      • Hold 'P' key to enable debug mode and release it to disable it
      • Double hit 'P' key to toggle debug mode on. Double hit 'P' key again to disable it.
    • Added 'Matrix From Vectors' node
    • Fixed issue with 'Vertex Binormal World' node
    • Added 'Shader Model' dropdown on Master Node properties
    • Community Node additions
      • The Four Headed Cat
        • Fixed issues with 'Logical Operator' nodes
    We didn't have this registered on our roadmap but will surely add it to our Community Suggestions.


    Happy shader creations!
     
    benderete likes this.
  46. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Featured Sample - Dissolve Burn FX



    A great example of how to create a dissolve effect, fully animated and customizable. Created by benderete, follow him @fourheadedcat Included in the ASE package.
     
  47. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    About this effect, here go the files (attached):

    Pixelated.shader --> The shader to pixelate a texture, done with ASE.
    PixelatedEffect.shader --> The post processing shader based on the previous shader.
    PixelatedEffect.cs --> The script to do the effect (drop it on the camera or with the camera selected go to menu "Component --> Image Effects --> The Four Headed Cat --> Pixelated Effect"

    Feel free of use, improve, fix, etc...

    Note that I'm new on this, and post processing effect shader and script can have some error or need performance improvements.
     

    Attached Files:

    victorkin11 likes this.
  48. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    @Amplify_RnD_Rick : The nodes [Ext]Add (AddOpNode.cs), [Ext]Subtract (SubtractOpNode.cs), etc, should work or they are WIP about Multi line add/subtract/divide/multiply ops?
     
  49. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Custom node: Constant Tau (2 * PI)

    Yes, not very exciting ;)
     

    Attached Files:

  50. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Custom node: Relay

    This node Output its Input without any modification. Only for best diagram organization (similar to Relay from Shader Forge or similar to Renode from UE4 Material Editor).
     

    Attached Files: