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

    DuvE

    Joined:
    May 22, 2016
    Posts:
    169
    Hi, I have a problem with a double-sided (Cull Off) lit shader. Lightning behaves very weirdly, here is a short video:

     
  2. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Thank you so much for the examples!

    The stencil buffer method works well, however i have another issue, my sprites seem to use the full mesh as the stencil buffer mask unless i set them to Custom Blend Mode or Transparent Cutout and use "opacity mask" instead of "opacity", when i do that the stencil buffer is masking correctly but in the scene view it makes the sprites using that shader render over my postprocess effects. Also during play, the scene view will show the masked sprites black, not sure if this is normal.

    Here's a visual example, when i choose Custom as a Blend Mode or Transparent Cutout as Rendertype the terrain sprite is rendered over my postprocess effect in the scene view:

    BlendModes.png

    It looks fine in the game view and during play:

    Caustics1.gif

    EDIT: oddly enough, If i add a second postprocess effect with "[ImageEffectAllowedInSceneView]" below my postprocess effect, it then works fine in the scene view, i'm not sure what is happening.

    EDIT2: I've been fiddling around and the only way that i've managed to make this work is by adding alpha:fade to the shader code manually

    Thanks for the help!

    2017.1.0p4
     
    Last edited: Nov 24, 2017
  3. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    93
    2017.1.1p1 right now and moving to 2017.2 soon. I'm a few years in to my project, with likely 2 more to go so can still change version.
     
  4. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    509
    The Official Editor Version Usage Information: https://forum.unity.com/threads/editor-version-usage-information.485317/

    5.6 is the most used Unity version. Not sure how often do they update the page.
     
  5. TheTalkingBoot

    TheTalkingBoot

    Joined:
    Nov 24, 2017
    Posts:
    36
    Hi!

    I recently migrated from ShaderForge to AmplifyShader. I'm trying to recreate my shaders and encounter difficulties with the Custom lighting.
    I would like to make a specular and metallic, but depending on the camera position I have a weird effect...



    I alreadry tried the Standard Surface Light node but that's not the effect I'm looking for.
    Can anyone help me?
     
  6. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    First, I would like to thank you all for your responses about your current used Unity version.
    We've just uploaded a new version into our website.

    Here are the release notes:
    Release Notes v1.3.8 dev 02/03:
    • Improvements:
      • Added new custom lighting port and migrated the emission connection to this port
        • Now custom lighting display both Albedo and Emission to be used in baking
      • 'Function Input' and 'Function Output' names can be edited through node body
    • Fixes:
      • Fixed indentation issue on some templates generated code
      • Fixed issue in texture property that would forget it's auto cast type on load
      • Fixed issue on 'Triplanar Sample' node being initialized with incorrect internal tiling value
      • Fixed issue on screen position for 'Dither' node
        • Now it changes the screen position interpolator globally to make it work on the shadow caster
    Some of you have been having issues with Custom Lighting shaders and Unity GI. To finally seal the deal and make it work, we decided to rethink an old idea and re-introduced the Custom Light port along side with Albedo and Emission.

    This means that you no longer use the Emission port for custom lighting and instead use this new port. The Emission and Albedo ports now serve the purpose of letting you specify the respective Emission and Albedo contributions for the GI system.

    To make sure everything compiles correctly, older shaders will automatically reconnect to the proper port and work as usual, this change only affects the GI system.

    We understand this might come with some confusion but it's a necessary evil to make custom light shaders as robust as standard ones.

    Wiki information will be updated in the following days to reflect these changes.

    We hope you guys have an awesome weekend and happy shader creations!
     
    TheWalkingDevTA and Loards like this.
  7. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    You need to either use the face node or the switch by face node to invert the normals for back faces, see the links for two different examples that actually do the same thing.

    Sorry for the late reply, that looks impressive :3

    About the issue, can you send us the shader? I can't think of a reason for that to be happening. I can say however that the alpha:fade pragma can be set automatically if you use the blend mode presets instead of the custom option. I'm not really sure why would that make any different tho since the custom option mimic the same behavior, maybe I'm missing something. If you can, send either shader, or if you can a small repo example either through here or by email (see signature)

    Thx ;)

    Thank you for the suggestion ;)

    Your dot products should be followed by a max( value, 0 ) because the dot product will produce a range of [-1 , 1] falloff where the zero is at equator of the sphere. You can also use the saturate or clamp nodes. Check the new blinn phong light function node, see how it's setup. Also, when the input values for the power node get negative they usually invert the results in weird ways, which seems to be whats happening.

    PS: the light attenuation node still doesn't have a preview :C so you wont be able to check the final result on the multiply node, I'll try to get it working for the next few days.
     
  8. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    I've tried the Blend Mode Cutsom preset, i'm not sure what other blend mode to try

    I'll make a test project and PM you the link
     
  9. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112

    Thank you!! testing right now!
     
  10. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    It must have gotten lost in the Shuffle, but has anyone successfully made a custom UI for their shaders?
     
  11. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    Can I send you a PM with the shader?
     
  12. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Will the terrain node support :

    - 16 textures in one pass through texture array
    - splatmap
    - UV blending to reduce tilling
    - AT2

    Thanks
     
    Last edited: Nov 27, 2017
  13. TheTalkingBoot

    TheTalkingBoot

    Joined:
    Nov 24, 2017
    Posts:
    36
    It works now, thanks !
     
  14. TheNathanParable

    TheNathanParable

    Joined:
    Mar 21, 2014
    Posts:
    17
    Hi, I bought ASE during the black friday sale, and i'd just like to ask if anyone had any recommendations for a vertex painting tool I could use alongside it?

    So far there are a couple of tools that i'm aware of:

    1) Vertex Painter by Jason Booth, which is completely free. I've had a quick play with it, and it seems to do the job perfectly fine. It's compatible with ASE, it can paint across multiple objects at once, it does colours and flow maps, and it gives you access to a LOT of "layers" (I dunno what to call them) you can paint on (standard vertex RGBA, as well as the XYZW of all four UV maps). For a free tool it works wonderfully. I do wonder though exactly how many of those "layers" are usable in ASE (i've only had a quick play, but it seems ASE can only read the XY of a UV map and not the ZW)? It's also made for Unity 5.3.2p2 (last updated in February), and although it seems to work fine in Unity 2017.1.0p4 (after a very long conversion process), I am worried about the possibility of future Unity updates somehow breaking it.

    2) Vertex Tools Pro, currently half off for Black Friday. It looks like a really nice tool. Unfortunately it doesn't seem to have as many "layers" as Vertex Painter (apparently it only uses RGB?), but it does have a really nifty tool for automatically generating a flow map based on the slopes of the mesh, as well as the ability to animate vertex colours.

    At the moment i'm leaning towards Vertex Painter by Jason Booth, but i'd really like to hear from you guys about which vertex painting tools you use alongside ASE, just to make sure i'm making the right choice.
     
    Shodan0101 likes this.
  15. johnlanz

    johnlanz

    Joined:
    Sep 2, 2016
    Posts:
    37
    Hey Guys,
    Can you point me into right direction on how to create an aura shader similar to ultra instinct. In 2d this is so easy using shadero: https://i.redd.it/sq5eq519xstz.gif
    How to do it in ASE?
     
  16. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    I can't say for sure which of those we'll ship with but the idea is to support all major features while editable to add more. Most likely we'll provide a more basic template to be edit upon and provide a sample that adds features on top. So lets say the template itself might not have UV blending by default but the sample does. Because we are only now starting is hard to say for sure but thanks for sharing your wishes, we'll take them into consideration.

    If ASE is not reading all four channels from UVs that's a bug for sure. That said I see no reason why ASE can't work with Jason's tool. If at any point it becomes a pain to deal with we could very well take a look into it, it's even on github so even you can contribute with your 2017 port. Aside from that, the underlying technique doesn't heavily rely on shaders so it should work on any vertex paint tool you throw at it and it becomes of matter of which vertex tool you prefer. If at some point no vertex tools exist on the market (doubt it) we'll think on rolling our own.

    1. Use the object to world node and leave all inputs unconnected.

    2. what do you mean by baking? In wireframe shaders you calculate the barycenter and pass it through an interpolation which saves the result in a texture coordinate system. Do you mean calculation it "offline"?

    3. I'll assume you are talking about interpolators again. On way is to increase your shader model which will provide you with more interpolator. Besides from that it's a matter of compressing data and being smart on how to use them. I could help more if I had the example you are referring to.

    Well just by looking at the effect and graph it's not a simple effect. The concept tho seems pretty easy, it's just different texture panning up. You can get the aura by mixing two textures at different panning speeds (different sizes help as well) This effect is them merged behind the sprite keeping in mind that the sprite needs some padding in your sprite packing process. Then you create a similar mix on top for the sparkles and mix them on top. Add your glow system of choice and voila!

    Truth is, how good the effect ends up looking is heavily dependent on the texture you use. For instance I would say the sparkles need some kind of vertical stripes in the texture so that it looks like it's the same particle blinking going up. and the aura will look more smoky or wispy depending on the texture you use, I'm also assuming the colors come from the combination of those textures. If you provide me with some base textures I don't mind create a simple example for you.
     
    blitzvb likes this.
  17. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    I've seen you talking about stencil buffer and post process stuff, since i'm caving my head in around this
    can i ask you what's causing it and what should i learn to solve it? The left model is a custom sprite shader edited from the standard sprite shader (didn't change much except the blend mode) and the right one is the ASE Simple Refraction
     
  18. TimNedvyga

    TimNedvyga

    Joined:
    May 18, 2015
    Posts:
    95
  19. TheNathanParable

    TheNathanParable

    Joined:
    Mar 21, 2014
    Posts:
    17
    Ok, turns out I was wrong about the UV channels thing. I didn't notice that the nodes for sampling a UV map had a "Coord Size" option allowing you to select from 2, 3, and 4 channels. Like I said before, I only had a quick play, so there was a lot there that I was unfamiliar with.

    Oh, and when I said that it works after "a very long conversion process", I meant that automated one Unity does when it says "API Update Required". I am not a programmer by any stretch of the imagination, so unfortunately I can't contribute to the github. Sorry for the confusion. :oops:

    However, I am very happy to say that after a bit of mucking about (and heavily referencing this Shader Forge setup), I was able to use Jason's Vertex Painter with ASE to create a shader with both vertex masking and a working flow map! I'm definitely pleased with this setup! :D
     
  20. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    True, the best option is to use a geometry shader. You could create a template that uses it right now, but we do want to create our own wireframe option. Can't promise you when but I'll see what I can do about that.

    Thats because you need to specify that your refraction happens after everything else, you do this by changing the rendering queue of your shader, you need to set it at least to be transparent but you are better off to make it even higher to pick other transparent objects.

    You need to use the texel size node. Check the node documentation on the link to see an example. You shift the uvs by texel amount (texel is the texture element of the image you use, you can think of it as a pixel but not exactly representing one on screen)

    Cool, glad that worked out for you, if you can share the results, curious about them :p
    Edit: that actually might be a good sample to provide with the ASE package
     
    HitsuSan likes this.
  21. 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.3.9 dev 02:
    • Fixes:
      • Fixed issue with 'Texture Coordinates' node not generating proper code for sizes bigger than float2
      • Fixed issue on reading old shaders data into new ASE versions
      • Fixed issue on custom colored categories
    • Improvements:
      • Updated various samples that were still compiled on older ASE versions
      • ASE window now loses text focus when losing its focus to prevent UI issues
      • Added proper Texcoord support in custom shadow caster
      • Added new toggle on 'Screen Depth' and 'Depth Fade' nodes to disable conversion from log to linear space
        • Important for Orthographic camera projections where Depth Buffer values are already stored in linear space
    IMPORTANT REMINDER:
    This will be the latest version packaged under Unity 5.4 and we will now migrate ASE to Unity 5.5.

    Happy shader creations!
     
    blitzvb and Bartolomeus755 like this.
  22. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Problem solved :) thanks!
    (PS: Sorting layers can also affect the result)


    I've noticed you can't reorganize the properties in a template shader (i'm on 1.3.8), i know it's experimental but still :)
     
    Amplify_Paulo likes this.
  23. studio1h

    studio1h

    Joined:
    Jul 6, 2012
    Posts:
    31
    I use a Wacom tablet instead of a mouse pretty much exclusively. The default settings for a Wacom tablet are for the bottom button on the side of the pen to map to right click. When I try to navigate the Amplify editor with right click on my Wacom pen, it doesn't work at all. Is this a known issue? Is it fixable?

    Thanks!
     
  24. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    I'm not sure if its a bug or note, but should amplify generate 2 #include "UnityCG.cginc"?

    Also, how can I access _MainTex in the graph? (Post-processing template) //Edit: I find it. template parameter -> Screen

    Code (CSharp):
    1. // Made with Amplify Shader Editor
    2. // Available at the Unity Asset Store - http://u3d.as/y3X
    3. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
    4.  
    5. Shader "TopoScanner"
    6. {
    7.     Properties
    8.     {
    9.         _MainTex ( "Screen", 2D ) = "black" {}
    10.         _Worldposition("World position", Vector) = (0,0,0,0)
    11.         _Scannerstart("Scanner start", Float) = 20
    12.         _Scannerend("Scanner end", Float) = 50
    13.     }
    14.  
    15.     SubShader
    16.     {
    17.         Tags{  }
    18.      
    19.         ZTest Always Cull Off ZWrite Off
    20.         GrabPass{ }
    21.  
    22.  
    23.         Pass
    24.         {
    25.             CGPROGRAM
    26.  
    27.             #pragma vertex vert_img_custom
    28.             #pragma fragment frag
    29.             #pragma target 3.0
    30.             #include "UnityCG.cginc"
    31.             #include "UnityShaderVariables.cginc"
    32.             #include "UnityCG.cginc"
    33.  
    34.  
    35.             struct appdata_img_custom
    36.             {
    37.                 float4 vertex : POSITION;
    38.                 half2 texcoord : TEXCOORD0;
    39.             };
    40.  
    41.             struct v2f_img_custom
    42.             {
    43.                 float4 pos : SV_POSITION;
    44.                 half2 uv   : TEXCOORD0;
    45.                 half2 stereoUV : TEXCOORD2;
    46.         #if UNITY_UV_STARTS_AT_TOP
    47.                 half4 uv2 : TEXCOORD1;
    48.                 half4 stereoUV2 : TEXCOORD3;
    49.         #endif
    50.                 float4 ase_texcoord4 : TEXCOORD4;
    51.                 float4 ase_texcoord5 : TEXCOORD5;
    52.             };
    53.  
    54.             uniform sampler2D _MainTex;
    55.             uniform half4 _MainTex_TexelSize;
    56.             uniform half4 _MainTex_ST;
    57.          
    58.             uniform sampler2D _CameraDepthTexture;
    59.             uniform float3 _Worldposition;
    60.             uniform float _Scannerstart;
    61.             uniform float _Scannerend;
    62.             uniform sampler2D _GrabTexture;
    63.  
    64.             v2f_img_custom vert_img_custom ( appdata_img_custom v  )
    65.             {
    66.                 v2f_img_custom o;
    67.                 float4 clipPos = UnityObjectToClipPos(v.vertex);
    68.                 float4 screenPos = ComputeScreenPos(clipPos);
    69.                 o.ase_texcoord4 = screenPos;
    70.                 float3 vertexToFrag7_g1 = ( (mul( UNITY_MATRIX_MV, v.vertex )).xyz * float3(-1,-1,1) );
    71.                 o.ase_texcoord5.xyz = vertexToFrag7_g1;
    72.              
    73.              
    74.                 //setting value to unused interpolator channels and avoid initialization warnings
    75.                 o.ase_texcoord5.w = 0;
    76.                 o.pos = UnityObjectToClipPos ( v.vertex );
    77.                 o.uv = float4( v.texcoord.xy, 1, 1 );
    78.  
    79.                 #ifdef UNITY_HALF_TEXEL_OFFSET
    80.                         o.uv.y += _MainTex_TexelSize.y;
    81.                 #endif
    82.  
    83.                 #if UNITY_UV_STARTS_AT_TOP
    84.                     o.uv2 = float4( v.texcoord.xy, 1, 1 );
    85.                     o.stereoUV2 = UnityStereoScreenSpaceUVAdjust ( o.uv2, _MainTex_ST );
    86.  
    87.                     if ( _MainTex_TexelSize.y < 0.0 )
    88.                         o.uv.y = 1.0 - o.uv.y;
    89.                 #endif
    90.                 o.stereoUV = UnityStereoScreenSpaceUVAdjust ( o.uv, _MainTex_ST );
    91.                 return o;
    92.             }
    93.  
    94.             half4 frag ( v2f_img_custom i ) : SV_Target
    95.             {
    96.                 #ifdef UNITY_UV_STARTS_AT_TOP
    97.                     half2 uv = i.uv2;
    98.                     half2 stereoUV = i.stereoUV2;
    99.                 #else
    100.                     half2 uv = i.uv;
    101.                     half2 stereoUV = i.stereoUV;
    102.                 #endif
    103.              
    104.                 half4 finalColor;
    105.  
    106.                 // ase common template code
    107.                 float4 screenPos = i.ase_texcoord4;
    108.                 float clampDepth11_g1 = Linear01Depth(UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture,UNITY_PROJ_COORD(screenPos))));
    109.                 float3 vertexToFrag7_g1 = i.ase_texcoord5.xyz;
    110.                 float4 appendResult15_g1 = (float4(( clampDepth11_g1 * ( vertexToFrag7_g1 * ( _ProjectionParams.z / (vertexToFrag7_g1).z ) ) ) , 1.0));
    111.                 float4 screenPos32 = screenPos;
    112.                 #if UNITY_UV_STARTS_AT_TOP
    113.                 float scale32 = -1.0;
    114.                 #else
    115.                 float scale32 = 1.0;
    116.                 #endif
    117.                 float halfPosW32 = screenPos32.w * 0.5;
    118.                 screenPos32.y = ( screenPos32.y - halfPosW32 ) * _ProjectionParams.x* scale32 + halfPosW32;
    119.                 screenPos32.xyzw /= screenPos32.w;
    120.                 float4 screenColor31 = tex2Dproj( _GrabTexture, UNITY_PROJ_COORD( screenPos32 ) );
    121.              
    122.  
    123.                 finalColor = (( distance( (mul( unity_CameraToWorld, appendResult15_g1 )).xyz , _Worldposition ) >= _Scannerstart && distance( (mul( unity_CameraToWorld, appendResult15_g1 )).xyz , _Worldposition ) <= _Scannerend ) ? screenColor31 :  screenColor31 );
    124.  
    125.                 return finalColor;
    126.             }
    127.             ENDCG
    128.         }
    129.     }
    130.     CustomEditor "ASEMaterialInspector"
    131. }
    132. /*ASEBEGIN
    133. Version=13902
    134. 49;218;1628;679;1368.129;485.5264;1.652858;True;True
    135. Node;AmplifyShaderEditor.FunctionNode;26;-818.9117,-406.4868;Float;False;Reconstruct World Position From Depth;-1;;1;e7094bcbcc80eb140b2a3dbe6a861de8;1;0;FLOAT;0.0;False;1;FLOAT4
    136. Node;AmplifyShaderEditor.ComponentMaskNode;27;-422.2195,-407.8107;Float;False;True;True;True;False;1;0;FLOAT4;0,0,0,0;False;1;FLOAT3
    137. Node;AmplifyShaderEditor.Vector3Node;9;-547.1569,-166.3567;Float;False;Property;_Worldposition;World position;2;0;0,0,0;0;4;FLOAT3;FLOAT;FLOAT;FLOAT
    138. Node;AmplifyShaderEditor.GrabScreenPosition;32;-862.3548,390.4878;Float;False;0;0;5;FLOAT4;FLOAT;FLOAT;FLOAT;FLOAT
    139. Node;AmplifyShaderEditor.RangedFloatNode;4;-543.1962,134.0226;Float;False;Property;_Scannerend;Scanner end;1;0;50;0;0;0;1;FLOAT
    140. Node;AmplifyShaderEditor.RangedFloatNode;3;-539.0361,49.18549;Float;False;Property;_Scannerstart;Scanner start;0;0;20;0;0;0;1;FLOAT
    141. Node;AmplifyShaderEditor.ScreenColorNode;31;-574.758,403.7107;Float;False;Global;_GrabScreen0;Grab Screen 0;3;0;Object;-1;False;1;0;FLOAT4;0,0,0,0;False;5;COLOR;FLOAT;FLOAT;FLOAT;FLOAT
    142. Node;AmplifyShaderEditor.DistanceOpNode;8;-96.22415,-196.526;Float;False;2;0;FLOAT3;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT
    143. Node;AmplifyShaderEditor.TFHCCompareWithRange;19;-20.62057,220.0446;Float;False;5;0;FLOAT;0.0;False;1;FLOAT;0.0;False;2;FLOAT;0.0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;1;COLOR
    144. Node;AmplifyShaderEditor.TemplateMasterNode;21;466.4897,75.44849;Float;False;True;2;Float;ASEMaterialInspector;0;1;TopoScanner;c71b220b631b6344493ea3cf87110c93;ASETemplateShaders/PostProcess;1;0;FLOAT4;0,0,0,0;False;0
    145. WireConnection;27;0;26;0
    146. WireConnection;31;0;32;0
    147. WireConnection;8;0;27;0
    148. WireConnection;8;1;9;0
    149. WireConnection;19;0;8;0
    150. WireConnection;19;1;3;0
    151. WireConnection;19;2;4;0
    152. WireConnection;19;3;31;0
    153. WireConnection;19;4;31;0
    154. WireConnection;21;0;19;0
    155. ASEEND*/
    156. //CHKSM=E0B5AF7450827281317C7A2903CF471091A3112C
     
    Last edited: Nov 28, 2017
  25. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Uhm, that's strange, seems like a bug since right click should work for panning and zooming. I have an older model wacom and I'll check it out myself, in the meanwhile double check if your right click is indeed set to right click.

    Yep that should not be happening, thx for reporting, we are currently working on it and will soon release a batch of feature for it, the fix should be coming with it as well. ;)
     
  26. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    The next version of the template system should come with reordable properties ;) you can expect it in the next few days or so.
     
  27. TheWalkingDevTA

    TheWalkingDevTA

    Joined:
    Apr 24, 2014
    Posts:
    9
    What happened to node port coloring?

    The shader function this screen grab is from is attached (ZIP'ed so the forum accepts the .asset file). I'm seeing the same behaving in .shader's as well. To eliminate possible cache contamination, I packaged my project assets and imported them into a fresh Unity project with a fresh ASE install; same behavior.

    ASE v1.3.9.002 – 28th November 2017 – Stable
    Unity 2017.2.0f3

    2017-11-29_105158.png
     

    Attached Files:

  28. studio1h

    studio1h

    Joined:
    Jul 6, 2012
    Posts:
    31
    Super -- Thanks for looking into it!!

    Just in case you need more info: I'm on a Mac, running Unity 2017.2.0f3. I double checked my Wacom settings: The lower button is indeed set to right click. Also, I can use my Wacom pen everywhere else in the Unity interface and it works fine. The only place right click doesn't work is in the Amplify Editor.

    Thanks again,

    : )

    J
     
    Amplify_Paulo likes this.
  29. Zymes

    Zymes

    Joined:
    Feb 8, 2017
    Posts:
    118
    I just got this asset but it is a lot to take in.

    I think I have a pretty simple use case, but I am not sure how to solve it.

    I have an object that has a texture on it. I want to be able to draw a color on it with a primary and a secondary color (through C# code) where I have my detail mask.

    It should work just like the standard shader except support two detail masks where I can set a color for each. And both should be opaque! Not multiply like the standard shader.

    Or maybe 1 detail mask with multiple colors/channels? I don't know how it would work exactly.
     
    Last edited: Nov 29, 2017
  30. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    just hit W for the colors, it's a simple toggle for turning colors on or off for "w"ires. If you hit CTRL+W you can also toggle between multiline or singleline wires. default is ON for both so you may hit it by accident

    Do you want to draw the colors like a brush? like, for instance, painting a ball? And then you would use that to drive two masks add or subtract a detail effect? if yes, does it really needs to be a pixelwise like painting a texture or you would be fine using just the vertices as a blend factor?
     
    TheWalkingDevTA likes this.
  31. Zymes

    Zymes

    Joined:
    Feb 8, 2017
    Posts:
    118
    I just want it really simple to be able to color pick where I have drawn a detail mask above the main texture.

    I have a truck, it has tires, pipes, headlights, windows, chassi etc. I only want to color the chassi with 1 primary color and 1 secondary color. The two colors should not be blended or mixed. They are separate.

    So in the standard shader I have a texture applied to the truck to texture the details. Then I have my detail mask with white + transparency (PNG) where I want to apply my custom color ON TOP of the texture overriding it. I also tried to use RGB in the detail mask but I could not figure out how to make the nodes work.

    So imagine my detail mask has 2 big lines drawn across the body of the truck, one for primary and one for secondary color, then in the inspector I want to apply colors to these 2 lines.

    The colors should be opaque and solid, no blending, no transparent effects. It is a low poly model.

    Imagine I want to change this models red color in the middle to anything I want, and the white color, but everything else should just stay default: https://s3.envato.com/files/222235246/Img/Low-Poly-Racing-Car-Mustang.jpg
     
  32. DavidLieder

    DavidLieder

    Joined:
    Feb 14, 2016
    Posts:
    84
    With all respect to an amazing shader editor, not everyone wants/needs to become a super-dev at ASE. When simple solutions are needed, having "pre-made" shaders would be a huge value and plus for ASE. "Plug and play" shaders would not remove or lessen the huge value of custom editing and programming complex solutions. It's just that if you think all Unity devs want complexity or are capable of diving into this product, then you don't understand your customer base for ASE, myself included. By all means, get us 100 shaders that we can use, because real game devs don't have a lot of time on our hands. Everyone wants to become an ASE expert, but few can. All ASE customers need shaders.
     
    hopeful likes this.
  33. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I think that's a really valid thing. I'm sure there are many users out there who just want to modify something a bit rather than reinvent the wheel.
     
    hopeful likes this.
  34. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Question - brand new to shaders and this software.
    1. Just installed this software on 2017.1, is there a reason I can't see my edits on that Amplify Shader "Ball" preview window? It seems to be in a Scene or Game view in some videos but I'm only seeing my edits in the Inspector.
    2. I need to create a shader that flashes like a white strobe light. Kind of like an overboard beacon at sea. Since I have NO idea what I'm can anyone point me in a good direction.
     
  35. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Don't read too much into it, that was in the context of the solution at hand. We are completely aware of the difficulties of understanding and using any shader editor. For example both POM and triplanar nodes exist for that reason alone, to simplify the process of using those effects, and many other nodes do more than meets the eye. There's even some repetition in the nodes just to make them easier to use (we have 4 different variants of depth nodes for instance, which I'm not too fan of but alas). However I think I'm being reasonable when I say that we don't want to provide ALL solutions to ALL problems by packing a ton of different shaders or presets, simply because not only there's no way of knowing what ALL means in the context of shaders but also because if we wanted to go that route then we would create a pack of shaders and not an editor. We do want to create shaders, presets and tools for the most common situations, that is why we provides samples, templates and now even small tools like the texture array creator tool. There's also the wiki we spend months finishing, more tutorial videos incoming and the fact that we do a lot support helping creating shaders and not just bug reporting. In summary, I don't think we are too far from your point of view, we are just seeing things in different perspectives (no puns intended).

    Do you mean the ball with an "S" on it? that is just a regular scene with a 3D model that picks the changes every time we save the shader (you can also have it in live mode to be constantly saving). You do that by opening the material in the shader editor.

    You should use a time node followed by a sin node and do some transformation either in between or afterwards, the sin wave will make time fluctuate and you can modulate that value to become a strobe. Something like this:

    2017-11-30_10-31-23.gif
    That is looking pretty awesome!

    We actually have some other noise functions that we were preparing for another future feature for ASE but I guess you beat us to it xD

    About the things you found:
    1. Are you using the latest version of ASE? we have custom nodes categories for shader functions node, so you ca, for example, create a noise category.

    2. We also support custom includes for shader functions:
    Unity_2017-11-30_10-36-40.png

    3. Function inputs have a auto-cast toggle that adjust the input type according to the category. If you want to follow a the graph in a different way via input type we already ruled out that option. If you want I can give you more details but to keep it short for now the conclusion we got was: any distinction between port types would happen at compile time and thus there are no benefits of having that when you can simply have more input ports with different types, this is special problematic for nodes with dynamic ports.

    4. That one is more complicated, it's similar to the previous one but with the obvious difference that you would be selecting an explicit option and not be conditioned with the nodes changing their ports automatically. We have an idea that might work but it's kinda complicated which would be to be able to create multiple versions of a shader function like an overload and have you select between them. This one is not ruled out but since it's far more complicated than it seems and you already can create multiple shader function, albeit with different names, it went into our backlog.
     
    jnbbender likes this.
  36. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    So excited!!
     
  37. TheWalkingDevTA

    TheWalkingDevTA

    Joined:
    Apr 24, 2014
    Posts:
    9
    ASE is a shader creation tool, not a shader pack. Amplify understands who they're writing the tool for perfectly! ...If you want turnkey shader packs, there are plenty available in the Unity Store already. I don't want the ASE dev's wasting their time trying to anticipate what I need; I know what I need, and I bought ASE to make realizing those needs faster, easier, and more "creative".

    One of the superpowers of ASE, as I see it, is that as you invest the time - because, you know, making games is HARD and requires a significant time investment - to build up libraries of ASE shader nets and shader functions, you begin to greatly increase your efficiency through high levels of reuse and exponentially faster refactoring of previously constructed shaders (when one needs to be tweaked slightly for a different application).

    Shaders aren't easy. However, ASE helps reduce a lot of the tedious aspects of writing them by hand. You really don't need an intimate understanding Unity's shader ecosystem to use the tool effectively; ASE takes care of hiding a lot of that from you. Look at the copious number of examples ASE provides with the package, pick up on the basic vector maths used in almost every single one, and before you know it you're being shader-creative and fulfilling the needs of whatever project you're working on.

    I'm a "real" dev, and have been for 20 years. My duties cover an broad spectrum of needs, from tools to animation pipeline/rigging to gameplay code to shaders. You are right in that time is always at a premium in the industry; I certainly don't have endless cycles to spend just on shader work, as much as I enjoy it. ASE goes a long way towards makes that bit of my job much more fun and creative, and that's a priceless contribution to my sanity in the day-to-day grind of "making fun".
     
    x4000, arnoob and KRGraphics like this.
  38. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    A new build was just uploaded into our website.
    Here are the release notes.

    Release Notes v1.3.9 dev 03:
    • New Nodes:
      • 'Projector Matrix'
      • 'Projector Clip Matrix'
      • 'Texture Transform'
    • Improvements:
      • Properties can be re-ordered on Template shaders
      • Cull, Blend Mode, Blend Ops, Color Mask and Stencil Buffer data can be read and modified on Template shaders
      • Added new custom Time port into 'Flipbook UV Animation' node
      • Templates no longer need /*ase_pass*/ tag to be declared
      • Adding UnityEngine.Object redundancy on its usage to prevent issues with other plugins
      • Outline can now take fog into account
    • Fixes:
      • Fixed issue on shader function headers being placed last on shader property list
    We have further extended template functionalities. You can now re-order properties on them ( apologies on this being available only now ... should have been way sooner ).

    They are now also reading, like we wrote on the release notes, Cull, Blend Mode, Blend Ops, Color Mask and Stencil Buffer data from the template and enabling the user to modify it.

    We, however disable it's modification if they have an associated property, p.e. on the Default UI, Color Mask is declared as ColorMask [_ColorMask] and dependent on the _ColorMask property and will show an Unreadable data on Module Color Mask message.

    Templates are still at a young stage of development and we have much more on the line for them.
    Please let us know any issues you encounter when using them.

    Hope you guys have a great weekend and happy shader creations!
     
    Last edited: Dec 1, 2017
  39. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Keep at it.
     
    x4000 likes this.
  40. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Hey,

    I'm trying to use the object scale node as the texture coordinate tiling but i get no results, if i hook a Vector3 node and manually enter the values it works, doesn't the object scale node return the gameobject's transform?

    EDIT: Figured it out, the issue was with batching, disabled it in the shader and it now works.
     
    Last edited: Dec 1, 2017
  41. TitoOliveira

    TitoOliveira

    Joined:
    Aug 4, 2014
    Posts:
    79
    Hey guys, i've been following some shader tutorials alongside ASE, and have a quick question.

    In ASE what is the equivalent to this code?
    float3 worldPos = mul(_Object2World, v.vertex).xyz

    Hooking up the VertexPosition node to the ObjectToWorld node, and outputing the x,y and z to a vector 3? The "mul" in that code is what's throwing me off here.
     
  42. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Hi there!

    Would you recommend Amplify Shader Editor for a user with no background in writing shaders?

    Thanks!

    Elmar
     
  43. x4000

    x4000

    Joined:
    Mar 17, 2010
    Posts:
    353
    Short answer: yes.

    Long answer: using this, you'll basically learn how to write shaders, but without actually having to learn shader language. You'll just be working at the logic level of them.
     
    elmar1028 likes this.
  44. x4000

    x4000

    Joined:
    Mar 17, 2010
    Posts:
    353
    Long time absent from the thread, friends. :) I see that a lot of good work has been done on ASE in the last few months, and I've been enjoying the updates.

    I wanted to ask about a pair of possibly-missing features that have been bugging me, though; you know how, on the Standard shader (all variants), there are checkbox options for "Specular Highlights" and "Reflections?" In shaders I create using the standard metallic workflow in ASE, those are basically the equivalent of "always on."

    When I'm working on certain types of environments, often reflectivity in general is very high, or direct light is very high, but I want to have some materials that stay very matte. I haven't experimented much with the matcap mode you guys added, but I don't want it to be THAT matte. ;) Basically I'd like to be able to simply turn off specular highlights and/or reflections, as separate options, using parameters that I define. Or even using a float slider that I define in order to adjust their strength, either way.

    Mainly I'm not really sure how to accomplish either thing without completely destroying the metallic nature of the material, or without turning off both things. Sometimes I want specular highlights but no reflections, or vice-versa.

    I have to say, though, that this is basically the only thing remotely missing these days. You guys do such great work, and really deserved that best-of award. Congrats on that, because I never swung by to say so when I saw you win.
     
  45. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hey everyone,

    My water shader needs a depth rejection technique as the normals I'm using are quite big so it's become noticable when polys in front of the water plane, show distortion. I'm looking to get a value between 0 and 1 which I can then multiply to erase my distortion where it matters.

    Ben Golus states:
    So I guess I'm looking to understand what the equivalent technique is for sampling the depth texture at the position of the refraction offset is and for depth closer than camera. I'd possibly use code like:

    Code (CSharp):
    1. fixed refrFix = UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(DistUV)));
    2.                    
    3.                      if(LinearEyeDepth(refrFix) < i.GrabUV.z)
    Or similar but not sure what the equivalent nodes are in Amplify. Thanks for any assists :)
     
  46. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Thanks a lot! This might be a good starting point for me then! :D
     
  47. x4000

    x4000

    Joined:
    Mar 17, 2010
    Posts:
    353
    You bet. :) I started out trying to learn shaders by hand, but found the lack of documentation really difficult. I stalled for years. Then I started using Shader Forge, and that helped a lot. I used Shader Sandwich some, too, and that also helped a bit. Then Amplify Shader Editor came out and after a month or two I switched to that and never looked back -- it's best-in-class and really well documented as well as having lots of examples.

    If you're stuck on something, be sure to look at the example shaders that are already in there; there are a lot of them, and they have network nodes that you can easily snag to build something of your own or just see how and why what they did is working. Be sure to click into individual nodes and look at their properties. Usually properties are represented pretty clearly on the node graph, but there are some exceptions.
     
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I'm hoping the template system is matured enough to create node based versions of shaders, such as alloys hair shaders. Not sure if ASE supports Kajiya-Kay and Marshner yet. I'm not a programmer
     
    x4000 likes this.
  49. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46

    Will this allow us to further customise outlines? You mentioned this would be coming with a reworking of the templates.
     
  50. ZaZy

    ZaZy

    Joined:
    Jan 14, 2015
    Posts:
    20
    I know of 2 methods to turn off specular highlights and/or reflections when using surface shaders:

    Method 1 - #Define Overrides

    Refer to *this* issue tracker post for the official method of overriding lighting defines in surface shaders. Basically you need to #define _SPECULARHIGHLIGHTS_OFF or _GLOSSYREFLECTIONS_OFF before including the UnityPBSLighting.cginc and Lighting.cginc. The Unity surface compiler will not add the includes again if it detects that your shader has explicitly included these allowing you to override any of the defines you like beforehand that would otherwise be set in the macros contained within those includes.

    Thus you can simply create a custom cginc file that contains one or both of these #defines then add this file to ASE as an additional include file. Finally you need to add 'UnityPBSLighting.cginc' and 'Lighting.cginc' as additional include files after your custom cginc file.

    Refer to my post on page 7 of this thread for a list of other lighting defines you could override in this manner.

    Method 2 - #Pragma Shader_Feature

    Unity only added the ability to turn these features off in later builds of 5.x and as such implemented them as OFF feature variants. Thus you need to have a '#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF' or '#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF' directive in your shader if you want the ability to specify the variant where these are off.

    Thus you can simply define additional pragmas in ASE for these feature directives and then set the keywords via the debug inspector tab for the materials that use your shader.

    Future Methods

    As you probably noticed the above methods do not have an interactive UI toggle for this functionality like the standard shader does. However, this would not be difficult to achieve in ASE but we would need the devs to implement either an off keyword option for static switches or a ToggleOff attribute for shader properties (so we could create a _SpecularHighlights or _GlossyReflections property to shadow the standard shader variables).

    Neither would be ideal though as we would have to actually use these blocks within our shader to ensure they were not discarded by ASE when generating the shader code. Perhaps we could have another 'shadow' attribute for properties that would not discard shader code if the property was not used.

    EDIT: Removed mention of code method for setting the keywords if using the pragma method since Unity uses shader_feature directives for variants and not multi_compile
     
    Last edited: Dec 2, 2017
    Amplify_Paulo and x4000 like this.