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

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    Obrigado for the help and for the package guys, I didn't know it :). I'll take a look.

    But I've noticed it's possible by feeding the position I want (the viewport point (0.5, 0) in world coordinates) via script (as a global variable).
    Since every vertex is moving at, almost, the same speed, the distortion it's almost unnoticeable (well, the particles are beeing scaled down, btw) but I really like the effect.
    Sorry, I possible formulated my question wrong. My question was more about if its possible to transform a certain viewport or screen point to world coordinates inside the shader. I feel like I'm missing some node.

    But I think it's a bit silly to calculate the same point for each vertice, and it should be far more optimal to feed the position via script. But I'm curious if it's possible, for future effects I have in mind.

    Thanks again :)
     
  2. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    De nada, hope you find it useful!

    Regarding your question, although its possible to do it via shader, it can be a bit complex to achieve as you would have to reconstruct world position from the depth buffer. In this particular case, it's much simpler to use a script to the determine the world position value.

    Hopefully we can add something along those lines to the included Reconstruct Shader Function but, unfortunately, it's not something that we can tackle at the moment, apologies for the inconvenience.
     
    Suzuka91 likes this.
  3. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    how to use the "projector clip matrix" for a shader for the unity projector?
    theres no doc on the wiki on it
     
  4. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Apologies for this, even though most nodes are populated our wiki page is a work-in-progress and newly added nodes might take some time do be detailed in the wiki. We'll be sure to fill in the missing information as soon as possible.

    I'm going to share a sample template that makes use of matrices to implement a light projector, hopefully it can help in the meantime:

     

    Attached Files:

    Mister-D likes this.
  5. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    the fallof and texture transparancy doesnt work.
    i basicly want to use it for decals (like bloodsplat > see screenshot)
    is it even possible to add a normal map to the projector material?
     

    Attached Files:

  6. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    i got the transparency working
    falloff texture works too , but no fog support or lighting and projection doesnt get clipped but its tiled
     

    Attached Files:

  7. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    setting the texture to clamp made the tiling dissappear :)
    but still no fog or lighting working
     
  8. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I've just tested the sample I've sent, and everything seems to be working on my side.

    What type of fog effect are you using? Is it Unity's built-in?

    Could you send me a sample with the issue present so that I can investigate it?
     
  9. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    ive attached my shader, lighting is weird
     

    Attached Files:

  10. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Hi, so Im working on an optimized character shader for a networked game. My base skin textures (diffuse, normal, etc.) are 4k which will be used by all players. I would like them to be able to swap out texture masks, such as eyebrows, but I don't want to use a 4k texture mask for each eyebrow.

    I was thinking about using a 1024x512 texture mask, and re-positioning it within the shader to place it correctly. Is it possible to do this, both positioning and a non-square texture? If so, what nodes do I use?

    If someone else has another suggestion, please let me know...

    Thanks!
     
  11. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I've noticed you've changed the shader type and blend mode, you'll likely need to adjust it. Can you share a screenshot of the current issue on your side? Before we proceed, would you please provide more detailed information regarding the specific effect you're trying to achieve, and if there is any reason in particular for wanting to use Unity's projector instead of a decal system for the blood splatter?

    Additionally, if you want to simply hide the projector, there's no need to set it to transparent and adjust the opacity, simply use the Falloff multiplier along with a the Normal Intensity value.
     
  12. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, it's possible to define where you want a surface to be masked by correctly offsetting its UV coordinates, which can be done through the Texture Coordinates node.

    We provide a few masking samples that you can examine, such as the MaskedUI, which specifically offsets the UVs for the wave effect.

    Please let me know if this helps, and if you have any further questions, thanks!
     
  13. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    i want to create a projector shader that supports normal and specular maps
    im not using a decal system because i cannot code that and its for a package i want to sell. i will also scale it and fade it away over time.
    ive attached a screen
     

    Attached Files:

  14. Panicpancho

    Panicpancho

    Joined:
    May 23, 2018
    Posts:
    1
    Hey!! I'm trying to work on a water shader in Unity 2018.1 using the lightweight spr.. I was wondering, How can I change from opaque to transparent, and is there a way to show things like specular-opacity-and other pbr materials settings? I just bought the Amplify asset..so I'm kind of lost
     
  15. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    As I've previously mentioned, since you've changed the shader type and blend mode, you'll likely need to adjust it in order to accommodate for the new setup. Try setting its Blend Mode to Custom and its Blend RGB to Dst Color and Dst One. Do note that the Unity projector is somewhat limited ( for example, can't project on transparent objects ) in comparison to decals, so we don't recommend using it as a replacement.

    If the problem persists, please send us a simple package with the actual Material, Shader and Textures used.


    Hello, thank you for your support! We've prepared a video tutorial on how to setup ASE to work with the LW SRP, and how to import our SRP specific samples which you can examine and learn from.

    We use a Shader Template for setting up a shader type that is compatible with the Lightweight SRP, which you can further customize according to your specific needs. For example, in order to change it from Opaque to Transparent, you can access the Output Node parameters, and under the SubShader Tags specify the Render Type as Transparent, and the Render Queue as Transparent as well.
    After that, go to your Blend Mode over the Pass section and on the Blend RGB dropdown select Alpha Blend.
    With these settings configured, the transparency amount will be given by the value you specify over the Alpha port on the Base Output node.



    More information is available on our Wiki page regarding the Scriptable Render Pipeline workflow and Shader Templates, please let me know if you have any further questions or if you find it lacking in any manner, thanks!
     
    Last edited: May 23, 2018
  16. 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.3 dev 07:
    • New Sample:
      • Projectors
        • Exemplify Unity Projectors usage under ASE
    • Improvements:
      • Improved Texture Array Tool
        • Now also creates Texture3D by hitting the Texture 3D toggle
        • Can drag and drop multiple textures into Can drag and drop a folder and it will include all its nested textures
        • Added Clear button to remove all textures from Texture List ( UI still work in progress )
      • 'Parallax Occlusion Mapping' node now also supports Texture 3D
        • Replaced the Texture Array toggle by a Texture Type dropdown
        • User must explicitly set the current 3D texture slice via the Tex3D Slice input port
      • Removed Fixed precision type since it's no longer available on Unity 2018
      • Updated Lightweight PBR template to v1.1.8
      • Re-factored Templates location and names
        • New and more flexible templates will be gradually added to replace legacy ones
          • A cleaner Unlit template shader was already added on this build
    • Fixes:
      • Fixed issue on using depth operations on particle template
      • Fixed sometimes light attenuation not showing up correctly
      • Fixed allowing to open unity built-in shaders on ASE
      • Fixed issue on using incorrect port value on 'Refract' node
      • Fixed issue on Texture Object type nodes loosing texture type after load

    Here's a glimpse on our new Projectors sample in action:

    ProjectorSample.gif

    Happy shader creations!
     
  17. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    I was looking for SSS support but i've noticed it hasn't been mentioned for a while. I've tried faking a similar effect with transmission but it only support forward rendering...

    I'm trying to find out how i can visualize the depth of an object in a 0-1 scale but i'm not very good at this ^^ any help?

    Pretty much like this but object based and not depending on the camera distance
     
    Last edited: May 24, 2018
  18. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    ive attached my setup, i cant get it working , also not with setting "source dest alpha and dest one" as blend mode
     

    Attached Files:

  19. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    Is there any way for getting a sprite "local uv's" from an sprite atlas?

    I saw the example "Tile from atlas", but my sprite atlas is not arranged in rows and columns, so I can't apply the same to my shader.
     
    Last edited: May 24, 2018
  20. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Do you mean the Translucency sample? But yes, it's forward only.

    I'm not entirely sure about your requirements but I believe you might be looking for the Surface Depth node as it outputs the distance between your object surface and the camera. As detailed in our wiki, it can be set in a [0,1] range or use its real value directly in View Space range by changing the View Space parameter. Please note that the distance value is obtained by transforming each vertex position into view space and returning its Z value thus it's not dependent on the Depth buffer.

    In any case, I recommend checking other implementations, it might actually be simpler to use a pre-calculated thickness map.

    We made a few changes to your sample(attached StandardProjectorSample), please make sure that it's not simply set to Transparent. Be sure to also disable "Generate Mip Maps" on your texture, and to multiply the spec with the alpha.

    You might need to do it manually, be sure to check the attached Atlas Overlay sample.

    I'm assuming you want to pass and adjust a custom set of UV's, be sure to use the script included(must be added to the asset using it). Due to the way Unity handles that type of use, you'll need more than a shader.

    Thanks!
     

    Attached Files:

    Last edited: May 24, 2018
    Mister-D and Suzuka91 like this.
  21. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
  22. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    I have an Int as a property, driving the index of a texture array. In the shader editor it scrolls only integers: 1,2,3 and on. But in the inspector, as the material property, it reports as a float. Am I missing something?
     
  23. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for bringing this issue up! Unfortunately, there's nothing we can do since its Unity related, however, do note that it's only a visual issue, since it will only take into account integers, despite showing float values.
     
    JBT27 likes this.
  24. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    tnx for the effort but its not what im after , setting it to additive blending just doesnt look right. ive talked to someone with clear shader understanding and apparently its simply not possible to have correct lighting with the projector object.
    so the projector is only good for adding some light in additive mode or for adding unlit objects like shadows.
     
  25. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    As I've previously stated, the Unity projector is somewhat limited in comparison to decals, which is why we don't recommend using it as a replacement. We've just introduced two samples regarding proper usage of this feature with ASE, one for projecting light and another for projecting shadows, both being present in the same scene as per the gif shown in the release post above, you can find them in Assets > AmplifyShaderEditor > Examples > Official > Projectors.

    Unfortunately, I'm not entirely sure what to suggest at this point regarding the use of Unity's projector for blood splatter effects.

    Please let us know if you have any other questions or come across any ASE related issues, thanks!
     
  26. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    its a great plugin nonetheless, not really ASE related more a limitation of the projector object.
    i could try deferred decals or the decal function in the hdrp in 2018
     
  27. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you for your understanding and for the kind words!

    Regarding HD SRP, we are planning to support it as soon as it comes closer to a full release, since it's still curently in preview which means it might undergo heavy changes throughout its developlment.

    As soon as it becomes more developer friendly and stable, we'll definitely be tackling it!
     
    Mister-D likes this.
  28. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We've uploaded a new build into our website.

    Although not much has changed from our last one, we've decided to make it available since it fixes a nasty issue users are having with Lightweight SRP.

    Here are the release notes.

    Release Notes v1.5.3 dev 08:
    • Fixes:
      • Fixed Instance ID issue over Lightweight SRP template
    • Improvements:
      • Added API option to remove includes on data collector
      • Stencil can now be toggled off on templates which have it
    Hope everyone has a great weekend and as always happy shader creations!
     
  29. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    Thanks for a great product!

    Shortcuts don't work. How can I fix that?
     
  30. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    I'm having some fun lately trying different things, thank you so much for you hard work, ASE is super cool :D

    I was making a shader for eyes today and i'm trying to output to two different uv sets but it doesn't seem to be a possibility isn't it? I can't find a way
     
  31. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    I'm agree, ASE rules.

    I don't have the most recent build, but mine works as expected. You must hit (and hold) the key first and then LeftClick on canvas. (In case you don't know).
    For example, press and hold "1", and then left click to add a float variable.
     
    summerian likes this.
  32. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for your support! Are you still having issues with the shortcuts?


    Hello! You can use the Texture Coordinates node for using several UVs, if you could share some additional details regarding what you're specifically trying to do we might be able to provide some further insight, thanks!
     
    summerian likes this.
  33. TheTalkingBoot

    TheTalkingBoot

    Joined:
    Nov 24, 2017
    Posts:
    36


    Hello,

    I am encountering a problem with the Custom Lighting.
    I created a mask for the specular, when I use it in Custom Lighting it works but,
    when I use it in Emission it ignores the Light Attenuation...

    Has anyone come across this problem before ?
     
  34. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158

    In short i'm using the Texture Coordinates node to generate an eye procedurally and while trying to figure out the best way to handle the final result (eyes offest is a bigger trouble than one can immagine) i thought that one way could be having one eyes mesh witht two texture sets (one for each eye) and let one single shader and material control both of them but i didn't know how to output the two result into a single Diffuse node. I just found out that you can do an append ^^
    On another note, i need to create a normal from a procedural heightmap (or mask) but the node NormalCreate is made for Textures only so i might need to write a new one or maybe find a way to define or convert a node type maybe? I don't know exactly ^^
     
  35. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, could you share a simple sample with the issue present via support@amplify.pt, so that we may debug it on our side?

    Also, what Unity version are you currently using?


    The NormalCreate node is actually a re-usable Shader Function, which you may open and edit in order to change how it works ( do note that it will affect all shaders that are using it ), or copy its content and adapt it to your specific needs.

    Please let us know if this helps, or if you require any further information, thanks!
     
  36. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    No, @Suzuka91 pointed me in the right direction. I thought I just had to press T. I must have somehow missed the instruction to press the mouse button too.

    Thanks to both of you!
     
    Last edited: May 28, 2018
  37. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Could you please confirm if you're holding down the shortcut keys and pressing the left mouse button at that same time?

    As @Suzuka91 was kind to mention, you must hold the shortcut key down and then left click on the ASE canvas, in order to place the nodes.

    In order to place a Color node, for example, you must press and hold "5", and then left click on an empty spot in the editor canvas, as you can observe in this introductory video for ASE.

    Please let me know if this helps, thanks!

    Edit: Just read your updated post, happy to know that its sorted out, thank you for confirming that there was no issue present after all!
     
    Last edited: May 28, 2018
    summerian likes this.
  38. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    Yeah, sorry, I hadn't seen the reply before yours and I was slow at editing.

    Anyways, I'm really glad I got this working. This speeds up an already fast process. Thanks again for an excellent product.
     
  39. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    No problem at all, happy to know that you're having a good time with ASE, thank you for your support.

    Please don't hesitate to let us know if you come across any issues, thanks!
     
    summerian likes this.
  40. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Uhm i with my artist-based limitation on math i can't figure out how i can go about offsetting a shape like this one (on the relay node) by the generated uv coordinates in order to make this thing work >___> I suppose i could go way back and have all the texture coordinates injected into the function to reconstruct 3 of those with the ofsetted uv's but that's so convoluted that's making my head hurt.

    Please tell me i'm missing some node i can use to do the job ^^
    upload_2018-5-28_18-33-49.png
     
  41. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I'm not quite sure I understand what you're trying to do, could you provide further details, together with your shader, so that we may help you find the best solution for your setup? Thanks!
     
  42. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    I've made a super trimmed down self explanatory shader with the point where i'm stuck in, here's the file and a screenshot of it. Also i feel like this should be a no brainer for a more competent technical artist so i'm really sorry to bother you with this stuff, i'm trying to learn! :D Thank you so much for your time! upload_2018-5-28_20-6-6.png
     

    Attached Files:

  43. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39

    The output/input from the relay node is not actually the entire "shape" (or 'texture') you are seeing in the visualization, it's only a float from 0 (black) to 1 (white) of a certain pixel. So you can't conect it to the Normal Create node, because it's expecting a texture.

    I was thinking about remaping the grey values to some ramp with the purpleish/blueish tones from a normal map, but by the way the normal map is calculated I think is not possible (I'd like to be wrong, cause that would be awesome, but I think it's not possible).

    normal_description.png

    What I would do:
    - If the texture is going to keep that "circular shape", I'll simply sample some texture like those:
    Screenshot - 29_05_2018 , 3_12_38.png
    (I think ASE include one of those, they are very common)
    Then you could connect it to the create normal node. Or if you convert it to normal map with other software, connect it directly to the normal output.

    - If the texture is going to differ, I would generate the texture and pass it to a variable via script.

    PS: But, that's what I'd do. But maybe I'm wrong.
     
    HitsuSan likes this.
  44. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Wouldn't it be possible to use the DDX/DDY nodes on the heightmap values, and then do some simple remap to generate the normal values? (Then just append them to a vector3)
    If not, where is that idea going wrong?
     
    HitsuSan likes this.
  45. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Thank you for your help guys! After your suggestions i've tried two new approach but... i failed ^^" here's what i've done. None of them works as intended
    upload_2018-5-29_11-32-18.png
     
  46. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    You are welcome @HitsuSan :)
    Well, that actually looks like a normal. Have you tried to connect one of the append nodes to the normal?
     
    HitsuSan likes this.
  47. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    After examining the sample you've sent, the developer concluded that there's no issue present and that this is the expected behavior.

    The custom lighting output is where the light and a shadow information exists, and Light Attenuation is not supposed to work or be available in the emission output.
    Both Albedo and Emission outputs in the Custom Lighting model are used only for the meta pass, which is responsible to GI related calculations.

    Could you provide further details on why did you intend to use the light attenuation setup in the emission port, so that we may provide further assistance?


    Sampling a texture would be the optimal and most performant solution, since attempting to generate a normal map of a non-texture type on the shader is a fairly expensive operation because it requires generating each vector component separately in order to calculate the approximate slope.


    You are correct, it's possible to make use of the DDX/Y nodes to generate the normal values, I'll be sharing an example below.


    The DDX/Y solution might be a good middle ground, still I would advise that you consider sampling textures, as mentioned above. Here's a sample that should get you started:


    Do note that this is not mathematically accurate, and that it would be ideal to use textures instead.
     
  48. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    I've just tried this and like what i've tried before seems like it's not outputting anything in the normal map node.

    I know though, my shader is just a couple of kb heavy memory wise but it's more demanding in calls overall (by about 20% more than unity standard shader). In the end i can easily make a substance(designer) and generate all the eyes textures with it but for now it seems like a cool problem to solve to learn ASE a little better :)
     
  49. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Could you please elaborate on what do you mean by the shared sample not outputting anything in the normal map node and, if possible, share a screenshot of your current setup?
     
  50. TheTalkingBoot

    TheTalkingBoot

    Joined:
    Nov 24, 2017
    Posts:
    36
    It was a reflex of the older version of Custom Lighting, when there was only the emission input. I tend to put the reflections in emission.
    If you say it's normal the problem is solved ;)
    Thanks for your help.