Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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. SPIKY

    SPIKY

    Joined:
    Dec 19, 2008
    Posts:
    57
    I just bought ASE to test the included Toon Shaders, but they appear black on my MacBook Pro 2017 with macOS Sierra. Is this a known issue?

    I tried the included demo-scene, so settings should be correct.
     
  2. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Hey,

    I took another look once I saw you said it SHOULD work, and tried it with different height maps. I cleaned up some of the node structure (ie: that encoding node wasn't needed ... I don't even know what it does) since step a was figure out how to make it work, step b was figure out figure out what I didn't do right. I think I just took care of step b, since I have my tessellated, displaced terrain now working with 4 additional textures, each corresponding to splat 0-3, where r=metallic, g=ao, b=heightmap, a=roughness. So far so good :).

    You guys put together a really amazing tool. I cannot believe how many doors this opened up for me. I've wanted to do shader stuff for years but never sunk in the time ... with this, I managed to see one example and work out how to get stuff going. It probably helps that I've put time into Substance Designer and other node based tools ... but in terms of shaders, I'm an absolute noob.

    How would we add additional passes for more than 4 splats?

    Please make sure you get 2018 HD working asap ... I really don't want to have any reason to ever use anything else!
     
  3. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Here's the terrain shader I have so far. Does anyone know how to implement height blending? Also, if there are any other errors ... sorry. This is purely a learning experiment right now.


    [Ignore the Albedo/AO ... the alpha of the albedo is not used for AO anymore]
     

    Attached Files:

    blitzvb likes this.
  4. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Yep same here.I am really wondering how to do height blending between each splats.
     
  5. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    958
    Hi,

    I am creating my own template for use in Amplify Shader Editor, and run into a problem: what do I need to add to enable the "Depth" GUI?

    I don't see any special tag for it, and I have added ZWrite, ZTest, Offset keywords. Not sure what else do I need for ASE to allow editing these values in editor UI.

    (My template is based on the built-in Unlit template)

    Thx!
     
  6. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Are there any tutorials for terrain stuff? Yet another question: how do we use tri-planar with terrain? I assume that's what we use to get rid of the texture stretching when we extrude up at a steep angle?
     
    blitzvb likes this.
  7. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    There is this asset that include a ASE tri plannar :

    https://www.assetstore.unity3d.com/en/#!/content/106862
     
  8. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    I'm more confused that there is an included triplanar sampler, but the ASE triplanar demo scene doesn't use this. Is there anyway to use the built in node for terrain, or is that the wrong direction?
     
    Last edited: Jan 23, 2018
  9. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    I'll need to look into because you are supposed to be able to set the alpha mask of the outline. But keep in mind that the outline is done by rendering the backfaces, these faces have different UVs and thus will dissolve differently as well. Which means that even if you set it correctly there's no guarantee the dissolve will happen exactly like you see in the front of the model.

    Can you confirm if all of them have issues or just one or another? There are all supposed to work out of the box. There are some issues with the shader model on mac so you cannot select shader model 5 but none of our samples are compile in that version. Thx for reporting.

    2018 basic support is already in place. what we lack is support for the two new rendering pipelines, these should come in a few weeks or so.

    Regarding the splats, have you tried using a texture array? Aside from the common double pass solution which should also come soon since we are nor working on multipasses texture arrays might be the solution you are looking for. We have a small tool to help you create those since unity doesn't provide one. (window>amplify shader editor>texture array creator)

    For blending you can try some of ours, just type "blend" in the node search and check their respective documentation.

    Thx for the kind words ;)

    We do have a community node that does it but it might not fit your needs. The issue here is that there are multiple ways of doing it. In theory height blending is simply a matter of doing a linear interpolation (lerp node) in which the interpolation value is another texture height value transformed in some fashion. This transformation can be done in many different ways, you could use a power or a multiply node to change the falloff or simply add an offset with an add node.

    Here's a somewhat simple example using only albedos and normals and the smoothstep node: Unity_2018-01-23_18-07-05.png

    You need to add their respective codes, like this:
    Code (CSharp):
    1.         ZWrite On
    2.         ZTest LEqual
     
    blitzvb likes this.
  10. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    We don't have a tutorial for terrain, at least not yet :| what difficulties are you having? Did you saw the two samples we provide?

    The triplanar node is a simplified way of creating the triplanar effect, it doesn't cover all cases, and thats where the triplanar sample comes in. It's simply an example on how you could create a triplanar effect just using nodes. That sample isn't updated tho, it needs a normal correction. It's on my todo list but it's on low priority :p
     
  11. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    I may just be missing something simple. I'm not sure how to integrate it with the terrain splatmap stuff.
     
  12. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    Just to let you guys know that we've uploaded a new build into our website.

    Here are the release notes.

    Release Notes v1.4.3 dev 01:

    • New Samples:
      • Orientation Based Sprite
      • UI Sprite FX
    • New Shader Function:
      • Box Mask
      • UI-Sprite Effect Layer
    • Fixes:
      • Fixed issue on attempting to deactivate destroyed nodes
    • Improvements:
      • Updated Sprite and UI templates to better support normal maps
      • Changed way logic is updated in some nodes to be more consistent and work inside shader functions
    We've added two new samples into the package.

    Here's a sneak peek on the UI Sprite FX sample:



    The new UI Sprite Fx sample is just an example on how the new UI-Sprite Effect Layer shader function node might be used.

    It's power comes from the the fact it uses various function switches that allow you to pick and choose different options at compile time.

    Maybe other effects can be added later and suggestions are always welcome. If you feel something is missing or you are having troubles using it please let us know and we'll update it.

    We also decided to go old-school and create the Orientation Based Sprite sample. Here's a glimpse on what you can do with it.



    The Doom sprite sheets are not included on the package but they are freely available online.

    We hope you guys like these new samples.

    Happy shader creations!
     
    Last edited: Jan 23, 2018
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,442
    It makes me happy to see ASE growing day by day... the sprite doom example is a nice throwback and would be nice for faraway objects.

    I'm hoping we can get a feature that will allow Sub-Graphs or packing a selection of nodes into a shader function
     
  14. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Wow! So if generate a sprite from a 3D model I should be able to use it as an imposter like technic?

    Interesting. Where is this example?
     
    Last edited: Jan 24, 2018
  15. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    Hi Amplify creators.

    I have some legal questions, Can I share the Generated Shader code of a Graph made with Amplify Shader with someone who doesn't own an Amplify Shader license?... just share the Shader file, not the plugin itself.

    And another question, If I'm codign a shader from scratch, and I take a look at the generated code for one graph made with Amplify Shader, and something from there is useful for me, can I grab the piece of code and replicate it in my own shader?
     
  16. Igualop

    Igualop

    Joined:
    Mar 1, 2017
    Posts:
    30
    Hey guys, I think the both "Particle Alpha Blend" and "Sprites-Default" templates are missing the "ASETemplateShaders" suffix. Just noticed they are outside the respective shader sub-menu.
     
  17. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    I know Octane said they will be opening up their shader language soon. Any plans on integrating with that? It would be _amazing_ to be able to use this for Octane stills as well.

    In the mean time, I'm about to see if I can get this working with Octane as is right now. I'm really hoping the terrain works!
     
  18. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Forgot about the fact that Octane ignores Unity shaders and just looks for specific textures on the material. So for now -- no, I can't do nifty things in Octane with this :(.

    PS: Sorry if I'm spamming your forums. Just in love with this product right now and trying to use it for everything :p.
     
    Last edited: Jan 24, 2018
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,442
    Hey, guys. Still developing my hair shader, adding strand variations to make the style look natural, especially with multiple colours.The grey coloured version is just the base specular turned to .35. The base layer will have no specular. I want to reserve that for the two specular layers (similar to Alloy) Screenshot 2018-01-23 21.23.35.png Screenshot 2018-01-23 21.21.10.png Screenshot 2018-01-23 21.20.24.png
     
  20. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    958
  21. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    I have to say, that looks awesome. The hair is a texture with opacity I assume? Are you selling that eventually? Very curious to see what you did.

    Just asking, because if its not, any idea if its possible to create a beard like that which follows blendshapes? Daz3d has infuriated me with their great models whose beards don't follow the mouth in Unity. Just curious if that could be solved through shaders :).
     
    KRGraphics likes this.
  22. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Yeah I guess you could use it like that. Similar to what the speedtree shaders do for billboards.

    There's no example on that node, but maybe I can try a different approach. Like I said before height map blending is not an exact science, everyone can have their own way of doing it. But I also understand that sometimes having a simple default is just easier to understand.

    How about this?:
    2018-01-24_11-53-55.png

    Is it more clear and easy like this? It uses a simple shader function. Maybe this way is more intuitive how to blend using a heightmap. Shader function in attachment.

    Yes, you can even sell that shader that you created through the editor regardless of what you do with the file and code generated. You own that shader, do as you please :)

    Good catch, thx ;)

    We never discussed that particular one. Might be a good extra mile but besides that I don't have an answer for you :| I guess its something we need to discuss first.

    Uhm thats strange, I just tried it here and it worked, thx for the code. Maybe there's something there I'm missing. I'll look into it for sure.
     

    Attached Files:

    daville likes this.
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,442
    I'm thinking of selling my shader suite once I finish everything and hope it's performant. And yes, the hair is opacity maps set to alpha test at the moment. It doesn't cast shadows and there is no multipass rendering on it. And also I will need help setting up the Marschner shading model and the two specular layers on it. I've already have the building blocks for it. Just need to be able to use a texture that will allow me to shift the highlights and add back scattering.

    As for beards, I'm using a joint rig in my faces for animation. You would have to model the beard to match the blendshapes you animate, which is no simple task.

    And when I sell my shaders, pricing will be fair. :) Just need skin shaders in my suite as well (I'm IMPATIENTLY looking forward to that) and shaders for things like foliage and weather based shading. (Water is another shader I need)
     
    DGordon likes this.
  24. TheTalkingBoot

    TheTalkingBoot

    Joined:
    Nov 24, 2017
    Posts:
    36
    I found the solution for the lighting problem!

    The solution was to recreate the Blinn Phong effect manually to keep only what interests us, then to separate the light thanks to the node "World Space Light Pos".

     
  25. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Hello,

    I think I found a bug.
    I have a Color node, with the HDR tag.
    When it's a property, everything works fine.
    When I switch it back to Constant and make sure I have the correct HDR value set, it seems to only output a LDR color...

    Thanks
     
  26. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    That is not necessarily a bug, we are aware of it and apparently Unity is as well since they changed their color picker in 2018 to account for this.

    Whats truly happening is that they are ignoring the HDR tag in terms of it's appearance and color space, what I mean is, the color picker does shows up with the proper HDR settings but the color it shows and sends to the shader is always a Gamma space value instead of linear one. I have no idea why they did this since this has been causing confusion to a lot of people because when you set it as a constant the value is set inside the shader directly so it's always a linear value while by using the color picker it assumes to be a sRGB value. This is fine because we deal with color in sRGB but it shouldn't be the case when you are specifically saying that it is a HDR color. In 2018 this is "fixed" so when you set the color picker to be an HDR value they show and send the linear value and not the gamma one.

    Sorry for the confusion but it's one of those cases where it was Unity being weird for some/no reason.
     
  27. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    So no fix until 2018 ?...
    Cause I want to set the color directly in the shader, don't want artist to change it.
    Only way I think, is to set it as global, but I would need script to change it...
     
  28. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    645
    Sure, that makes sense.

    We do a lot of still renders for adventure games, and if we had the ability to customize octane as easily as this is making the standard shader, it would throw open doors for us, enough that we would possibly switch to rendering in Unity. I don't know how big the Octane pre-rendered crowd really is, but I assume most of them would find it very useful to have an easy way to customize that stuff in-engine.
     
  29. Polygoat

    Polygoat

    Joined:
    Aug 29, 2015
    Posts:
    10
    CustomLightingToon is working fine, CustomOutlineToon is rendering blacks.
     
    Amplify_Paulo likes this.
  30. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Maybe I didn't explain it right, the issue is an interface one, not code or shader calculation. In order for you to pick the best solution for your case let me try explain the problem again.

    Let's assume the color I'm working on is the middle grey (0.5, 0.5, 0.5). If you create a property node and set it as a property you'll be able to use the color picker both in the editor as well as the material inspector. There you select the aforementioned grey color by setting the sliders to the 127 or 128 value. If you check the node header it will read (0.5, 0.5, 0.5) so everything with the value is okay, both the "outside" representation and the "inside" value are the same in their respective linear-rgb counterparts. So far so good.

    Now if you change the node to be a constant value it will still read (0.5, 0.5, 0.5) in the header since that was the color you wanted. The thing is, shaders do regular mathematical operations, they don't care whether or not the values are in linear or gamma space so Unity does conversions depending on whether or not you set your project in gamma space. So now, when you save that color as a constant the (0.5, 0.5, 0.5) value will be used internally but because you have your project in linear space unity will NOT do any conversion so the true representation of the middle grey is actually a value must lighter that you are used to. BUT unity will still show up in the color picker the middle grey that you want. THIS is the issue I was talking about, unity shows you the incorrect color in the color picker and inspector fooling you into thinking you are selecting one sRGB color when in reality you are selecting it's linear value which is not the same color.

    The problem becomes even worse because unity actually has a HDR attribute that allows you to pick the color in linear space. So now if you set the HDR attribute both the editor color picker and the material inspector color picker allow you to select an HDR color, now each component should read 0.5 (or an approximate value). The issue here is that in pre-2018 versions this color will still show up as the sRGB equivalent instead of it's linear space color. They changed/fixed this in 2018.

    In your case you can get correct color by calculating it's linear equivalent. You can use something like this link here to convert it manually. You can also convert in the shader using the gamma to linear node but I don't recommend it since it's extra unnecessary calculations. In 2018 you could use the picker itself to pick the correct value :\

    I hope it makes a little by more sense now.
     
    JohnnyFactor likes this.
  31. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    Hallo,

    don't know if this was answered already, but often, when I try to get the MainTex in a shader, I get the error "_MainTex already exists", but I don't see it anywhere in my shader, and there is no way to reference it or recreate it. Am I doing something wrong, or is there a way to get the MainTex just like that?
     
  32. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Are you using templates? Templates usually have that MainTex by default so maybe that's why. You can use it however, by adding the template parameter node and selecting it. If you are not using a template are you perhaps using a shader function that uses one of those?
     
    Last edited: Jan 25, 2018
  33. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    Thanks, it was indeed a template.
     
    Amplify_Paulo likes this.
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,442
    Hey, Guys... I need some serious help here... I am trying to update my glass shader so that I can have coloured glass, and also have the light go through the glass to create a stained glass feel (such as coloured transparent shadows), but I am stuck at this point. Any suggestions?

    upload_2018-1-25_12-38-44.png upload_2018-1-25_12-39-6.png
     
  35. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    The refraction output port takes into account opacity, the idea being that a fully opaque surface cannot be refractive (because light doesn't pass it through) while a fully transparent surface cannot has colors because all light goes through it. So in order to tint your glass you need to increase the opacity. This is not fully physically correct because in real life you would be able to select the frequencies of light that pass through and the ones that don't but here you can only define one component as opacity.
     
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,442
    I may have to make this glass non PBR for this to work. No problem is this case. Or actually, I can just clamp the opacity to something like .5, which works here...

    upload_2018-1-25_13-17-35.png
     
  37. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Then a different setup is needed because that refraction port is kinda like a template for custom lighting, basically you need to redo the logic using nodes in custom lighting. I don't have much time now but I can create an example tomorrow morning if you are having troubles with it.
     
  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,442
    That will be great. I am trying to recreate the glass shader from Alloy, which had great looking glass. And I just tried to go the custom lighting route and refraction is disabled
     
  39. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    348
    I often get errors like this when playing my project in the editor, what could be the reason?

    error_amplify.jpg
     
  40. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    Just to let you know that we've uploaded a new build into our website.

    Here are the release notes:
    Release Notes v1.4.3 dev 02:
    • Improvements:
      • Shader tags can now be modified on templates based shaders
      • Added new Particle Additive option on Blend RGB and Blend Alpha dropdown
        • Sets Source to 'Source Alpha' and Destination to 'One'
      • Added new options to 'Shade Vertex Lights' node
        • Can now select amount of lights to take into account and if as spot or point light
    • Fixes:
      • Fixed issue on incorrectly indented code generated by some nodes on template shaders

    Thanks for reporting the issue. We'll take a look at what might be causing it and provide a fix on our next build.

    Hope you guys have the coolest weekend and happy shader creations!
     
    KRGraphics and ratking like this.
  41. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    481
    Hello,

    We talked about KeywordEnums some time ago, any progress on that?. I think the Function Switch node is almost there in term of UI, maybe it would be easy to implement from there. Just saying :p

    I started working on a new update for Polyverse Water and for reflection I want to have planar reflection, cubemap, box projected cubemap, custom cubemap..., so it would be nice to select them from a dropdown list instead of checkboxes.

    Here is a small work in progress shot :D

    ezgif.com-optimize.gif

    Thanks !
     
    blitzvb, benderete and KRGraphics like this.
  42. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    No progress for now :(
    Some other features got the priority now like multipass support. You are right tho, maybe the function switch enum can be a good start to solve UI/UX issues :] thx for the suggestion.

    How are you doing the low poly water? Are you doing flat normals on the cpu or something?
     
  43. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    481
    Nope. I'm using split uvs per triangle, scaled them down to 0% in the middle of the triangle, to animate the water and recalculate normals. However it's working fine for one water plane, I can't use this method to stitch multiple planes without visible seams or to work in world space. I'm also trying to avoid ddx/ddy and try to solve the problem in the vertex shader. In the end I want to generate my own procedural mesh and drop the planes stitching idea. I'll see how it goes :)
     
    KRGraphics and Amplify_Paulo like this.
  44. ThermodynamicsMakesMeHot

    ThermodynamicsMakesMeHot

    Joined:
    Feb 14, 2015
    Posts:
    224

    The new UI shader and template is just amazing. It was a complete game changer for my project. Being able to add and than change the effects on the UI by using various sprites is awesome. Then the template is easy enough to expand/build upon and make changes even for someone who has little knowledge of shaders. This just makes it easy and fun. Loving it so much I don't know how I could have continued without it. Can't thank you guys enough for creating this feature. Very awesome. Thanks for creating this spectacular tool!!!!!!!!!!!!!!
     
    blitzvb and Amplify_Paulo like this.
  45. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,442
    That is BEAUTIFUL!!!!!!
     
  46. sticklezz

    sticklezz

    Joined:
    Oct 27, 2015
    Posts:
    33
    I'm not very technical, Is there a way so the rim / edges of the mesh could have a soft edge with the stencil, even if it was a screen door style (on/off) dither or something?
     
  47. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    @KRGraphics hey there, sorry for the wait, here it is, the refraction you asked for even if you no longer need it.

    It's a node based refraction, much like the refraction port. It might have some differences so if you need extra help just let me know.
     

    Attached Files:

    KRGraphics likes this.
  48. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    481
    Thank you! I'm glad you like it :)
     
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,442
    And I am feeling inspired to tackle my own water shader.
     
  50. TheWalkingDevTA

    TheWalkingDevTA

    Joined:
    Apr 24, 2014
    Posts:
    9
    So I've been running into this error over and over and, although it's easy enough to eliminate by editing the shader source, it would be nice if it was fixed on the ASE compilation side.

    Specifically, the error is "Declaration of "ase_worldViewDir" conflicts with previous declaration." As far as I can tell, if a shader function and/or built-in node (for instance, the Fresnel node) needs the WorldSpaceViewDir, the ASE compiler instantiates the required normalize( UnityWorldSpaceViewDir( ase_worldPos ) ) code without checking to see if it has already been instantiated. You can manually comment out the duplicate ase_WorldViewDir definition in the shader code, but every time you recompile the ASE shader you, of course, have to go back and do it again. Kind of a PITA.

    Attached is a shader that illustrates the problem. It uses the Fresnel node, as well as the built-in Blinn-Phong Light shader function.

    As an aside question, why can't you use the VertexToFrag node when tessellation is turned on?

    Running Unity 2017.3.0f3 (64-bit) and ASE 1.4.3 dev01.

    Thanks!
     

    Attached Files: