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

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    With Unity announcing the integration of BuilderPro and the painting/sculpting tool, I would think now that the terrain system in Unity is basically done. I may start to think about using Amplify to make a terrain shader for normal meshes using vertex colours to blend textures, since there's also now a sculpting tool you can effectively make terrains with normal meshes now.

    My thinking for blending textures is, Base texture, then 3 textures on top of that blended in using vetex colours RGB, on top of that a cliff texture that only appears on major slopes. This means a whole 5 textures blended together but it may be possible to do more, like a sea level that cuts off the other textures with another set of textures. using the same RGB. That means one mesh with 8 materials. you could even do the same thing as the sea level for high mountains with snow on top.

    But why stop there! For each 'texture' you could lerp between similar ones using some kind of noise mask to break up any kind of obvious tiling. This can all be done now using just Amplify Shader Editor and the new vertex painting/sculpting tools Unity will have built in. On top of that you can also paint objects on as well (trees etc).

    I'd say this is now pretty much like Unreal now effectively leaving Unity's terrain system in the past. The only thing we need now in Unity is a plane generator with parameters of size and how many polys. With that in mind I'm coming back to Unity and using Amplify as my main shader editor. :) I was really happy to see you guys finally make terrain shaders possible but now I think it's redundant. What say you, Amplify developers?
     
  2. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    A new build was just uploaded into our website.
    Here are the release notes.
    Release Notes v1.4.4 dev 04:
    • Fixes:
      • Fixed issue on Specular Highlights and Reflection toggle not being read/written into shader meta
      • Fixed issue on not correctly taking templates global variables into account when building shader
      • Fixed issue where 'Triplanar Sample' node wasn't being initialized properly
      • Fixed Undo issues on create/delete nodes
      • Fixed Undo issues on preview node resizing
    • Improvements:
      • Added new Enum Property Attributes for both 'Float' and 'Int' nodes
      • Added new Keyword Enums option to 'Static Switch' node Type option
        • Improved its interface to better accommodate new options
      • Added new keywords to 'Static Switch' Keyword dropdown
      • Increase max port count for 'Function Switch' node to 9
      • Added/Changed shortcuts for various nodes
        • R - Create 'Register Local Var' node
        • G - Create 'Get Local Var' node
        • Z - Create 'Swizzle' node
        • X - Create 'Cross' product node
        • Period(.) - Create 'Dot' product node
        • B - Create 'Break to Components' node
        • K - Create 'Component Mask' node
        • V - Create 'Append' node

    Hope everyone has a great weekend and happy shader creations!
     
    brisingre and TheWalkingDevTA like this.
  3. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    The addition of BuilderPro was quite the awesome news but I don't think that Unity terrains are completely done since they are much more than geometry. Please take in mind that they have a bunch of tools ( their own culling system, LOD , etc ) that will still make them useful.
    Nevertheless I'm super curious to see how BuilderPro will be integrated/used and what kind of modifications will be made on it to accommodate the plugin into Unity internal tools workflow ! :D
     
  4. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    @Amplify_Paulo
    I'm trying to make a cloaking shader similar to this :


    Thus far all I've been able to do is make a transparent shader with some rim lighting, but it really doesn't give me the effect that I'm looking for. Could you give me any tips on what I'd want to do to create a shader similar to what you see in that youtube video?
     
  5. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    With the permission of @bgolus (who gives me more than a tip in this thread ) I want to share this shader.
    It gives you the possibility to use the 4 channels of a texture distribuiting them in a grid 2 channels by 2 channels using a world space UV coordinates.
    Additionally I've added a scale multiplier to arrange better the texture for your purpose.
     

    Attached Files:

  6. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Hi guys,

    Back again! Been working on the toon shader some more and I've got a really nice look. I've managed to change shadow color for Directional Lights but still as yet unable to do it for Spot or Point Lights but I've managed to work out some things. Basically took a lot of the nodes from the Outline Toon Shader and worked it into the Guilty Gear shader Paulo put together a while ago.

    Anyway, hopefully a simple question!

    I'm using the Outline node you guys put in a while ago and while its really nice, I can't figure out how to make it draw all the lines on the cube.

    Image of a standard cube in Unity with the "Custom Outline Toon" shader included with Amplify Shader Editor:

    https://imgur.com/9vC8yCV

    This is an edited image in Photoshop of what I want it to look like:

    https://imgur.com/mYWxTFv

    and this is an image of the actual problem:

    https://imgur.com/tsa9YRa

    as you can see, theres no outlines on the edges of the skirt, from certain angles the edges appear though, so I'd like to fix that... am I missing some obvious setting that would fix this?
     
  7. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Hello everyone!

    I am currently having a problem (I think it is a bug?).
    I am currently building a surface shader that uses 3DTextures for emission.
    It works pretty well, but when I put no textures in the node, rather than outputting me the selected default texture (I chose "black") it always outputs a white one. I also tried "gray" and "bump", but still the same result.

    I joined two screenshots so you can see what I am talking about.

    I also found that using 3DTextures in a function doesn't works like it would for a 2DTexture. It always outputs the white color (as if no texture was selected for the node) even if the texture is correctly set up in the function.

    Just in case, I joined a simple noise 3DTexture so you can make some tests by yourself.

    Could you guys please take a look at these issues?
    Also keep up the good work! The frequent updates you make all the time are really great to see!
     

    Attached Files:

  8. CG_Echtzeitschmiede

    CG_Echtzeitschmiede

    Joined:
    Feb 19, 2015
    Posts:
    93
    Hello,

    I really like this plugin, but I now have a problem I can't seem to fix. I've attached an image of it.

    This is a much simplified graph from what I'm actually working on, but it shows the problem well. Essentially, I have decision boundaries based on a floored world position and then shift the UVs within each section. Between the sections I get these horrible aliased lines, and no matter what I try I cannot get rid of them.

    EDIT: Nevermind, I solved it by setting the Texture Sample mipmap mode to derivative and plugging in a DDX and DDY from an unmodified Texture Coordinates. Thank you for exposing all that good stuff in the plugin!
     

    Attached Files:

    Last edited: Feb 18, 2018
  9. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    If I can help for global variable, it is pretty straightforward.
    When you selected a float, vector, texture or color in the AS window, you can change its type to multiple choices : "Constant", "Property", "Instanced Property" or "Global".
    You probably already know that when you set it to Property, you can change its value per material.

    If you select "Global", you won't be able to do that anymore. The only way to change a global variable is by script, using "Shader.SetGlobalTexture(string name, Texture value);" for example if your global variable is a texture.
    See the doc here https://docs.unity3d.com/ScriptReference/Shader.SetGlobalTexture.html

    Once you do that, everytime you use this line of code, for example "Shader.SetGlobalFloat ("_Range", 7);" any material using a shader having a global variable named _Range will have this value set to 7.

    It is really helpful when you have a lot of material using different shaders that all need to be updated at the same time.
    Be careful tho, there is a bug with Unity that makes the value be reseted when you are not in "runtime". Otherwise, it works perfectly ingame and in runtime.

    Hope that helps! Keep up the good work :)
     
  10. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    132
    hmm quick question. how can i make a partial transparent shader receive shadows. no matter what i do it doesn't work unless opaque
     
  11. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    Hi Amplify Shader users, I am a total noob to shaders and was about to buy the Shader Forge asset when I saw this alternative. It seems to be more actively developed than SF, so I am now wondering which of these asset fits best to people who want to take the first steps into shader creation. Would you recommend AS over SF or is SF more intuitive for noobs? It looked a bit like this. Thx for your opinions.
     
  12. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I recommend that you take a look into two of our shader samples available within the ASE package, the SimpleRefraction and the AnimatedUVDistorion.
    Do note that in the first sample we're using Translucent as the Blend Mode, which might not be suited for the cloaking effect, and that the distortion seen in the second sample, although static, may be adapted to suit your needs, it all depends on how you want to create the effect itself.


    Thank you for sharing this shader with the community, if you're interested in submitting it through our website, we credit all submissions.


    Unfortunately, our current outline implementation doesn't provide this type of control.
    I would suggest that you further examine the CustomOutlineToonStyle2's Highlight and Cell control setups in order to try and accentuate the effect on the skirt.
    Keep an eye out for toon shading improvements, it might be possible in future iterations but until then I recommend looking into an alternative technique..


    Hey there, thank you for taking the time to report these issues! I've managed to replicate the second issue you've reported and have escalated it to the developers, but not the first, would it be possible for you to send us both shader and material with the issue present so that we can debug it on our end? Thanks!


    Paulo is a bit overloaded at the moment, but he will continue his discussion with you tomorrow or as soon as possible, apologies for the inconvenience. Regarding Global Variables, arnoob was kind enough to provide a detailed explanation on them!


    Hello, thank you for sharing your solution with the community, apologies that we didn't make it in time to help you out!


    Thank you for your input, it's always great to seeing our community interact, we really appreciate the help!


    Transparency is a complex issue as transparent surfaces have no concept of depth, making them unable to cast or receive shadows.

    There are a couple of workarounds but they are far from perfect:
    - You can turn your transparent objects into opaque ones and use a grab pass to try and simulate transparency on your own. For this you need to be very careful on the Render Queue offset so they are rendered after all other opaque objects.
    - You can turn your transparent objects into opaque and apply dither to them.

    Check the hack in this post if you are using Alpha Blended materials, not ideal but might help in some cases.


    I'm biased but, as a user myself, I find ASE much easier to get into than SF. Our user feedback supports this trend as many seem to agree that ASE is indeed more approachable than SF or similar editors, such as the Unreal Engine Material editor.

    There are things that will be fairly similar given that they are both node-based editors, with each offering its own take in regards to user experience.
    Feature wise, I believe that ASE touches on a few unique points that you won't find in Shader Forge. Features like Shader Functions, an API for Custom Nodes, and a Template System for Custom Shader Types.
    Regarding support, the dedicated ASE team provides some of the fastest and responsive support on the Asset Store, accompanied by weekly (sometimes daily) updates.

    Additionally, the main ASE package includes a growing collection of shaders samples (+50), and we're currently releasing both Beginner level and Longer Misc video tutorial series ( open to requests ).
     
  13. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Excellent, thank you!

    Ive ended up delving into edge detection and screen space effects to generate the outline. It has nothing to do with Amplify but if anybody can give me some tips that would be great.

    Currently using this shader here:

    http://halisavakis.com/my-take-on-shaders-edge-detection-image-effect/

    Looking to use this but improve on it, improve edge detection (quite a bit of noise generated at the moment that I want to reduce) and I want the line color to be based on the color of the object the outline belongs to. Ideally have the outline darken when the object isnt lit. The current implementation is the same outline color and shade for each object regardless of the object color / how its lit. Currently able to do this with Amplify Shader Editors outline but not able to figure out how to do this. Entirely different process I know so I'm not surprised but if anybody has some helpful information or a sample they would recommend I'd appreciate it!

    I've used the outline stuff from the Unity Store, some are okay but none do what I want to do.
     
  14. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    132
    not really true they always have depth else they couldn't even z-test. actually receiving shadows should be just as easy as any forward rendered surface. sure that's quite expensive and could be optimized to per vertex or even better light propagation volume like ue4 does.
    but all that is a unity in general problem i would say. maybe i'm able to do something with custom lightning. will have to test.

    also i already tested all the other ways to fake it but they all have annoying drawbacks that make my ocean / water look not like i want it to

    well i guess i play around and see if i can get something to work with what unity provides
     
  15. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I'm not entirely familiarized with that shader or technique, you might consider sharing your sample with the community and see if anyone would like to extend it or provide some additional information!

    Also, if you haven't seen the Sobel Post Process sample we provide within the ASE package yet, do check it out as it might provide further insight in how to develop image effects through ASE.


    In a Unity context, transparent surfaces have no concept of depth and even if you force them to render any kind of depth there'll be some disconnect between what you render in final color and what depends on the depth.
    For instance, shadows are rendered according to the depth, so in order to make transparent objects render any shadows unity calculates a dithered pattern from the alpha channel. This dithered pattern is seen in the z-buffer, and Unity then blurs that pattern.
     
  16. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    132
    oh no i was not talking shadow casting but receiving shadows on a transparent surface. something like this https://i.imgur.com/nVEhiFa.png
     
    brisingre likes this.
  17. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Thank you Borba!

    Actually, I tried to look at it but sadly a bug seems to be preventing me. When I open the sample it loads fine and I can run it but if I open the shader and look at the node network, not touch anything and just compile it Unity throws up errors and the shader turns pink.

    The error is:

    Shader error in 'ASESampleShaders/Sobel': '_MainTex_ST': local variables cannot be declared 'uniform' at line 64 (on d3d11)

    Using Unity 2017.3.1p1 (latest patch release)

    Tried on multiple PCs and downloaded multiple times. Anybody else have this issue? I'll post my current geometry shader and post process shader. Hopefully somebody can extend the outline functionality...

     
  18. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Think we found a bug in the Dither Node code. When a dithering node is used inside a function, the shader does not compile properly.

    The offending line of code seems to be line 189-193 in DitheringNode.cs

    The code reads:
    Code (CSharp):
    1.  
    2. default:
    3. case 0:
    4. dataCollector.AddLocalVariable( UniqueId, m_currentPrecisionType, WirePortDataType.FLOAT2, "clipScreen" + OutputId, surfInstruction );
    5. functionResult = dataCollector.AddFunctions( m_functionHeader, m_functionBody, "fmod(" + "clipScreen" + OutputId + ".x, 4)", "fmod(" + "clipScreen" + UniqueId + ".y, 4)" );
    6. break;
    7. case 1:
    8. dataCollector.AddLocalVariable( UniqueId, m_currentPrecisionType, WirePortDataType.FLOAT2, "clipScreen" + OutputId, surfInstruction );
    9. functionResult = dataCollector.AddFunctions( m_functionHeader, m_functionBody, "fmod(" + "clipScreen" + OutputId + ".x, 8)", "fmod(" + "clipScreen" + UniqueId + ".y, 8)" );
    10. break;
    11.  
    But should be:
    Code (CSharp):
    1.  
    2. default:
    3. case 0:
    4. dataCollector.AddLocalVariable( UniqueId, m_currentPrecisionType, WirePortDataType.FLOAT2, "clipScreen" + OutputId, surfInstruction );
    5. functionResult = dataCollector.AddFunctions( m_functionHeader, m_functionBody, "fmod(" + "clipScreen" + OutputId + ".x, 4)", "fmod(" + "clipScreen" + OutputId+ ".y, 4)" );
    6. break;
    7. case 1:
    8. dataCollector.AddLocalVariable( UniqueId, m_currentPrecisionType, WirePortDataType.FLOAT2, "clipScreen" + OutputId, surfInstruction );
    9. functionResult = dataCollector.AddFunctions( m_functionHeader, m_functionBody, "fmod(" + "clipScreen" + OutputId + ".x, 8)", "fmod(" + "clipScreen" + OutputId+ ".y, 8)" );
    10. break;
    11.  
    Changed UniqueId to OutputId before the "".y, 4)" and ".y, 8)"
     
    Amplify_Paulo likes this.
  19. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Thank you for taking the time to look into the issue. Here are the material, shader and a test 3Dtexture. Let me know if you manage to replicate the issue!
    (BTW, I am on unity 2017.3.0p1m, with AmplifyShader v1.4.4.004 ).
     

    Attached Files:

  20. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Apologies for not making myself clear in my previous post but, unfortunately, transparent materials are not meant to handle shadows, as the shader is written in the transparent queue, but not in the depth buffer, so it's not accounted for by Unity's shadow pass.

    We did implement a special workaround within the shader code that allows for the casting of shadows by transparent objects, and there is in fact a way of having the transparent objects receive shadows but they will have dithering artifacts present, which makes them inadequate for any sort of use.


    No problem! Regarding the error, that's unexpected, I've just tested Unity 2017.3.1p1 with ASE v1.4.4_004 ( latest available at our website ) and the shader runs and compiles without any issues. Have you tested in an empty project with this latest version? Would you be able to send us a sample with the issue present so we can debug it on our side? Thanks!
     
  21. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey there, thank you for reporting this issue, we've tested and confirmed it on our side, it will be fixed as soon as possible!
     
    Prodigga likes this.
  22. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    132
    well that's a real shame. thanks for your time to answer.

    still baffled that unity is missing such a basic feature but ok its unity after all
     
  23. matthewhxq

    matthewhxq

    Joined:
    Jul 6, 2015
    Posts:
    21
    Hello,
    quick question, I'm using flipbook node and it works great, but is there any possibility to add delay/pause on the end of sequence? So it would look like this: FirstFrame....LastFrame - Pause - FirstFrame....LastFrame - Pause...etc
     
    Last edited: Feb 20, 2018
  24. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    Today we ended up uploading two builds into our website, v1.4.4 dev 05 and 06:
    Here's the sum release notes of both versions.

    Release Notes v1.4.4 dev 05/06:
    • Fixes:
      • Fixed issue on 'Texture Sample' nodes not automatically setting the texture type on AUTO
      • Fixed connection type mismatch after CTRL + swap shortcut
      • Fixed issue on 'Dither' node
      • Fixed multiple Undo issues on shader functions
      • Fixed serialization issue with both nodes and graph when hitting Unity play button
    This node by default uses Unity internal time but you can use your custom time, by adding a Float node, setting its type as property and connect it into the Flipbook's Time input port. This way you can feed a custom time value via a c# script into that newly created property and pause/play as you like.
    The tricky part on this approach is that you have to manually calculate on the script which is the current animation frame to know when to pause since you cannot send information from a shader back to the script.


    Happy shader creations.
     
    brisingre and KRGraphics like this.
  25. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,204
    @Amplify_Borba @Amplify_Paulo @Amplify_Ricardo @Amplify_RnD_Rick

    Is there a way in which I can use the Substance Sample node in my shader, and be able to drop it into my new material that uses that Shader, similar to Type > Property? Right now if I leave the "Substance Sample 0" blank, save the shader, and then choose that shader for my new material, I don't have an option to drag-and-drop a Substance into a slot.

    Thanks.
     
  26. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I'm a complete shader noob.

    How can I test the performance of a shader I've created? I want to compare its performance to the Unitys standard shader...is there a way to get metrics of this?
     
  27. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Hi! I've been finding the Toggle Switch node very useful for being able to use the same shader for slightly different situations. I was wondering if it's possible, or if it could be possible, for the toggle switch to disable/grey out all the relevant fields?

    For example here I am using the toggle switch to enable or disable using an extra opacity mask. This opacity mask uses a texture, a colour and two floats. I'd like these 4 fields to be disabled when you have the toggle switch disabled, so that it's more clear what a toggle switch is enabling and disabling.

    Thanks!

    ToggleSwitch.png
     
    BinaryCats, KRGraphics and Prodigga like this.
  28. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    That's an excellent suggestion IMO
     
    KRGraphics and sazberryftw like this.
  29. S-Miyahon

    S-Miyahon

    Joined:
    Jun 30, 2016
    Posts:
    12
    Hello,
    so I'm currently experiencing two bug-like issues with ASE related to public float properties:
    1) Sometimes the public floats on my ASE shaders get strangely synchronized, so that when I'm changing the value of one of them in the inspector, some of the other public floats change as well, and they're all sharing the same value. Reopening the Unity project sometimes fixes this.
    2) If I let the transmission of a material be controlled by a public float, the transmission on that shader sometimes increases over time during runtime. The value in the inspector remains the same (0.8 in this case), but the object in the scene eventually turns bright white. This does not happen with a private float value AKA a constant.

    Both these issues may or may not have something to do with an ASE-related error I'm getting in the console:

    NullReferenceException: Object reference not set to an instance of an object
    AmplifyShaderEditor.ParentNode.OnEnable () (at Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/ParentNode.cs:329)
    AmplifyShaderEditor.PropertyNode.OnEnable () (at Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/PropertyNode.cs:1026)​

    I'm using the latest public version of Amplify Shader Editor in Unity5.6.3.p4.
     
  30. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Hi @Crocomodo! Not sure if you're active here or I'm replying too late but I too have been wanting to create a silhouette shader.

    Can you explain what result you got with what you're explaining here? When you set ZTest to "Always", you do indeed get a silhouette, but "ZTest always" causes the mesh to render faces behind, in front, and render the mesh through everything, which I can't imagine is the desired effect in most situations. Therefore I don't see how you can use this method to get a useable silhouette shader? But if you have, please let me know!
     
    Last edited: Feb 21, 2018
    BinaryCats likes this.
  31. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you for providing the samples, they were extremely helpful!

    We've just released a new build, as per the post above, in which both issues have been fixed, feel free to download it and take it for a spin, any feedback is welcome, thanks!


    You need to assign a substance to the Substance Sample node in order for it to expose all the outputs since the output slots depend on the substance, only then you may drag-and-drop assets into the material's slots.


    Although there are a few tools that allow for a certain degree of benchmarking, such as AMD's Shader Analyzer, RenderDoc and GPUOpen, most of it boils down to experience and knowledge on shader language, as shader performance will ultimately depend on the complexity of the created networks and specific considerations such as using the lowest precision possible on each data type and performing multiplications instead of divisions, for example.

    Regarding Unity's Standard Shader performance, let's keep in mind that ASE is a visual node editor that generates Standard Surface Shaders with clean and optimized shader code, so performance-wise it will be on-par with any surface shader, with the commodity that a visual editor brings.

    As a more advanced feature, we also provide the ability to create custom shader types via Shader Templates, which allow you to build high performance shaders with only the bare essentials.


    Hello!
    You can achieve that specific type of control by using a custom inspector for your materials. https://docs.unity3d.com/Manual/SL-CustomShaderGUI.html

    We provide a few node attributes, within the node parameters, that allow you to hide certain fields in the material inspector through the "Hide in Inspector", or expose them in a simplified way, in regards to Texture Samples, through the "No Scale Offset" attribute.


    Hey there, would it be possible for you to test the latest version available for download through our website? We've released a few builds in the last couple of days with several fixes that may address the issues you're having, which are not yet available on the Asset Store.

    If the issues still manifest after updating, please send us a sample over to support@amplify.pt, we'll be glad to debug it on our side, thanks!
     
  32. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Thanks for the reply!

    It would be possible for me to use this method to create a MaterialPropertyDrawer for this, but would I have to manually edit the shader's code (as it can't be done via ASE) every time I alter my shader through ASE to add the MaterialPropertyAttribute back on the field? As code changes to Amplify shaders get wiped once you edit the shader in the ASE.

    Am I right in assuming the "hide in inspector" attribute is not accessible as a node? So I wouldn't be able to say "when this toggle switch is 0, hide in inspector. When it's 1, unhide."?
     
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I second this.
     
    Amplify_Ricardo likes this.
  34. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    @Amplify

    Hi,
    What is the status of SSS in ASE ? Is there still a chance ?
    Will ASE work with SRP HD ?
    I think that ASE has a better chance to work in SRP HD than SG to approach to ASE functionality ;)
     
    Last edited: Feb 21, 2018
  35. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Sorry guys, been busy with new stuff so I have less time to hang around but Ricardo and Borba are around so you are covered ;) ... and I'll be too if necessary.

    @brisingre
    Arnoob already explained but creating a global variable is the same as creating a regular property, the only difference being you select the "Global" type instead of "Property".

    There's at least one big issue with surface shaders, which is custom depth writing. Which I'm assuming you'll need. In vertex/frag shaders that's easy but for surface shaders unity doesn't like it very much. It seems to be only working partially. So I would say the best option is for me to implement the surface function calls into the template type, that way you can still use templates but then use the same shading you are used to. I'm a bit busy with new stuff right now but I'll put it on my todo list for sure.

    The issues with play mode and undo should have been fixed on our last build. It might not be last time we need to fix it, but at least so far we haven't found any more issues with them, please do report them if you do :]

    Finally, the idea of having different colors for shader functions is something we discussed before but decided not to do. So it's a design choice. The main argument being that we want people to know what's a shader function and what isn't. So every time you see an orange node you know you can open it and change it if you want. I have considered (and it's still not entirely out of question) to change something to signify both a category and shader function. Like having a dualtone color in a node or maybe an icon. We thought them to be too visually noisy so we ditched them for now but suggestions are welcome.
     
    antoripa likes this.
  36. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Thank You! I'll try it right away!

    Also I had a simple dumb question. About performances and optimization.
    If I use a "toggle switch" node, or a "if" node, will both of the possibilities be calculated?
    Lets says for example that if my toggle is set to "off", it only send a black color to the emission, but if I put it to "on" it goes through a very long and complicated set of nodes in order to create a complex emission map. Will setting it to "off" make the user gain performance?

    EDIT : Alright I juste tried it, the function bug is gone, functions now work normally with 3DTextures.

    However, I still have the problem of the textures not displaying the right color when nothing is in its input...
    I join you 4 3DTextures of 2x2x2, each with the default colors (black, gray, white and bump) in case it can help you.
    Let me know if you manage to fix that one, and thank you for the good work!
     

    Attached Files:

    Last edited: Feb 21, 2018
  37. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    In order to use a Custom Editor with an ASE Shader, we provide a Custom Editor parameter in the Output Node, under the General Tab, where you may add a reference for your own custom editor, you won't have to do it by editing the shader code.

    Your assumption is correct, attributes are not accessible as a node, so it wouldn't be possible to do that.


    Hello, are you referring to any specific SSS technique? Ase provides a translucency output for achieving a similar effect.

    Ase will definitely work with SRP HD! Along with a few other major additions, it will be possible to create SRP compatible shaders with ASE.


    No problem! Not a dumb question at all, using an "If" node is always more expensive than using a "Toggle" node, since the toggle works somewhat like a lerp operation, and they both take into account all the operations connected to them, which will affect the final performance.

    I believe that what you're looking for is the Static Switch node, which performs according to your example, where you may use Keywords in order to allow multiple shader variants without any performance hit. Depending on your project and intended use, you may also consider using LODs instead.

    Regarding the issue, I've tested and confirmed that the default colors are not showing up correctly after removing the 3DTexture from the sampler input, thank you for your feedback and apologies for the inconvenience, we will fix it as soon as possible!
     
  38. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    I think about something similar to subsurface scattering from SRP HD.
    Only Idon't understand why thereis no place in that Unity solution for specular maps ?
     
  39. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,267
    How would you have the snow go from top to bottom instead of bottom up?
     
    blitzvb likes this.
  40. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi,

    I got a strange problem where out-of-the-box SimpleGPUInstancing example isn't batching on Unity 2017.3.1 + macOS, and the problem is "the object has a different MaterialProperyBlock set".

    This is weird because I have made other GPU Instancing example work.
     
  41. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Great thanks for the info. :)

    However, doing it via custom editors means I would have to write an editor which drew each field from the shader, and for the relevant ones do a check if it should or shouldn't draw that field. Whenever a new field got added (or removed) from the shader, the editor would need to be updated - to draw the new field(s). This would become a bigger issue the more shaders I use this for.

    Using property drawers would be more flexible, which I think would require ASE to support adding custom attributes (with parameter input) to nodes so this could be saved into the shader code. This way would mean I would be able to apply custom material attribute drawers to many nodes and not have to worry about updating the custom editor.


    Out of curiosity, why would you ever choose to use a "toggle switch" over a "static switch" if this is the case? Am I missing something or does a static switch do exactly what a toggle switch can do and more? :)
     
    BinaryCats likes this.
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I think he means in regards to skin shaders like Pre integrated Skin Shading like most games have.
     
  43. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Upon further investigation of this last issue, we've concluded that it comes from Unity itself as it lacks default textures for 3D Textures, even though it accepts setting them. Unfortunately, we will most likely have to remove the "Default Texture" option when the texture type is "Texture 3D" in order to avoid any confusion, this way Unity will always default to white.


    Common Subsurface Scattering techniques requires specific calculation not present in the Standard Unity shader; simply put that's why a SSS input is not provided. Given the complexity and processing cost of SSS, developers usually resort to optimized approximations such as the Translucency sample included in our package, or similar techniques.

    A "true SSS" shader could involve creating a dedicated shader type for ASE, a considerable amount of work that, unfortunately, we cannot take on at the moment.


    You would have to use a World Position node in the Snow Coverage Effect Calculation, I'm sending a Shader Function attached to this reply that provides an example on how to achieve this, just replace the aforementioned calculation's node setup as per the screenshot provided.

    Function_InvertedSnowCoverage.zip






    Hello, could you provide us a sample with the issue present so that we may debug it on our side? If possible, send it to our support@amplify.pt email and we'll keep in touch through there.


    The custom editor can loop over all the properties defined in the shader and put them into the inspector, meaning that you won't have to make any changes to the shader itself or frequently update the editor if you use the same naming convention for your properties in your other shaders. You may then have the editor selectively draw only the properties you need in the inspector.

    Material Property Drawers are great, we may consider adding support for users to add their own attributes to shaders, however, they do have the drawback of giving compilation errors on shaders if any attribute is missing in your project.
    I've registered your suggestion as it's pretty valid, the developers will look into this as soon as they're available, hopefully in the near future, thanks for sharing it with us!

    Regarding your last question, both nodes are useful in different contexts, the Static Switch node uses Shader Keywords for its operations, which allows for several variants of shaders to be set up according to their type ( Shader Feature / Multi Compile ), the catch is that the use of Keywords is limited to 256 in Unity, and about 60 are already being used internally, you can read more about this here.

    The Toggle Switch node works through a toggle value set on its internal property, acting like a Lerp operation, in which both inputs are always being processed by the shader, it's not the most efficient method but it has no limitations on its use other than performance considerations.

    Ideally, you would make use of the Toggle Switch if you do not require any specific feature offered by the Static Switch node and if the operations are not overly complex; as with standard Lerps, this node should not be overused, even though it's pretty handy.


    Yes, it's easy to confuse shader types and techniques. If Unity had a standard for SSS, we would've already provided the means to use it with ASE as we do with Tessellation.
     

    Attached Files:

    Last edited: Feb 22, 2018
    Rowlan likes this.
  44. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We've uploaded a new build into our website.

    This version is also available at the Unity Asset Store.

    Here are the release notes.

    Release Notes v1.4.5 dev 01:
    • New Shader Function:
      • Constant Bias Scale
    • Fixes:
      • Fixed null pointer issue with removing connections with Alt key
      • Fixed issue on 'Template Local Var' node only working on fragment function

    Again, be sure to check out the cool new Skybox - Cubemap Extended sample from our community member @BOXOPHOBIC.

    Here's a glimpse of it in action.



    Happy shader creations!
     
    Last edited: Feb 23, 2018
  45. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
  46. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    508
    Small correction @Amplify_RnD_Rick, actually Skybox - Cubemap Extended is included in the package :D
    Thanks for including it, I hope people will find it useful. Also the keyword enum and the new shortcuts are really helpful !
     
  47. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    No worries, we'll update our posts ASAP!

    Sorry about that, I think we got our wires crossed here ;)

    Thank you once more for your contribution.
     
    Last edited: Feb 22, 2018
  48. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    @Amplify_Borba

    I see a dissolve shader example, but I'm wondering how I could make a vertical dissolve where an object disappears from the top down to it's bottom in a straight line rather than just random areas dissolving?
     
  49. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Thanks for this, will look into it. And thanks for sharing with the devs. :)

    Thanks for the explanation, makes a lot more sense now.
     
  50. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    You could use the Vertex Position node, I've set up a quick example using this node in a setup below the Opacity mask in order to add it to the current effect on the DissolveBurn sample. Please refer to the following screenshot, which includes the Remap values in the node properties tab.




    Always glad to help!