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

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Thank you for the reply (and the information regarding the outline).

    I had to tick the checkbox marked "Alpha To Coverage" as well in order to see an actual transparent texture.

    I have another question regarding what namespace gets generated from the shader, in order to access the alpha value through script. This thread says "pay close attention to the namespace", but in the example HighlightAnimated.cs mentioned, I can't figure out where the exact namespace string can be copied from:

    http://amplify.pt/forum/viewtopic.php?f=23&t=374

    The shader name in the editor is displayed as "ASESampleShaders/Community/TFHC/Highlight Animated" but the namespace is "TFHC_Shader_Samples". What am I missing?
     
  2. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    After investigating the reported issue, we've confirmed that the Unpack Scale Normal node is working as intended.

    This node directly calls Unity's internal UnpackScaleNormal function, that has different behaviors between different Unity versions as it depends on how the normal is packed by the texture importer ( which varies between versions ).

    For Unity 5.5 Unity packs the X and Y components on the A and G channels but on Unity 2017.4.0 the normal map X and Y are on the R and G channels.

    Here is a quick sample on how to properly use Unpack Scale Normal on 2017.4.0:




    Alpha to Coverage won't be necessary here, since it's mostly used for anti-aliasing via a coverage mask from the alpha channel of textures, which is useful for foliage or grass shaders. Please refer to the following sample for a simple shader setup that masks out the alpha channel and has opacity control for the visible element:



    Regarding your question, you're free to set up any namespace you wish, but not required to do so in order to access a shader's properties.

    Both Smear and Highlight_Animated samples provide examples of how to access and manipulate a shader through code, but you must take care to set the accessible parameters as properties when required. You can easily tell which are accessible selecting the shader in Unity and observing the inspector, under the "Properties" parameter.



    Please let me know if the samples are not clear enough regarding accessing shader properties via script, I'll be happy to elaborate!
     
  3. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Thank you for the quick reply, I'll look into what went wrong with my alpha shader.

    However I believe you misunderstood my second question. I know how to access the properties, that was very clear in the examples. What isn't clear, and still isn't clear, is how the namespace for the shader is generated. What controls it and how can I change it? It's especially confusing, since as I mentioned, the namespace for the Hightlight_Animated sample is completely different from the shader name itself.
     
  4. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Hi. There is not relation between the script namespace and the shader name.

    On the example Hightlight_Animated, the shader is named ASESampleShaders/Community/TFHC/Highlight Animated for organization pursposes. With this name there is a main folder (ASESampleShaders) for all ASE shader samples, a subfolder (Community) for the shaders donates by the community, another subfolder (TFHC) referencing the donator (TFHC = The Four Headed Cat) and finally the name of the shader.

    On the other hand, I put the namespace TFHC_Shader_Samples on the script highlightAnimated.cs trying to avoid troubles with duplicated scripts names when a user import the sample. You know, the class name must be unique on the same namespace. But this namespace is totally arbitrary and have nothing to do about accesing the shader properties.

    I you want to change the shader name, simply open it with ASE doing double click, select the master node and change the shader name its property Shader Name on the left pane (for example you can name it "My Shaders/Highlight_Interactive" -without quotes).

    Finally, for the script, you can use the namespace that you want or simply don't use any namespace.

    ... trust me, I wrote this shader time ago, a I don't know what is the mean of "pay close attention to the namespace" on the forum entry that you have referenced... XD XD
     
    ekergraphics likes this.
  5. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Hey! I was wondering if there are any examples of particle shaders in the package?
     
  6. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Apologies for having trouble understanding your confusion, the shader file name ( 1 ) in the assets folder is unique and has to be set manually in the Project Explorer tab, and you may choose to use different names for the file and the actual shader, or keep them the same. It is unrelated to the shader name.



    The shader name ( 2 ) can be set in the Node Properties tab, where you may also categorize it by using forward slash as the separator, and will be present in the shader's code, unlike the shader file name.

    Have you had the oportunity to browse our wiki manual for ASE? If there's any information that's not clear enough feel free to let us know, we're always working on improving our documentation and we value the community's feedback.

    Please let me know if this helps, thanks!


    Thank you for your input!


    Hello! At this time we have one sample, in the AmplifyShaderEditor > Examples > Official > TemplateExamples > Particles > HeatHaze folder, in which we make use of our Particles Template.

    If there's a particular sample you'd like to see added in the future, we're always open to requests!
     
    Prodigga likes this.
  7. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Okay thanks. :) I'm really just looking for an example that explains how I set up a particle shader. I'm trying to recreate this effect from RIME, and in their UE4 material they use emission and opacity. They create this material then use it in a particle. However, once I set my Amplify Shader to a particle shader I can only input emission and I'm not familar with how this all works.

     
  8. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    Hi.
    I have a question.

    My pc has freezed suddenly while I was trying to save a new scene and after booting and launching Unity again I noticed that a quad I use as a skybox was all pink (shader error, by the way).

    I tried opening the shader, but instead of the ASE editor, it opened in my text editor, and there was a big array of 0's


    I finished the shader days ago, but I had it open for changing some internal variables, and possibly the new changes were not saved when my pc crashed. But I would not expect loosing the entire shader, only the unsaved changes.

    It's there any way to recover the original shader? That array semed a bit like a compressed data or something.

    Thank you :)
    PS: Luckily, I have a backup, so I didn't lose anything.
    But now I'm a bit worried... Does it mean that if by anything, my computer freezes again, I could lose completely any shader I have currently opened in the editor?
     
  9. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    The node that you need to use in order to access the particle system data is the Vertex Color node, and you may use it in a Standard Surface Shader or a Shader Template.

    Still regarding our HeatHaze sample, we're using the W input in the Append node that is connected to the Color as the Alpha for masking purposes.

    You may also adjust the blending type on the output node's properties.

    Do let us know if you have any issues with converting that specific shader, we'll be happy to help!
     
  10. Amplify_RnD_Rick

    Amplify_RnD_Rick

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


    We've just uploaded a new build into our website.
    Here are the release notes.

    Release Notes v1.5.2 dev 04:
    • Fixes:
      • Fixed issue on Post-Process sample scenes crashing on lower Unity versions
      • Fixed issue on fallback behavior when required template on loaded shader is not found
      • Fixes issue on texture type nodes moving when a texture is selected over it's picker
        • ASE window now aware when ObjectSelectorClosed command is fired to ignore incorrect mouse delta values
    • Improvements:
      • View Dir vector on templates is now calculated on fragment by default
      • World Reflection vector on templates is now calculated on fragment by default
      • Native View Dir vector calculation on Lightweight SRP template is now done on fragment
      • Shader function 'Reconstruct World Position From Depth' now also works with screen shaders
      • Updated Skybox - Cubemap Extended by Cristian Pop sample

    Thank you so much @BOXOPHOBIC for the update on your sample. The updated sample files comes with regenerated the GUIDs so we would advice deleting the old AmplifyShaderEditor > Examples > Community > Skybox - Cubemap Extended before importing this new one to avoid duplicate folders.

    This is quite the unfortunate situation, we deeply apologize for it. This is something that we don't want to happen to any of our users.

    As everyone is used to hit Ctrl+S to save, we've added this shortcut inside ASE to save/compile the shader as a quicker alternative to the Compile button. But it only happens if the ASE window is focused.

    What must have happened was exactly that, the ASE window must have been focused and a save operation was set over the shader when your PC froze.

    We'll review the Ctrl+S behavior and also the save operation to be more robust in order to prevent further situations like that.

    Happy shader creations!
     
    Furry likes this.
  11. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Ahhh, there is the information I was looking for! :) Your forum post was the first thing that came up when I searched, so I erroneously believed that in order to perform a SetFloat on a material, you had to be in the correct namespace. No wonder that @Amplify_RnD_Rick had trouble understanding my question. Thank you!

    I did search the wiki before, and if you input "namespace" into the search field, you get exactly two hits, none which I found helpful (but that was due to my previous misunderstanding where I thought it was necessary, when it is not).

    As for my original transparent shader, thank you for the picture. I had made two additional mistakes, in that I hadn't changed the render queue and also it was unnecessary to append the multiply into the emissive output, as I had done.
     
  12. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi all, I am running into an issue trying to use a texture that contains Normal in RG, Metallic in B, Roughness in A.

    The problem is, AFAIK, I am doing exactly what Unpack Scale Normal page tells me, but somehow the result is far from what I expect:

    Screen Shot 2018-04-18 at 14.58.29.png

    I would expect this to "rebuild" the Normal RGB channel and output a normal map, but it doesn't, the preview is dark and the actual rendering is also black.

    I didn't use the "unpack normal map" option in texture sample node, as I believe it won't unpack correctly, due to B/A channel containing other data.

    My texture is imported as following (It's not a "normal map" type as it contains metallic and roughness in B/A channel.)

    Screen Shot 2018-04-18 at 15.02.40.png

    So my question: what did I miss?
     
  13. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    78
    Ok thanks for the layout. I think i tried that at some point but as i didn't put anyting in W input, i had no red channel in the preview.

    @bitinn Same issue as me. You have to plug R to X and G to Y. And a float 1 in W for a correct preview ?
    Also uncheck unpack normal map in the texture sample node, and uncheck sRGB in the texture import settings.
     
  14. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    I already did the last 2 things you mentioned.

    However I missed a default value in my Append node, which cause my blackout problem.

    And it seems your suggestion is right, "Unpack Scale Normal" node expects a pre-swizzled normal map (ie. use RG channel, not GA channel, for my Unity 2017.3). I have found the change took place in 2017.2 (search for "normal map").

    So, issue resolved, and the document page needs a update.
     

    Attached Files:

  15. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    244
    Hi guys,
    Another newbie Q here (please point me into the right direction if this has been already asked). I already have Amplify Shader Editor and would like to create a leaded glass window. As you can see in the image, the default Unity glass FX shader (Left) does not support opacity and metallic maps I need for the metal part, and the standard Transparent shader (Right) does not come with the distortion effect. I would like to combine the two, so the glass will be refractive and colored, and the metal parts remain nontransparent and metallic. I can bake a custom distortion normal map if needed. How should I start in Amplify? Glass shader comparison.PNG
    Thanks for any help!
     
  16. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    508
    Thanks again for adding Skybox Extended to the package and sorry for the inconvenience! Unfortunately I had to regenerate the GUIDs, I tend to clone projects in the past when starting something new and when assets share the same ids, the importing gets mixed up in different folders. Lesson well learned. Try to avoid that.

    I also want to share with you guys what I've been working on lately, Advanced Dynamic Shaders. It will be out on the asset store soon and they are made with ASE of course. Check out the teaser trailer :D



    Have a good day !
     
    sazberryftw and KRGraphics like this.
  17. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    Don't worry guys, I just wanted to notify you in case there is room for improving in this aspect :).
    But I didn't hit Ctrl+S, I was saving a new scene using the unity menu, but I didn't saved the last changes I made on the shader.


    @bitinn , I noticed days ago that there is some bug in the append node (look #3122 and above). I think it's not fixed yet. Maybe it could be that.
     
  18. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Happy to know that the picture helped!

    Please let me know if you have any further questions, and apologies once more for having trouble understanding your previous question.



    Hey guys, we're going to review the wiki page for that node in order to provide more detailed information regarding how its behavior differs in different Unity versions, it should be updated during today.

    Thank you for all your feedback, we really appreciate it!


    Hello! There are a few ways to use distinct materials within the same shader, including the Lerp and the Layered, Summed or Weighted Blends. I'm attaching a simple shader sample that makes use of the Lerp operation and shows how you can have glass and metallic parts that are set through a mask, which should serve as a good starting point for you to develop your own effect.


    SampleShader.unitypackage

    Let me know if this helps, thanks!
     

    Attached Files:

  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I will definitely be using this on my grass assets... is the vertex animation in the shader itself or can it also be a shader function, the I can add to my own foliage shaders?
     
  20. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Thanks! I do have a quick question - how do I make a particle material that is 100% opaque when I set it to be? I've set up an alpha blend particle shader that appears to do what I want until it gets close to a surface, which then it blends out and becomes transparent.
     

    Attached Files:

  21. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    508
    Right now it's in shaders directly but of course it can be copied and transformed into a function. And probably I will do it. I don't like adding parameters in functions because of the Header that is created. It would be nice to be able to turn it of and add the Headers in shader where you want. But this is just my personal preference :D

    @Amplify Team - Regarding copying and pasting I think it would be really useful to be able to copy parameters without changing their name. Or having 2 options: Ctrl + V, copy with formatting (name unchanged, only the duplicated ones, with warning on them) and Ctrl + Shift + V, copy without formatting (all the names changed, like the current behavior).

    Thanks :)
     
    KRGraphics likes this.
  22. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    No problem!

    Regarding your question, it should be fairly quick to setup, can you package and share the shader, material, texture and particle asset used? If you prefer you can send it over via email at support@amplify.pt.

    I would be happy to help set it up, as the cause of the problem is not entirely apparent, thanks!


    Hello, thank you for the feedback, I've registered it and forwarded it to the developers.

    I'll get back in touch as soon as we have any developments regarding this suggestion, thanks!
     
  23. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Sure thing, I'll send it via email now. Thanks!
     
  24. brett_ridel

    brett_ridel

    Joined:
    Jan 15, 2017
    Posts:
    33
    Hello

    Just now, I successfully added a fixed size array in one of my shader, and fill it with Material.SetFloatArray method.
    However, I had to add the array manually by editing the shader file (outside of the properties block, with a uniform prefix)
    Unless I'm wrong, ASE do not offer this functionality. Do you plan to add it ?

    Brett
     
  25. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I'll probably convert it to a shader function so I can plug it into my own grass shader... I've been using a lot of photogrammetry and I want to have all kinds of grass details
     
  26. TheodoricSacron

    TheodoricSacron

    Joined:
    Nov 22, 2014
    Posts:
    2
    Hi,
    I've seen that ASE started working with UI 3D-System ( https://www.assetstore.unity3d.com/en/#!/content/109573 ). Do you have some advanced example shaders integrated with this plugin? I mean there are only simple example Amplify shaders and they work good, but that would be great to see some dissolve or outline shaders which could be added to 3D GUI objects. Btw it's great to see that your tool works with others, it makes tons of new possibilities :)
    Cheers!
     
    Furry likes this.
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I'd love to see that option to convert a selection to a shader function
     
    Suzuka91 likes this.
  28. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for your feedback!

    The UI 3D-System developer has recently added support for ASE, I believe they provide a few samples to show how you can use shaders developed with ASE together with their asset.

    We didn't work on any specific samples on our side but our package provides a growing selection ( 60+ ) of free samples which you could use as a starting point for your UI 3D-System system to make the most out of both assets.

    For additional information, I recommend contacting the developer.


    That's definitely in our plans and something we would like to tackle at a later stage, along with collapsing / grouping node networks into a single node!
     
  29. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We just uploaded a new build over our website.
    And as always here are the release notes.

    Release Notes v1.5.2 dev 05:

    • New Samples:
      • Single Channel Masking by Sarah Akers and David Marshall
      • Dithering Fade Blue Noise
    • New Node:
      • Inverse View Matrix
    • Fixes:
      • Fixed issue on not copying defaults to material values when changing Type from Global to Property over property type nodes
      • Fixed Stencil Comparison not being correctly written on shader when set as an inline property
      • Fixed issue on Reference mode not being taken into account when registering 'Texture Sample' properties
      • Fixed infinite loop on 'Texture Sample' nodes with Reference mode
      • Fixed custom outline alpha mask mode
      • Fixed issues on compare type nodes accessing their Wiki page
      • Fixed dropdown left title padding for nodes that have it but don't have a preview arrow
    • Improvements:
      • Improved 'Unpack Scale Normal' node usage on Burn Effect sample
        • Now compatible across all Unity versions
      • Re-factored Global variables behavior over property type nodes
        • Material values can no longer be edited
        • Auto-fetching global variables values every 2 seconds
      • Parameter type can be changed in node over texture type nodes
      • Removing automatic header creation by properties under shader functions
        • User now can manually set headers on property type nodes via its attributes
      • Turned the main Mask Clip Value an inline property so users can set it to be a specific node
      • Updated 'Screen Position' node preview
    • New Previews:
      • Compare ( A > B )
      • Compare ( A >= B )
      • Compare ( A < B )
      • Compare ( A <= B )
      • Compare ( A == B )
      • Compare ( A != B )
      • Compare With Range
      • If [Community]
      • Decode Float RG
      • Encode Float RG
      • Decode Float RGBA
      • Encode Float RGBA
      • Decode View Normal Stereo
      • Encode View Normal Stereo
      • Decode Lightmap
      • ColorSpaceDouble
      • Face
      • Switch By Face
      • LOD Fade
      • Layered Blend
      • Weighted Blend
      • Summed Blend

    Here's a preview on our newest community sample, Single Channel Masking.
    Thank you to Sarah Akers and David Marshall for this great contribution!



    Hope everyone has a great weekend and happy shader creations!

    EDIT: Just added a shot on our newest community sample.
     
    Last edited: Apr 20, 2018
    arnoob and KRGraphics like this.
  30. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    244
    Update: Thank you very much! It was easier than I thought. Here is a WIP result:
    window_refraction01.PNG
     
  31. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    hi ASE devs.
    I'm using 2 triplanar texture samplers with 2 normal map and I'd like to lerp them with a value that come back from another part of the shader.
    In the texture sampler set as "Unpack Normal map" you can set the scale of the normal map.
    Is it possible to add the "scale" parameter to the triplanar sampler when we use it as normal map?

    Thanks in advance
     
  32. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    That's a fail on my part, it should be easy to add the scale factor into the node. Thanks for reporting, expect it in the next build or so.
     
  33. bpolley

    bpolley

    Joined:
    Mar 18, 2014
    Posts:
    10
    Hi,

    I can't seem to find the "Global Array" node. Is this still supported?
     

    Attached Files:

  34. EscalatorSafe

    EscalatorSafe

    Joined:
    Apr 12, 2018
    Posts:
    21
    In the latest update you mentioned "User now can manually set headers on property type nodes via its attributes"
    How exactly do you do this, when looking at property node attributes i cant see anything about headers?
    Cheers
     
  35. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! We've actually temporarily removed the node from the searchable list, since this is a community node and it has to be reworked due to some changes in Unity 2018. We'll be adding it back in a future update, apologies for the inconvenience!


    Hey there!

    In order to set a header through a custom attribute in your property node, please refer to the screenshot below:

     
  36. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I'm using the Time node with a scale of 5 to offset or pan a texture on the X axis which works fine, however after a while the texture's scale grows bigger and bigger, this behavior is only seen in the editor window, the texture looks fine in the game view or in standalone or if I turn off animated materials, the only way to fix this is by restarting the editor, I'm not sure what is happening but it has to do with the Time node, lowering the Time node's scale to 1 solves the issue but the higher i crank it up the bigger the texture appears when the issue is present

    Batching is turned off as with most other rendering options

    Using ASE 1.5.1 and Unity 2017.1

    Shader.jpg
     
    Last edited: Apr 25, 2018
  37. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    does anyone know how to create a Channel Packed Standard PBR Shader?

    EDIT1: can ASE able to create a drop down menu?

    EDIT2: Apparently Alloy does not play well with performance in PS4, so i need to recreate shader to replicate alloy/unreal
     
    Last edited: Apr 26, 2018
  38. EscalatorSafe

    EscalatorSafe

    Joined:
    Apr 12, 2018
    Posts:
    21
    Hello!
    With the property headers, when I name multiple properties with the same header instead of putting then together under the same header it just shows the header multiple times above each property. It would appear that putting functions inside functions is still the root cause as it still messes up the order of the properties.
    Also you cant add headers to switches and textures at the moment, so they also end up in between properties with the same headers.
    If you were to fix the ordering problem you should be able to bring back the auto headers as well as the ones it created were fine just above the wrong properties.
    Cheers!
     
  39. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    I've attached my version of a greypacked, standard PBR shader!

    Note: I use a roughness workflow, meaning I invert my gloss map in the shader, remove this if you want to use glossiness workflow! Don't forget to set your greypacked texture to linear (untick sRGB on import settings).

    Get back to me if you have any questions or issues with it :)
     

    Attached Files:

    Last edited: Apr 26, 2018
    hopeful likes this.
  40. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Why do you need to put the header attribute on multiple things? You just put it on one, then order the properties in the correct order, with the header property at the top.

    You should be able to add them to textures, although not sure if you mean it looks weird because the texture is to the right and the header is to the left. :) But I too would like to be able to put them on toggle switches!
     
  41. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for reporting this issue, unfortunately, we haven't been able to replicate it on our side.

    Could you fully specify both Unity and ASE versions you're using?

    Are you able to replicate it in a new project?

    If possible, send us a simple sample with the issue present over to support@amplify.pt, so that we may debug it on our side, thanks!


    sazberryftw was kind enough to share a shader two posts below, if you have any further questions do let us know!

    Regarding the creation of a drop down menu, I'm afraid I don't fully understand the question, could you provide further details on the effect you wish to create?


    We've removed automatic header creation by shader functions on the latest build, v1.5.2.005 that is currently available for download through our website, which should prevent certain certain header ordering issues.

    At this time, giving the same header to different properties will simply duplicate the header on the inspector, so the correct way to use these is to add each necessary header once, then order the properties with headers through the Material Properties within the Output node's parameters, or Graph properties in the case of Shader Functions.

    Please refer to the screenshot below for an example on how to use them together with functions:



    Please let me know if this helps!


    Thank you for sharing your shader!

    Regarding adding headers through Toggle Switches, I've registered your request and it should be available in a future build, thanks!
     
    sazberryftw likes this.
  42. EscalatorSafe

    EscalatorSafe

    Joined:
    Apr 12, 2018
    Posts:
    21
    Hey thanks for helping me,
    So it appears you can apply headers to the textures, unless you have "no scale offset" checked.
    I understand you can order them in the material properties, and in your example I see how it should work.
    When you put a function in your shader that has a function inside it (Both with properties), the ordering of the properties is compromised.
     
  43. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Unfortunately, due to a Unity related limitation, we aren't able to circumvent this behavior since the propriety does in fact exist more than once, and there's no way we can determine its position.

    Ideally, you'll have to set your headers in properties outside of the function in order to avoid ordering issues that might be caused by using them within functions, apologies for the inconvenience.

    Please let me know if you have any further questions!
     
  44. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    I'm interested in header creation too and I've found that, for example, if you set "no scale offset" in a texture sample and a custom property with the header, the header it will not generated.
    If you leave the scale&offset visible, the header appears.
    Is it correct?
    If yes, what do you suggest to make shader properties groups for a better visual understanding?

    Thanks in advance

    EDIT: Sorry...I've read after your last reply...anyway half question still valid, what should I use to create some property groups?
     
  45. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Having some more fun with my shaders... I have edited my shaders so that individual strands of hair can be controlled with a Strand ID map. I will be redoing this hair so that it feels full when you look at it for all angles. And I can't wait to see what multipass looks like on this... There is no reflection on this as I want to get the colour and softness proper before adding more.

    I also tweaked the eyes a bit so the cataracts will blend more naturally I will be experimenting with different eye types as well. Skin is Alloy (until we are able to create our our skin shaders. Enjoy. Screenshot 2018-04-25 00.47.13.png upload_2018-4-26_17-26-25.png
    Screenshot 2018-04-26 17.34.19.png Screenshot 2018-04-26 17.31.44.png
     
    Last edited: Apr 26, 2018
    wetcircuit, Hitch42 and hopeful like this.
  46. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Could you please elaborate on what 'unity related limitation' you are referring to? I can open up the .shader file and put the properties in the correct order by hand, and put the headings in the right spot. Obviously this isnt a solution because ASE will stomp over my changes the next time I rebuild the shader, but the point is there is no 'unity related limitation' stopping me from rendering things in the correct order.

    This sounds like an Amplify Shader Editor related limitation. What is stopping you guys from delaying the generation of the property block in the shader file until the very end of the generation process? At the very end once you have 'collected' all of the properties, you can group them by their functions and put a header on the first property for that group with the name its function.

    Sorry if this comes off as a little blunt. I have been tracking this issue for a bit, and a little annoyed that Amplify has removed the auto-header feature and dressed it up as an 'improvement' in your change logs and when asked about it you guys are pushing the blame on to Unity?


    So, the proposed solution in this picture is to place the headers in the correct spots manually. Which is fine for simple shaders, but the ordering is completely messed up in shaders that have multiple functions/nested functions as @EscalatorSafe has been trying to say.

    Here is an example.



    You can see how 3A and 3B just get thrown around wherever ASE decides to place them.

    So, following your suggestion, I give 1A, 2A and 3A a title, this is the result:

     
  47. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Hey, I'm going to send you guys a test project, i'm using ASE 1.5.1 and Unity 2017.1 as mentioned in my previous post.
     
  48. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    thanks! i will pm you if i encounter any problems
     
  49. Hitch42

    Hitch42

    Joined:
    May 12, 2015
    Posts:
    98
    Looks great! When you have everything looking good, would it be possible to give a tutorial? A major hair asset just got depreciated and I'm wondering if ASE might be a solution.
     
    KRGraphics and hopeful like this.
  50. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Let me explain in detail, since I was the one that made it that way.

    When we first implemented shader functions our idea was to represent all properties inside the shader function in the main shader (outside of the sf), I did that but as you might expect seeing dozens of the same property because you happen to repeat your sf various times doesn't help very much, but that was easy, I can simply check whether I have duplicates or not and bundle them together. So I did. But this revealed an issue with how unity treats each property in the material inspector. You see, for your case you are simply reusing the same property that's inside the same shader function, but I can have multiple properties with different attributes and options and they all correspond to the same property, unity assumes correctly to be the same property but then the visual representation in the inspector gets funky. In fact the idea to put headers in shader functions actually came to mitigate part of this problem, our idea was to give each property a different header so you could tell them apart.

    There's no way for us to tell which is the property we want to show in any given setup without showing them all, and it's isn't very friendly to see the same property repeated in the reordable list, you don't even know which is which.

    Just to give you another example, in the unreal material editor they also support this, but the way they do it is to render only the ones with different name, but thats because in Unreal you can't change anything from a property besides the name.

    The reason you can do it in your code is because you can change each property individually after the them being filtered for you. But you have no way to tell for certain which property it represents in the graph besides the name.

    This is a mix between a unity limitation and a design decision. The correct way to circumvent this would be to populate the reordable list with each property from every shader function and let you change it's options and attributes allowing to override whatever the original had.

    I hope this wasn't too convoluted, if you can think of a better way to deal with this behavior please do share.
     
    dnszero likes this.