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

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    This is part of a bigger issue that seems to be cropping up lately with URP 12.x, we're aware and looking into it.

    Changing from multi_compile to shader_feature speeds up build times because unused variants aren't included over the game build. But this means that you can't switch these options on/off in runtime. In our case, we're using Unity's own template as inspiration, and we do understand why they are using multi_compile. Since we don't know what the end user requirements are, multi_compile is the safer option where each option can be turned on/off either in-editor or runtime. If you plan only changing these options in-editor via the material then you're good to go.

    URP is migrating from using #define to #pragma shader_feature for its options so users can toggle them both over the material in-editor and runtime. Since Unity doesn't know what are the users requirements it goes for the broader approach, with this huge inconvenience of having a bunch of variants being generated.

    We're looking into it!
     
    fleity likes this.
  2. Kevin-VFX

    Kevin-VFX

    Joined:
    Apr 17, 2016
    Posts:
    54
    Heads up, your overlay blend operation is wrong.

    You should be comparing the A (base/source) value like here:

    https://en.wikipedia.org/wiki/Blend_modes#Overlay

    But the blend node is comparing the B (Top/Destiny) value instead.

    This is making anything needing a true overlay function to look incorrect.
     
  3. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Hey, thanks for the heads up!

    Where exactly is this? (shader type, Blend Operation node?)
     
  4. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Hello.

    I'm having a problem with a very simple shader. When I plug this Max node to emission the shader works okay. But when I try this add one in red circle the shader fails to compile. What seems to be the problem here and how can I solve it?
    upload_2022-2-26_19-0-6.png
     
  5. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    That is super weird. However the compiler will figure out that the entire lower branch isn't connected so anything in that part could be the cause. This looks like it should work, I guess it would be good if you post the shader file and actual error log too.
     
  6. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    True. The shader error I get is "Shader error in 'Flat 3D Zdepth Test': Too many texture interpolators would be used for ForwardBase pass (11 out of max 10) at line 16"
    I don't get the classic pink shader error but the shader loses its billboard facing camera function and just shows a plain white surface instead of calculating the depth.
    Attaching the shader with the post.
     

    Attached Files:

  7. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121

    Not sure exactly but it seems to be hitting the Interpolator Limit when using a Surface Shader, the Unlit Legacy shader type with the same Shader Model does not seem to cause the same problem.

    Increase your Shader Model, that seems to resolve the problem. In any case, we will confirm with the devs.

    Also be sure to update ASE, you're using an older version.
     
    Cactus_on_Fire likes this.
  8. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Thanks! that solved the issue.

    By the way, I don't know if you guys used ASE for the amplify impostors but you use the pixel depth offset feature in that shader to make 2d things sit accurately with the environment as if they were 3d. Is it possible to implement a depth offset input for ASE as well? It would be incredibly useful.
     
  9. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    I thought this was pixel depth offsetting
    upload_2022-2-28_9-52-18.png
     
  10. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Is that only in the HDRP. I don't see that input in the standard surface shader.
     
  11. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    Oh that is possible, it's URP though but indeed might only be in scriptable render pipelines
     
    Cactus_on_Fire likes this.
  12. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Only SRP for now as far as ASE goes, this depends on Unity.
     
  13. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    What is the correct use of the depth value input? I'm plugging a noise texture in there but it creates weird results like this;
    upload_2022-3-1_3-24-20.png

    I just want it to work like the impostors where it pushes the depth pixels depending on the inputs. How can I achieve that?
     
  14. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    90
    Feature Requests:
    • I would be great if the Amplify Shader editor could detect file changes (e.g. if I revert the shader file in git/ or SVN) and then asks the user if he wants to reload the file
    • If I change a shader function it would be great if there were on option that all dependent shaders recompile automatically
    • Right-clicking a shader file tab should have a "Show in Explorer" option.
    Thanks!
     
  15. zombience

    zombience

    Joined:
    Mar 29, 2012
    Posts:
    57
    Hey all,
    apologies if this has already been reported elsewhere, but I found a bug in the ASE Template parser. I did not find any hits while searching the web for this, so I assume this is such a rarely used feature that no one has encountered it.

    This appears in version ASE v. 1.8.9r35

    If you are making your own custom template for ASE to build from and wish to create Float4x4 or Float3x3 input ports on the output node using the syntax:

    Code (CSharp):
    1. float4x4 mat = /*ase_vert_out:Custom Matrix;float4x4;20;-1;*/
    2.     float4x4(
    3.     1., 0., 0., 0.,
    4.     0., 1., 0., 0.,
    5.     0., 0., 1., 0.,
    6.     0., 0., 0., 1.
    7.     )/*end*/;

    This will fail due to the
    WirePortDataType
    enum parser which interprets this string calling
    str.ToUppper()
    on the input string, which yields the resulting string
    FLOAT4X4
    . This fails parsing because the
    WirePortDataType
    enum value is defined as
    FLOAT4x4
    (note the lower case 'x').

    If this affects you, you can insert a step which, after parsing the string to uppercase replaces any uppercase X with lowercase x.

    This issue can be found in the file
    TemplatePass.cs:545
    (or close to that line at least).

    You can replace this original code:
    Code (CSharp):
    1. string portName = inputDataArray[ (int)TemplatePortIds.Name ];
    2. WirePortDataType dataType = (WirePortDataType)Enum.Parse( typeof( WirePortDataType ), inputDataArray[ (int)TemplatePortIds.DataType ].ToUpper() );
    with the following fix:

    Code (CSharp):
    1. string portName = inputDataArray[ (int)TemplatePortIds.Name ];
    2. var portType = inputDataArray[(int)TemplatePortIds.DataType].ToUpper().Replace('X', 'x');
    3.  WirePortDataType dataType = (WirePortDataType)Enum.Parse( typeof( WirePortDataType ),  portType);
    I assume this is affecting no one since I haven't seen any posts about it, but.. just in case :)
     
  16. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    That's specific to Unity: https://docs.unity3d.com/Manual/SL-Offset.html
    Not to be confused with Depth Offset in HDRP.
    We don't have a tutorial readily available for something like impostors but there are some resources in the Unity forum. (general, not specific to ASE)
    1. Might be tricky given the way Unity handles files but it's a good idea.
    2. That we won't do for now, it's up to the user to decide if they want to recompile all the shaders. Consider larger projects and complex shaders, you might just be editing a single shader. In any case, you can select the Shader Function in the Project explorer and easily use the buttons on its inspector to find and automatically compile all dependencies(read, shaders that use said SF).
    3. Not sure I understand what you mean, can you elaborate on that? For the record, you can left-click on the shader name(bottom left) in the editor window to locate the file.
    Thanks for letting us know, we appreciate it.
    This has been passed on to the devs, I'm sure they will reply directly to your email.
    Thanks!
     
  17. specular12

    specular12

    Joined:
    Jan 28, 2014
    Posts:
    16
    Hi all,
    This has likely been covered somewhere, but I can't seem to find anything. Is there a way to change the hue of an albedo texture, similar to photoshop's adjustment/hue/saturation/value, where I can move the hue along the color wheel rather than just tint? I set up a very simple shader to show what I mean by tint. This shader needs to use the Substance Sampler node. Thanks in advance!

    Here's the original fabric texture:
    original.jpg
    Here's what I want, to shift the hue:
    hue-shift.jpg
    Here's what I have, tint:
    tint.jpg

    Here's the super simple shader network:
    tint shader.jpg

    In case anyone else needs this, here's the solution, just use the add node:
    hue shader.jpg
     
    Last edited: Mar 3, 2022
  18. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121

    Yeah, if you plug a HUE value directly it will use uniformly. Users must manipulate the HUE as you did your screenshot.

    upload_2022-3-5_18-52-27.png
     
  19. NotaNaN

    NotaNaN

    Joined:
    Dec 14, 2018
    Posts:
    325
    Any updates on Amplify supporting 2D URP? :D

    Now that they have moved 2D URP out of the experimental namespace (finally!), Is supporting 2D URP now on the To-Do list? Do you have any time tables for when we might see this happen?
     
  20. jorgemorales

    jorgemorales

    Joined:
    May 4, 2015
    Posts:
    1
    Howdy, I hope this is the right spot to post a question.

    I have a float that mins and maxs from -0.1 to 0.2 these number are not the best to work with when my programmer needs to change the value. is there a way that i could have a "control" float that has nice easy numbers to work with, like from 0 to 10? Something like this would be great for any other values that i want to be changed by code.

    in other words,
    I would like to be able to control a min and max value with a "0 to 10 scale" no mater what my original values really are so that its easier for my programmer to work with.
     
  21. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    It's on the Done list ;)

    There might be additions and tweaks but it's already possible to create 2D URP shaders with the latest ASE version, including the Custom 2D Lit. (URP 12.x)

    Hey there!

    You're looking for the Remap node; remap a 0-10 float(slider) to -0.1 to -0.2.
     
    NotaNaN likes this.
  22. NotaNaN

    NotaNaN

    Joined:
    Dec 14, 2018
    Posts:
    325
    This tiny, green-faced smiley emoji does not accurately convey the sheer smiley-ness of my face right now.
    Needless to say, I will give you three of them to make up for it. :D:D:D

    Thank you Amplify Team!
     
    Amplify_Support likes this.
  23. GilG

    GilG

    Joined:
    Jan 30, 2017
    Posts:
    27
    Hello, I have quite a simple problem (I think). Is there a way to add a texture to a shader that won't be needed to specify in the material.
    As an example, I would like to use a noise texture in several shaders but I don't want to have to add them manualy to every materials using those shaders. In shadergraph this is possible but here, with amplify, even if I set the "Default value" or the "Material value" it just doesn't work as all materials stays with an empty slot.

    Also with shadergraph if I add a texture that won't be a variable I can see in the material that there a texture being used but I can't edit it.
    I just want to be able to reproduce this. Is this possible ? Am I doing something wrong ?
    I use Amplify Shader Editor 1.8.9r35
     
  24. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Hey!

    The Default texture value is only applied only when creating a material from the shader or setting the shader on an existing material, it will not affect existing materials; this is specific to Unity shaders, not ASE.

    How exactly are you using this in Shader Graph?
     
  25. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    Hi there,

    Can it be that there is an issue with the texture coordinates node in Unity 2020.3.28f? It seems the values furthest to the left and the bottom are 1 rather than zero. Only the second column/row continues with zero. I realized, it was preventing me from creating proper gradients. can you reproduce the issue?
     
  26. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Hey!

    Not that we are aware of, can you provide an example of how you're using it? We'd also appreciate details on Shader type used.

    Thanks
     
  27. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    Never mind - my bad. Everything is working, as it should, I was just too dumb to see it. :D
     
    Amplify_Support likes this.
  28. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    I was able to narrow the problem even more, this is not only my problem, it appears also within The Vegetation Engine. It is related to MotionVectors.
    It disappears when I disable motion vectors.
     
  29. GilG

    GilG

    Joined:
    Jan 30, 2017
    Posts:
    27
    For example I created a burning shader effect with some animated noise texture. The shader was used on various objects composing a house. I had no use to specify the noise texture again and again in every materials. That's why it was usefull to just have it setup in the shader by default.

    That's how it presented in the material. I can see there is a texture referenced but I can't change it or disable it.
    upload_2022-3-16_15-2-6.png
     
  30. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Good to hear but that's quite odd. Let's continue over email, best to avoid having the same discussion in multiple places. I got back to you.

    I understood what you said. What I'm saying is that's specific to Unity; when you specificy a texture as a default in a shader it will applied every time you create a new material with that uses it, that is the definition of a Default texture value in this context.

    What I'm asking is how you're using it on Shader Graph so that we may check for an equivalent option on our end.
     
  31. GilG

    GilG

    Joined:
    Jan 30, 2017
    Posts:
    27
    Ok my bad. Sorry but I'm not sure to understand but when you drag and drop a texture in shadergraph it automatically create the "Sample Texture 2D" with the embedded texture. Does it answer your question ?
    upload_2022-3-17_11-40-30.png
     
  32. AkiKupiainen

    AkiKupiainen

    Joined:
    Jun 9, 2020
    Posts:
    2
  33. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Is there a way to use the billboard features in HDRP Lit Shader?
     
  34. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Same for ASE, the behavior is the same. You can set defaults and properties if a material is selected.
    What you can't do is lock a texture so it can't be changed in the material.

    Hello!

    I'm afraid we're not familiar with NGUI requirements for custom shaders. I'd recommend contacting the NGUI developer for additional details, perhaps they could look into adding an ASE Template.

    Should work, any issues? Which Unity version are you using?
     
  35. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    2019.3.15f
    I don't see the billboard checkbox option in the HDRP Lit shader settings
     
  36. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Ah yes, you have to use the node.
     
  37. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Oh I didn't know about this node. Thanks.
     
  38. AkiKupiainen

    AkiKupiainen

    Joined:
    Jun 9, 2020
    Posts:
    2
    @Amplify_Support thanks for response. I was able to solve this on template level. I am glad you made this tool, creating new shaders is breeze with this :)
     
    Amplify_Support likes this.
  39. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,145
    @Amplify_Support I've been making a terrain shader and so far everything has gone fine, but I'm left with a bit of a conundrum. I've got all my splatmaps working, but one thing I DON'T have working are terrain holes. What sampler do I have to access to get these to work?

    Edit: found the answer myself with some digging into Unity's shader details. If anyone else needs an answer to this, the sampler you're looking for is _TerrainHolesTexture
     
    Last edited: Mar 23, 2022
    Amplify_Support likes this.
  40. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Yes, you can also just enable it in the Four Splats Shader Function parameters.
     
  41. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,145
    The four-splat isn't in use in my case since it interferes with my triplanar and stochastic sampling systems.
     
  42. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Ah yes, I see. Just for reference, Shader Functions like the Four Splats can be opened by double clicking them directly, you can see how the Hole is used there.
     
  43. Desjacyr

    Desjacyr

    Joined:
    Apr 28, 2021
    Posts:
    1
    Hello !
    I'm a student that have a single question on Amplify :D
    Is there a way to put another Float as the max value of a Float ? (Like in the screenshot, I would like the CDMAX to define the max value of CED).
    I understand that there is a way of doing so by not setting a max value on CED, and clamp it with CDMAX as the max one, but I just wanted to know if we can adjust a slider with other floats.

    Thank you !
     

    Attached Files:

  44. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Hey!

    Not with the slider itself. However, you could have a 0-1 slider that remaps(remap node) from 0 to whatever CDMAX you need; but it's not part of the slider.
     
  45. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    328
  46. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Sorry, I'm a bit confused. So it's not an ASE issue but a Unity shader problem? Please elaborate on any errors/warnings you might be seeing on your side.

    We're not aware of any issues with naming a property _Float16 on MacOS. However, we have seen some strict, unrelated, restriction in WebGL; not specific to our editor.
     
  47. Kevin-VFX

    Kevin-VFX

    Joined:
    Apr 17, 2016
    Posts:
    54
    Hey, I just noticed that there's no way to add a Matrix array to the cbuffer on SRP. It's either an array outside the buffer using the global array node (understandable) or a single matrix inside the buffer using the matrixnxn nodes. I can kind of manually override and force it by adding brackets and numbering to the name, but the editor constantly gets rid of the brackets likely as a validation step. This is causing us to run into imitations which forces us to manually fix the shader code.
     
  48. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    How can i use simple lit in the URP template?
    Simple lit has 20% better performance on mobiles by default
     
  49. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    121
    Not something we have details on here, feel free to reach out via the official support email(support@amplify.pt) with additional info, or an example, of how you're using it. It may very well be beyond the scope of what the editor provides.

    There is not Simple Lit template but you're free to adjust the current one or create your own if you're comfortable with shader development.
     
  50. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Awesome package and you guys are making it more and more powerful and flexible with each update. Kudos.
    I am just getting into shaders for mobile and would really love to have a list of corresponding shader examples for mobile. Will really help all of us who are targeting for mobile. Is there a list of mobile shaders available. Cheers