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

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    Please if anyone can help with the above? @Amplify ???
     
  2. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    what exactly is the microsplat integration? can i edit the shaders or can i create shader microsplat works with? examples?
     
  3. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Been playing around with the template feature, very cool.

    Came up with our own custom lighting shader, complete with a custom shadow pass.

    I allow the user to provide a vertex offset, so I need to mirror the offset code in the shadow pass. I noticed in the documentation that you can link output ports.

    This works fine, but only if I make the change while the shader graph is open. When I close the shadergraph and open it again, and attempt to compile my shader using my template, I get a null exception.

    While the shadergraph is open, if I remove the output linking tag, go back to unity, back to my code, and re-add the output linking code, the shader compiles properly again. But, soon as I close the shader graph and re-open it, I get the same null exception.

    I attached the debugger, and "InterpData" is null.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. AmplifyShaderEditor.TemplateMultiPassMasterNode.CollectData () (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPassMasterNode.cs:758)
    3. AmplifyShaderEditor.TemplateMultiPassMasterNode.BuildShaderBody () (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPassMasterNode.cs:705)
    4. AmplifyShaderEditor.TemplateMultiPassMasterNode.Execute (System.String pathname, System.Boolean isFullPath) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPassMasterNode.cs:736)
    5. AmplifyShaderEditor.MasterNode.Execute (UnityEngine.Shader selectedShader) (at Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/MasterNode.cs:457)
    6. AmplifyShaderEditor.ParentGraph.FireMasterNode (UnityEngine.Shader selectedShader) (at Assets/AmplifyShaderEditor/Plugins/Editor/Graphs/ParentGraph.cs:2511)
    7. AmplifyShaderEditor.AmplifyShaderEditorWindow.SaveToDisk (System.Boolean checkTimestamp) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:1394)
    8. AmplifyShaderEditor.AmplifyShaderEditorWindow.OnToolButtonPressed (AmplifyShaderEditor.ToolButtonType type) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:1488)
    9. AmplifyShaderEditor.ToolsWindow.OnButtonPressedEvent (AmplifyShaderEditor.ToolButtonType type) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/Tools/ToolsWindow.cs:206)
    10. AmplifyShaderEditor.ToolsMenuButton.Draw (System.Single x, System.Single y) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/Tools/ToolsMenuButton.cs:172)
    11. AmplifyShaderEditor.ToolsWindow.Draw (UnityEngine.Rect parentPosition, UnityEngine.Vector2 mousePosition, System.Int32 mouseButtonId, System.Boolean hasKeyboadFocus) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/Tools/ToolsWindow.cs:234)
    12. AmplifyShaderEditor.AmplifyShaderEditorWindow.OnGUI () (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:4245)
    13. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
    14. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    15. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
    16. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <f826c2584fc94ec19a48a6576640bdc5>:0)
    17. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    18. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    19. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:261)
    20. UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:390)
    21. UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:237)
    22. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:380)
    23. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:359)
    24. UnityEngine.Experimental.UIElements.EventDispatcher.PropagateEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:500)
    25. UnityEngine.Experimental.UIElements.EventDispatcher.DispatchEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:345)
    26. UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:243)
    27. UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:74)
    28. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:171)
     
  4. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    More messing around... trying to debug the issue...
    I dont think it is related to linked outputs or anything. Seems to just be an issue with multipass templates.

    To Repo:
    I can only compile my multipass shader if I edit the template source file WHILE the shadergraph is open with a shader using that template. If I close the shadergraph and re-open it, I can't compile it until I open my template source file and make a change to it. When I come back to unity, I get the 'compiling scripts' popup (Assuming this is Amplify 're-scanning' my template), and then I can just hit build in the shadergraph and it works fine. Soon as I close the shadergraph and re-open, I get the nullexception again.
     
  5. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Opps, Just figured it out I think. One of my passes (Shadow pass) was missing
    Code (CSharp):
    1. /*ase_frag_code:i=v2f*/
    Which I has omitted because...well.. I figured it's pointless. It appeared to work but actually was generating the bug I described above.
     
  6. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Do you have any kind of beta for the HDRP yet that i could use??
     
  7. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    Hi @Amplify_Borba and @Amplify_RnD_Rick

    I attempting to implement height based blending into the basic sample terrain shader which I have already added distant UV mixing on, however I am stumped on adding height map based blending, can anyone point me in the right direction?

    Here is my current graph.
    upload_2018-6-23_23-36-40.png
     
  8. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hello everyone, just a quick reminder that the team was away for Unite Berlin, we'll get back to everyone on Monday!

    Thank you for understanding!
     
  9. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! I'm sending a sample package that will hopefully help you out, it includes a scene with a properly setup camera and the requested shader.

    NormalsSample.zip

    Do note that the SetupCamera script must be present as a Camera Component in order to have it generate normals.

    The Transform Direction node should be at the end of the node network, with the Decode View Normal Stereo node's output connected to its input.

    Please let me know if this helps, thanks!


    Hello! The circle you see is a wire control point, which is used to help organize the wires. You may add it by double clicking on top of the wire then just drag it to the intended position.

    I'm attaching the sample shader from the screenshot, it's working as expected on our side.

    SimpleUITest.zip

    Please let us know if this works out for you, thanks!


    Hello, thank you for getting in touch and for your interest!

    Let me start by assuring you that we have no plans to discontinue ASE development, we have quite a few innovative features and improvements in development for 2018!

    We've actually approached this subject before, in sum we’ll definitely keep an eye on Unity's Shader Graph development for any relevant features and conventions that it might introduce. In any case, our development path somewhat differs from what Unity currently offers. You can count on us for mature and future-proof shader development, always with responsive support and blazing fast iteration times that you can expect from Amplify Creations. We also offer over 60 free shader samples that you may use and modify to your liking.

    ASE already supports the creation of Lightweight SRP compatible shaders, and this sort of integration is beneficial as it defines standards and pushes us all to improve our products. We believe that we can coexist since there will always be a demand for unique products with distinguishing features.

    More information in the following sources:
    http://amplify.pt/a-growing-family-of-products-created-with-amplify-shader-editor/
    https://forum.unity.com/threads/bes...der-creation-tool.430959/page-59#post-3408785

    Please let me know if you have any further questions, thanks!


    Hello!

    There are a few ways to approach a glass shader setup, you could definitely use a transparent shader with rain drop normals for droplets and streaks being lerped by an panned mask for an animated effect, as you can see in this example.

    We've actually shared a shader sample in this previous post for a glass material with metallic parts set through a mask, which should provide a good starting point, and there's also an awesome community submitted "Command Buffer based Refraction" shader in our wiki.

    Please let me know if the above references help, thanks!


    Hey there Laurens, we've had a great time at Unite, thanks!

    Regarding the issue you've reported, I've just confirmed it on my side and will pass it along to the developers for further investigation, thank you for taking the time to report it!


    Hello, there's no sort of MicroSplat integration with ASE, only MegaSplat, where did you come upon that information if I may ask?

    Regarding MegaSplat integration, you simple need to have both assets in the same projects, and you'll be able to use MegaSplat specific nodes in ASE, allowing you to use its technique in your own shaders.


    Hey there, thank you for letting us know that you've managed to sort out the issue!

    Please let us know if you come across any further issues.


    Hello, thank you for taking the time to report this issue, I've just passed it along to the developers for further investigation.

    We'll get back in touch as soon as we have any developments, thanks!


    Hello! Unfortunately, we don't have any HDRP sample to share at this time since we're still working on adding support for it.

    Rest assured that it should be coming soon, so stay tuned!
     

    Attached Files:

    brisingre and KillerNads like this.
  10. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey there, could you share any additional details, just to be sure we're on the same page?

    Do you mean height blending between textures, height blending based on the actual terrain topology, or something else entirely?

    Thanks!
     
  11. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I saw this talk on how to do what they call BlendAdd for Diablo 3.
    (
    ),

    It would be a very useful shader to use for any fx as it doesn't have the drawback that additive/soft additive blending has. People mention it in VFX forums a lot but most of them don't know how it's done and others have varying takes on it.
    (https://realtimevfx.com/t/additive-alpha-blend-in-unity-shaderforge/2151)

    How do you guys think this shader is done? I'm very curious about this one :)
     
  12. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hey there, ran into another issue, first the setup:

    We wrote a template that has 3 passes. A forward base pass, a shadowcaster pass and a meta pass.

    The forward base and the meta pass are both visible and have paramaters. This works fine.

    The ShadowCaster pass is a hidden pass (ase_hide_pass).

    I'm not sure if it's important for this bug but the shadowcaster pass is between the forward base and meta pass in the template.

    Now the bug:

    Amplify seems to stomp over the name and LightMode of the hidden Shadowcaster pass. In the template, the shadowcaster passes name is Shadow, it's LightMode tag is set to ShadowCaster.

    When I compile my shader, Amplify replaces it's name with "Lightmap" and it's LightMode with "meta". Exact the same values as our meta pass.

    Because the shadowcaster pass is hidden, there is no way for us to "fix" this issue or even cause it in the first place.

    The work around was to not make it hidden, manually correct the Name and LightModes in the sidebar (when I removed ase_hide_pass, and selected the shadowcaster pass in the node graph, it still said it's name was Lightmap and LightMode was Meta, which is wrong, and I never whereen those values. I had to manually change it back).

    This bug prevents my shadow casting from working correctly.
     
    Last edited: Jun 25, 2018
  13. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Hello!
    How has the week at the GDC been?
    Thank you for this.
    However, it doesn't seem to work as intended. The sphere only appears as a solid color.

    upload_2018-6-26_3-17-55.png

    What I am trying to get is the world normal pass in a postprocessing shader, in order to add the lighting from 6 custom runtime baked 3D textures (one for each direction).
    Is it what it was supposed to do?

    Anyway, thank you a lot for your support!
     
  14. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    This might be a bit off topic. I'm wondering if it is more performant to make your own shader rather than using Unity's build in if you only need emission and opacity for example.
     
  15. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! From what we've seen, there seem to be quite a few different takes on how they've achieved this shader and, while we can't be too sure ourselves without some further investigation and testing, this GitHub shader seems to be a very useful reference.


    Hello, could you please share your template privately with us through support@amplify.pt, so that we may further investigate this on our side?

    Thanks!


    Hello, the event went pretty well, we were thrilled to meet many users of our assets!

    The result you're having is unexpected as the sample sent was working on my end, are you using the latest ASE version, currently available for download through our website?

    Also, did you open the scene I sent in the package? It contains everything correctly setup, including the camera with the SetupCamera script, which must be present as a Camera Component in order to force it to generate normals.

    If you're still having trouble, could you send us a simple sample through support@amplify.pt, as it's possible that you have stumbled upon an issue?

    Thanks!


    Hello, thank you for your interest!

    Yes, you can make your own custom shader, either by using the Custom Lighting setup or a Shader Template, you can create efficient and mobile friendly shaders. We also support creating shaders compatible with Unity's Lightweight Render Pipeline, which targets mobile platforms, VR and games developed with limited realtime lighting needs.

    On a final note, the actual shader performance will always vary depending on the actual constructed node network complexity and the features used, so you can also use a Standard Surface Shader and remove all the options you don't need from it, while also setting a lower precision for its calculations for an additional performance boost in exchange for some accuracy.

    Please let me know if you have any further questions, thanks!
     
    summerian likes this.
  16. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Hello yes I am using the latest version of the package ( v154_001 ) but it still does the same thing.
    I am also using unity 2018.1.6f1 (not a beta beta version)

    upload_2018-6-27_1-39-10.png

    Here you can see the camera setup, it is from the provided scene.
    Also, in your scene the custom shader is setup on a material on the sphere, and not on the camera postprocessexample. Maybe the problem is coming from here?

    upload_2018-6-27_1-43-22.png

    Maybe is the problem coming from that?

    Anyway, thank you again for your support, I know you are doing your best!
     
    FeastSC2 likes this.
  17. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
     
  18. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    Thank you so much, the first example you provided, greatly helped me to create the effect that i was looking for!

    One question though that i have is instead of using UV's how can i use the direction instead? Do i need to use Triplaner?
     
  19. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    This... I... wow, I actually and accidentally created something that can help somebody?
    Glad to hear that this shader is worth something, I spend quite a long time trying many different techniques and talking to other devs trying to achieve this effect. But as the comments on the github page seems to indicate, this seems to be solvable with only one pass. Maybe I'll try this out on the weekend and upload an updated version.

    That being said, it doesn't seem like this (general) "blend add" shader technique is really popular used in other games out there and I'm uncertain to why.
     
    zyzyx likes this.
  20. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    No problem, here to help!

    I've just tried importing the sample into a new Unity 2018.1.6f1 project, and it immediately shows the expected results as I open the scene, so it might be somehow related to your project. I did notice that you have an error showing in one of the screenshots, sometimes certain project errors might interfere with package importing and shader compilation.

    Could you please try creating a new, empty project and only importing the sample I've sent, to see if the above might be causing the issue? Thanks!


    Glad you found the examples useful!

    Could you share additional details regarding the specific effect you have in mind, and why you'd rather not be using the UV's?

    We might be able to provide some better insight if we know exactly what type of effect you're planning to create.


    Hey there! We believe that every contribution counts, which is why we also do our best to give back to the community, be it through additional free samples for ASE ( currently 60+ ), bundled in the main package and sometimes shared over our forum threads, through providing full source code for our assets, or even releasing free assets such as the Fake Interiors.

    So thank you for having shared that shader sample, we have no doubt that it has been helpful and inspiring for those who came across it, and we'd certainly love to see an updated version of it!
     
  21. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    The effect is fine, its just putting the shader and material to the window object in my 3d model doesnt work. The modeller said that I probably created it with UV Panning and that instead i need to create the shader with UV Maps?!

    He only said the below if that makes any sense to anyone:
    "Unity's shaders read UV only, so you'll need to create a triplanar shader to map your textures on the glass windows"

    If you can understand what that might mean please let me know, otherwise i will go back to him to ask for further information!

    Secondly, on my window i now have a window dirty effect texture on the emission, water dripping effect on normals, a transparent background on the opacity and also a static water droplets normal texture that stays sitting on the glass. What is the best way for me to animate this water droplets normal texture, so that it appears and then the water drops fade away from the window after 1 second or something??

    Thanks for your help!
     
  22. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    Feature request: What would you think about renaming the Commentary function to Group or - in order to stick with C - Container? I was just searching how to group nodes. I would have never guessed that this is done via "Commentary". Commentary isn't usually a container, it's just a label with text.

    A question: Is it possible to create reference nodes? Just in order to avoid edges spreading all over the graph. Example: I have a Texture2D node with a texture in it. I'd like to use it on multiple positions in the graph without creating edges from always the same node. I rather prefer I create a reference node (kind of a duplicate) that's actually the same as the node it's pointing to.
     
  23. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Although I'm not entirely sure how your models are setup, you'll need appropriate UVs in order to achieve this type of effect as per the examples shared.

    Regarding the animation of the droplets, there are a couple different ways to do it depending on how the specific effect you want to achieve, for example animating shader properties or doing it through a specific node setup, making use of nodes such as the Sin Time in order to produce an effect that fades in and out.


    Hello, thank you for the suggestion, we've planned on extending the functionality of the Commentary feature sometime in the future and all feedback regarding this is welcome!

    Regarding your question, you may use the Register Local Var and Get Local Var nodes to help organize your node networks or, in case of the Texture Samples, you may create additional Texture Samples and set their Mode parameter as Reference, allowing you to pick another Sample node as a reference.

     
  24. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    If i email you my shader file and textures im using do you think you can help me with setting this up? If you can, please send me your email address and i will email the files across. thanks
     
  25. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    Thank you, that helped. Where in the user interface can I find the "Comment" option? There is no button on the UI, nor is there a mouse popup menu available. I only found it by trying out everything. I found this:
    • [C]: Create Commentary
    here, but without a screenshot:

    http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Manual

    ASE is really awesome tool, but the documentation could need some more work. Also the naming. I tried the Texture Sample Reference and it works, but the Node got now a text "(Instanced)" appended to it. An instance is something totally different than a reference. Why is it called Instance when I made a Reference?
     
  26. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    How do you correctly blend normals? I found some answer of this already asked question, but it doesn't seem to work. This is what I did:

    normals.png
    But it results in artifacts. I filtered the normalize node's image colors, so that blue isn't visible and resized the node, this is what it looks like:

    dot.png

    ie there's a black dot in it.

    The end result with "Normal Blend" set to 0 looks like this and has black artifacts:

    normals-ugly.png

    Of course something could be wrong with my generated normal map. Any idea how to find that out? But then again, I thought the normalize node would take care of that problem.
     
    Last edited: Jun 28, 2018
  27. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    how do i create a custom camera filter/screen effects on amplify ?
     
  28. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I don't think that would be necessary, if you want to project it directly you can do so using the World Position node.



    Using a Triplanar shader seems a bit overkill in regards to performance, but it really depends on your project.

    Make sure that your windows have simple planar UVs so that you can easily manipulate the effect you're looking for ( this is done in your authoring tool, e.g. Blender, Maya ).


    No problem! Apologies for the lack of information on the wiki pages, these are still work in progress and we do our best to update them as frequently as possible, usually taking into account user feedback. To set up comments, you simply need to select one or more nodes, then hit the 'C' key, and you may also select the Commentary box and access its parameters to further customize it, as per the screenshot below:



    Regarding the Texture Sample Reference, you have raised a pretty good question, I'll be sure to bring this to the attention of the developers since having the References named Instances it can lead to confusion, thank you for your feedback!


    Hello! Paulo has given a pretty thorough answer to a similar post, which you can check out by clicking here, where he explains three methods of properly blending normals.

    Please let me know if this helps, thanks!


    Hey there, you'll need to make use of our Post Process shader template when creating a shader, which can be accessed by changing the Shader Type in the Output node parameters.

    We also provide two samples that you can use as a starting point or to learn more about how to build your own post processing shaders, which can be found in the AmplifyShaderEditor > Examples > Official > TemplateExamples > PostProcess folder.
     
    KillerNads likes this.
  29. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    Hi, I meant height blending between textures based on a heightmap:)
     
  30. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    Great! thanks!
     
  31. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there!

    We provide a simple Height Map Texture Blend node as a starting point but you'll have to implement your own solution for more complex effects.

    Here's a simple example for Scale and Offset control driven by vertex color. The top Append node receives 3 different height maps which are used to output the final result used to Lerp between different textures; each channel individually of course.

    upload_2018-6-28_18-24-59.png

    Be sure to check the link below for additional information on how to blend textures based on their height.

    http://untitledgam.es/2017/01/height-blending-shader/

    Thanks!
     
  32. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    Thank you, just a question do i use the world position and the component mask instead of texture coordinates? or do i need to use them togather? Because at the moment in my shader i have texture coordinates going to the UV of my texture sample, which is a Emission (im not using Albedo in this shader).

    Thanks
     
  33. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there, no problem.

    That really depends on what you're trying to create. Do the models have any uv's set up?

    Thanks!
     
    Last edited: Jun 29, 2018
  34. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    IMHO I think it would be a very useful feature if you could easily change between types of variables and mantaining name, values, type (constant, variable, etc), conections, precission, etc.

    For example, If you have a vector2, and then you want to change it to Vector4, there could be a dropdown list when you select the variable that allows to change it to another type of variable, and would mantain the original X and Y value. Or maybe something like the append node.

    Is just an idea that I think it would be helpful. :)
     
  35. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    Im not to sure about that, i will try and find out from modeller.

    One other question i have though that i need help with on this shader is that im trying to apply a texture with alpha transparency, however the texture is not appearing correctly. Texture appears correctly in the side bar when viewing textures in unity, however applying it in the shader gives a weird issue on the texture where it was supposed to be transparent. Please can you have a look at the images below and tell me if i need to something else?

    Thanks

    Water Droplets Shader.png


    Dirt Texture.png
     
  36. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    how to produce "texloc" in unreal into ASE?
     
  37. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for the suggestion!

    I believe this is possible to achieve, I'll be sure to pass it along to the developers for consideration.


    If you're refering to this tutorial, that TexLoc is simply a parameter name for a Vector 3, into which a value is being passed manually.

    In ASE you can simply create a Vector 3 and pass a variable such as the player position or an object's position to it through scripting, you can check out our Smear sample to see how this can be achieved.
     
  38. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hello,

    I definitely recommend looking into UV's, they are crucial for shader development.

    The Texture Sample node will not display transparency there but you can display the Alpha Channel by clicking the A(Alpha channel button). If you want to use transparency from that specific texture you'll have use its Alpha channel directly, how you plug it into the Opacity or Mask input depends on the effect you intend to create.

    upload_2018-6-29_12-19-8.png

    Hope it helps, thanks!
     
  39. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    Hi, thanks for your reply but I couldn't really work it out this time.

    Yes when i press the A button on the texture sample, i get the transparent look i require for my effect, but i never see that when on the object (a 3d cube). The transparent (alpha) section is all messed up?! Hence, according to my images i sent above, are you saying that i should link my texture alpha output to the opacity input? Okay i tried that too, see new below image, i've added the alpha as part of the opacity, but still get a weird looking image, instead of the transparency something weird is happening to the texture.

    Why isn't the textures in sections labelled 1. and 2. looking the same? How can i solve this? thanks.

    Window Shader.png
     
  40. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We just uploaded a new build into our website. We internally had to bump the version more than once thus passing from dev 01 to dev03.

    Really glad to resume our weekly build uploads to you guys.

    Here are the release notes.

    Release Notes v1.5.4 dev 03:
    • New Shader Function:
      • Color Mask
    • Fixes:
      • Fixed issue on template Unlit SRP generating an error when creating a Color or MainTex named property
      • Fixed issue on both 'Surface Depth' and 'Camera Depth Fade' nodes when inputting a custom vertex position
      • Stencil module on Pass now uses SubShader Cull mode if it's not specified on it
        • Important since Cull determines if separate stencil ops are show for each face
      • Fixed issue with Fallback shader selector not updating if its textfield is focused
      • Fixed issue on Grab Pass only being registered on first pass when on multi-pass templates
    • Improvements:
      • Added auto register option into 'Grab Screen Color' node
      • Adding UsePass support
        • New Additional Use Passes section on both Surface and Template output nodes
        • Can add UsePass before or after Surface code via a Location dropdown
        • On Templates the Bellow location is still under development and its not available
    Happy shader creations!
     
    brisingre and hopeful like this.
  41. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    How to go about creating multiple shaders from a single shader as variants with Amplify, is there anything that I should know when doing this?

    Since it's my understanding that shaders will compute every node you create despite creating if or toggle switch nodes, I've seen people create variants of shaders where they will implement only parts of a shader and based on a C# script pick the shader with the minimal required amount of nodes so that no computation is lost.

    Here's what I want to use it on:
    upload_2018-7-1_3-21-35.png

    This shader has multiple groups of effects and the user can pick which effect he likes from the C# script using buttons:

    upload_2018-7-1_3-22-52.png

    Now I must create variants of this shader based on these options. Right now since there's 8 options and since they can be picked in any permutation it's going to create a lot of variants: 36 variants of that shader.


    What can I do to go about creating these variants in a smart & effective way?
     
  42. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hi guys

    Just had some suggestions

    1. Templates: It would be nice to be able to hint that an ase_local_var is a color (RGB/RGBA) instead of a vector (XYZ/XYZW) so that it appears as the correct 'type' in the node graph. I understand internally they are the same thing, but it would just be a nice bit of polish for the node graph when using shader templates
    2. It would be nice to have a toggle between RGBA and RGB output for the Color and Texture Sample nodes.
      • We realized that a lot of our color related shader work was being performed on Float4's, even though we never ended up using the alpha component at the very very end. So we are performing computations for a component that we will end up ignoring at the end. Potentially '1/4' of 'all the work' is spent on the alpha component which we dont need to do. We've been adding Swizzle nodes at the start of Color properties and Texture Samplers and selecting RGB, ignoring A.
     
    arnoob likes this.
  43. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey there! Since you intend on using two different materials, glass and dirt, you need to set specific values for each material and blend them into the required input ports; as is, you're simply altering the dirt final opacity.

    Here's a sample to help you get started: Dirt.unitypackage


    Hello!

    I believe that what you're looking for is the Static Switch node, where you may use Keywords in order to allow multiple shader variants without any performance hit. Also, check out Unity's multiple shader variants reference, which provides further information regarding this subject.


    Hello! Thank you for taking the time to share these suggestions with us!

    1. I'll have to check this one out with the developers and get back to you!

    2. The operations done between float3 or float4 are exactly the same, you can verify this on your side by comparing the instructions with and without the swizzle node, the results should be identical. In sum, Toggling between RGB and RGBA would only be a visual change, since there would be no gain in terms of performance.
     

    Attached Files:

    arnoob and FeastSC2 like this.
  44. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Is there or will there be a way to prevent transparent objects from drawing overlapping faces?

    There's a trick you can do if you write shaders manually where you include a pre-pass writing into the depth buffer, getting this result:

    TransparentDiffuseZWrite.png

    Code (CSharp):
    1. Pass {
    2.     Zwrite On
    3.     ColorMask 0
    4. }
    It would be very convenient if this was just a checkbox in ASE, that works with regular as well as tessellation shaders.

    Thanks for your time.
     
    Last edited: Jul 2, 2018
  45. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Just heard back from the developers on your first suggestion, and they say they completely understand this request.

    Like you said, from the shader standpoint there is only a float4 data type. Since the main goal with template tags are for them to be as small and less intrusive as possible, they've decided to always parse the line automatically and fetch the data type.

    For ASE to know if a float4 is a color or a position/direction, that tag definition will need to be tweaked in order to add additional info to explicitly tell what it represents.
    What can be done in regards to this is to make this info optional, so the template creator can decide if it automatically fetches the data type or reads the specified one. Of course this will only be possible for float4 since it doesn't make sense for all other data types.

    We've registered your suggestion, hopefully we'll be able to tackle it in the near future, thank you for sharing it with us!


    Hey there, we already offer this feature, specifically through a toggle-able Extra Depth Pass parameters in the Output node:

     
  46. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Thanks for pointing that out!

    This feature does however unfortunately not seem to work with tessellation.



     
  47. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    Thanks for that, it helped me to fix the issue i was helping!
     
  48. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    @Amplify_Borba

    Sweet, looking forward to it.

    Regarding the RGBA/RGB thing - I tested it, and you are right. The compiled shader code is intelligent enough to omit the components that are not used. Very cool!

    We ran into an issue today using templates. The 'RenderQueue' field on the material resets back to 'From Shader' every time when we build the shader.

    We tried:

    Removing the Queue tag from the SubShader Tags list and setting it on the material. When the shader is rebuilt in ASE, the value on the material reverts back to 'From Shader (2000)'
    Including a Queue tag in the SubShader Tags list and overriding it on the material. When the shader is rebuilt in ASE, the value on the material reverts back to whatever Queue you had specified in the SubShader Tags list.

    Basically, you can't change the 'RenderQueue' on the material itself. It always gets stomped over and reverted back to 'From Shader'.
     
  49. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Also, is it possible to have the 'SubShader Tags' editor for 'Queue' Provide a dropdown list of options so we dont have to manually type 'Transparent' or whatever? Maybe a 'Custom' one to let users type in their own value if they want to (ie 'Transparent+10'
     
  50. KillerNads

    KillerNads

    Joined:
    Jan 22, 2017
    Posts:
    70
    @Amplify_Borba thanks for all the help youve provided thus far. I've almost completed my dirty rainy window glass shader now!! :D

    Theres just one issue however, when applying this shader to a default 3d cube, some sides of the cube have panning of the rain going downwards direction correctly, however some sides of the cube have the rain drops animating wrongly and going upwards instead or even one side has it animating from right to left?!?

    Is there a way in the shader for me to always make the panning go downwards on the surface?

    Please if you could help me with this?

    thanks so much!