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

    StudioEvil

    Joined:
    Aug 28, 2013
    Posts:
    66
    Hi, i have a feature request :D

    The "Register Local Var" and "Get Local Var" nodes should have a more readable varname label. When you are zoomed out a little it's actually impossibile to read the var name. It should be a node with a large label :)

    Thanks and keep up the awesome work!
     
  2. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Particles Alpha Blend is a template based on Unity default Alpha Blend shader. So by creating your ASE shader with it, a vertex/frag shader with the same properties as the template ( automatically set for alpha blending and able to be soft particle). Also, performance-wise, it is lighter than a surface shader.
    We will be releasing documentation on templates really soon so you guys can see what is being done under the hood and better understand what is being generated.

    Integration with MegaSplat was done by its developer Jason Booth, and he did such an amazing job. We would recommend reaching him to see if he also has plans on integrating MicroSplat with ASE.

    By looking at your shader, the most expensive operations are probably the texture fetches via the 'Texture Sampler' node. You shouldn't need to worry too much about Lerps nodes since they are only a linear interpolation operations.
    Overall the shader doesn't too look heavy.
    Be sure to set the Output node Precision option to Half since its most suitable for mobile. Also if Texture Samplers are sharing texturing coordinates then you could create a Texture Coordinates node and share with all of them ( this will internally decrease the amount of interpolators used ).
    The best way to benchmark is really to create a test scene and try it out on your target mobile device.
    You can also analyse the amount of final generated instructions on the shader.
    For now, you are able to see this info by hitting the 'Compile and Show Code' on the shader inspector. This will show the final compiled code with comments on average math instructions used.
    We are planning on showing this information directly inside ASE on the future.

    Select your Texture Sample node, create an Attribute by hitting the Plus(+) button on the Attributes section at the Node Properties window and select the No Scale Offset option on the newly created attribute.

    The final shader is totally independent of ASE. You can share it with anyone and use it in any project independently if ASE is installed or not.


    That's quite a nice suggestion. You were thinking on something similar to how we present the Comment box Frame Title?
     
    Last edited: Aug 24, 2017
  3. benderete

    benderete

    Joined:
    Aug 31, 2014
    Posts:
    129
    Hi, have seen that you cannot change the material properties order on other templates but surface.
     
  4. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Thanks you so much for pointing that out!
    We've only added basic node properties into the new Templates Output node and will gradually add more functionalities into it. We'll add the Material Properties section on Templates on a future build.
     
    Last edited: Aug 24, 2017
  5. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    The only problem currently with the templates is the inability to set the shader model such as Kajiya-Kay or Marschner for hair, or Pre-Integrated for skin. I am looking to replicate a skin shader I had years ago before I used Alloy. It was kinda like this:

    Look up the pre integrated shader for Unity... this is the shader I used and is THE ONLY shader where I can get the skin looking THIS GOOD!!
     
  6. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Did you have problem with intergrating this skin shader with PBR energy conserving workflow?

    Also does someone know how to compress the LUT texture of this skin shader with zonal harmonics (ie going from a 256 size texture to a row of 4 number)? like The Order 1889 did?
     
  7. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I haven't tried it yet. Gonna try with the Alloy eye shader and see what I get out of it.
     
  8. pwTA

    pwTA

    Joined:
    Mar 20, 2014
    Posts:
    5
    I've found an ASE compiler bug when you try to do a custom lit mask shader. The setup is super simple (shader source is also attached):
    2017-08-24 17_26_47-.png

    2017-08-24 17_26_30-.png

    Save/compile throws this to the console:
    2017-08-24 17_26_57-Unity 5.6.2f1 (64bit) - Untitled.png

    The reason is simple: the compiler is trying to use a local variable from the custom lighting function down in the surf function.
    2017-08-24 17_33_09-AmplifyShaderSandbox .png
    Cheers!
     

    Attached Files:

  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    About to test this template feature out using the Alloy Eye shader... should be easy to do
     
  10. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I was so wrong about that :/ I am not a shader programmer...
     
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Is anyone getting random crashes with the latest version of ASE? Unity crashes when I save a new shader and it doesn't play nicely.
     
  12. Gray_Master

    Gray_Master

    Joined:
    Jun 20, 2010
    Posts:
    152
    in Post-Process shader type i detected errors (as examlpe - color node not set color or blinking image in texture module).

    PS. If create shader as surface & convert after it then this bugs i not look.
    PPS. While we want Oficial Post Process examples? :)
     
    Last edited: Aug 25, 2017
  13. pro-bchevalier

    pro-bchevalier

    Joined:
    May 30, 2013
    Posts:
    46
    Hello @Amplify_RnD_Rick can I ask again if there's anything on the way regarding terrain shader support?
    I'm just curious, no pressure :)
     
  14. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Yep, you are right, that's a bug, I must have missed it somehow and forgot to do the proper placement of that port code. Good catch and also good report ;)

    Sorry for the inconvenience though, I'll fix it for the next build release.
     
    pwTA likes this.
  15. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Have you noticed some kind of sequence of actions in order to crash the editor, p.e. you just create a new shader, try to save it and it crashes?
    Is it possible for you to give additional info on this so we can try to replicate on our end?

    The errors you detected are on the node previews or on the generated shader result?
    Concerning Post-Process examples, we are planning on adding more as we improve the templates features.

    Our next task on the list is to greatly improve Templates, more specifically we want to add support to multi-passes into them.
    This improvement will then allow us to create a wide range of new official templates, one of them being a Terrain template.
     
    antoripa, KRGraphics and benderete like this.
  16. Gray_Master

    Gray_Master

    Joined:
    Jun 20, 2010
    Posts:
    152
    This errors detected on the node previews, but may be i not correctly configuring shader (with grab screen vector/frag error too)
     
  17. brett_ridel

    brett_ridel

    Joined:
    Jan 15, 2017
    Posts:
    33
    Hi all

    I'm coming because I have a problem with a really simple shader. I compare 4 different shaders, each applied on a sphere (from left to right on the following picture).
    The first one is a Standard one (from Unity) with no smoothness. The second one is the most basic with ASE (just a diffuse color). The third one use the node WorldNormal as default normals. The last one use the node VertexNormal as default normals.


    Here is a screenshot of the three ASE shaders


    The first and the second shading look good (for the cos term at least).
    However, the third and the fourth looks really bad.

    My question is, how is the Normal input used for ?

    Cordially
    Brett
     
  18. Gray_Master

    Gray_Master

    Joined:
    Jun 20, 2010
    Posts:
    152
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Good morning, all... decided to tackle a new shader... and it's pretty boring and basic but a necessity. Grass...

    upload_2017-8-25_8-10-13.png upload_2017-8-25_8-10-29.png upload_2017-8-25_8-19-47.png

    The CG designer in me is screaming that the grass should be casting shadow, but it isn't. Any way I can get it to cast shadow? And what about vertex movement to simulate a grassy field...

    EDIT: Got shadow casting to work on this... had to enable alpha blending for Blend Alpha
     
    Last edited: Aug 25, 2017
  20. brett_ridel

    brett_ridel

    Joined:
    Jan 15, 2017
    Posts:
    33
    Problem is, I don't want to use a normal map. I would like a flat shading, so I compute my own normals in the shader. I test it with the Emission input, that works great.

    However, if I put my shading in the Emission input, I loose the projected shadows. And if I put my shading in the Albedo input, I lose the "flatness".

    Is there a way to "retrieve" the projected shadows and add it to my shading ?
     
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    It seems to happen at random. I was just saving my grass shader and the editor crashed. I am on Unity 2017.1
     
  22. Gray_Master

    Gray_Master

    Joined:
    Jun 20, 2010
    Posts:
    152
    brett_ridel, in local vertex normal i think, but i not use it, ask other users about
     
  23. brett_ridel

    brett_ridel

    Joined:
    Jan 15, 2017
    Posts:
    33
    Ok, solved problem. If you want to combine shadows (projected or costerm) with color, and that you want to use a different normal (ex: flat shading) without a normal map, you can use the custom light mode combined with a Light Attenuation node.
     
  24. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Hey brett.

    Just like Gray_Master already said, you want to use the "local vertex normal" output in the masternode. The first "normal" that you see on the top accepts normals in tangent space, these are usually normal maps like Gray_Master already demonstrated. If you want to actually change the normals of your mesh with the shader you need to calculate it somehow and pass it to the local vertex normal output. Just keep in mind these new normals must be in local/object space in word for it to work.

    vertexnormal.png

    For example if I use the "Vertex Normal" and feed it directly into that port it will use whatever normals your mesh has since that node fetches the vertices normals as they are (in local space) in your mesh. This is actually done by default so having it connected like this doesn't actually change the final result.

    You'll have to figure out the math you need to generate or change the normals for your case. For example, maybe you want to do a waving flag, then you would use some sort of wave function that has the vertex position into consideration.

    The "World Normal" you were using earlier gets you the normal in world space (hence the name) and it's a helper node to also accepts a normal in tangent space, this is usually useful for certain effects like custom lighting.

    @KRGraphics if you want to do wind movement you need to use a wave function that generates some pseudo random values based on the vertex position of your vertices and that also accepts a time variable. Then it's a matter of using vertex color to filter what you want or don't want to move (ie: paint the base vertices black so it doesn't move with the function)
     
    antoripa likes this.
  25. brett_ridel

    brett_ridel

    Joined:
    Jan 15, 2017
    Posts:
    33
    Thanks for the explanations ;-)
    I have to admit that I didn't see this "Local Vertex Normal" input.
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I am like confused as hell right now about what that means lol. I could use a gradient too, but I have different grass patches too.
     
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Having some fun with building my library of shaders... creating an insane effects library to include a shader function for turning people into gold...


    This is my KRGraphics Glass HQ shader. And I plan on adding a shader function that will allow users to make the glass look frosted with a tiling opacity map. Is there a way I can add colour to my glass?

    upload_2017-8-26_0-26-1.png

    "Frosted Glass". I don't know how to do the actual frost but this is a nice hack for now...

    upload_2017-8-26_0-44-9.png

    upload_2017-8-26_0-44-26.png


    At the moment, I am not happy with the Midas Curse Shader Function... I need some procedural noise to REALLY make this effect special. It is supposed to turn the opponent into solid gold. I will also do a Lead variation.

    upload_2017-8-26_0-28-51.png
     
    antoripa and hopeful like this.
  28. Phaas

    Phaas

    Joined:
    Apr 5, 2017
    Posts:
    5
    Hi,

    I'd like to create a shader on a UI image or Something else on UI.

    I have the lastest Amplify Shader version from the unity store (1.2.1 aug 17,2017) and i m not enable to find Something about image or sprite.

    I'm a beginner with shader, could you give me some help ?

    Thanks.

    PS : samples

    I have a manual shader good for my ui, i can't write something like that with the editor however a lot of comparison and test.

    Code (CSharp):
    1. Shader "Custom/My2DShader"
    2. {
    3.     Properties
    4.     {
    5.         [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
    6.         _NormalsTex ("Sprite Normals", 2D) = "bump" {}
    7.         _Ramp ("Shading Ramp", 2D) = "white" {}
    8.         _Color ("Tint", Color) = (1,1,1,1)
    9.         [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
    10.         _Cutoff ("Alpha Cutoff", Range (0,1)) = 0.5
    11.     }
    12.  
    13.     SubShader
    14.     {
    15.         Tags
    16.         {
    17.             "Queue"="Transparent"
    18.             "IgnoreProjector"="False"
    19.             "RenderType"="Transparent"
    20.             "PreviewType"="Plane"
    21.             "CanUseSpriteAtlas"="True"
    22.         }
    23.  
    24.         Cull Off
    25.         Lighting On
    26.         ZWrite Off
    27.         Fog { Mode Off }
    28.         Blend SrcAlpha OneMinusSrcAlpha
    29.  
    30.         CGPROGRAM
    31.         #pragma surface surf CustomLambert alpha vertex:vert addshadow alphatest:_Cutoff
    32.         #pragma multi_compile DUMMY PIXELSNAP_ON
    33.  
    34.         sampler2D _MainTex;
    35.         sampler2D _NormalsTex;
    36.         sampler2D _Ramp;
    37.         fixed4 _Color;
    38.  
    39.         struct Input
    40.         {
    41.             float2 uv_MainTex;
    42.             fixed4 color;
    43.         };
    44.        
    45.         half4 LightingCustomLambert (SurfaceOutput s, half3 lightDir, half3 viewDir, half atten) {
    46.             half NdotL = dot (s.Normal, lightDir);
    47.             half4 c;
    48.             c.rgb = (s.Albedo * _LightColor0.rgb * (tex2D (_Ramp, half2 (NdotL * 0.5 + 0.5, 0)))) * (atten * 2);
    49.             c.a = s.Alpha;
    50.             return c;
    51.         }
    52.        
    53.         void vert (inout appdata_full v, out Input o)
    54.         {
    55.             #if defined(PIXELSNAP_ON) && !defined(SHADER_API_FLASH)
    56.             v.vertex = UnityPixelSnap (v.vertex);
    57.             #endif
    58.             v.normal = float3(0,0,-1);
    59.             v.tangent = float4(-1, 0, 0, 1);
    60.            
    61.             UNITY_INITIALIZE_OUTPUT(Input, o);
    62.             o.color = _Color * v.color;
    63.         }
    64.  
    65.         void surf (Input IN, inout SurfaceOutput o)
    66.         {
    67.             fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color;
    68.             o.Albedo = c.rgb;
    69.             o.Normal = UnpackNormal (tex2D (_NormalsTex, IN.uv_MainTex));
    70.             o.Alpha = c.a;
    71.         }
    72.         ENDCG
    73.     }
    74.     FallBack "Diffuse"
    75. }
     
    Last edited: Aug 26, 2017
  29. brett_ridel

    brett_ridel

    Joined:
    Jan 15, 2017
    Posts:
    33
    Hi all

    I'm posting because I'm pretty sure there is a bug in the HSV to RGB conversion (I suppose it's the same with RGB to HSV too).
    Doing HSV to RGB then RGB to HSV give the same result as input, it's a good point. However, I think there is some biais inside each conversion.

    I explain myself : if you put as attribute some H S and V on the node "HSV to RGB" (unlit material), the final color does not correspond. You can easily test it with the following values as input : H=9, S=255, V=255 (I did not forget to normalized them : H=0.025, S=1, V=1)
    When you pick the final color with Unity (or an other color picker), you will obtain H=25, S=255, V=255.

    I take advantage of this post to ask if there is an easy way to add other color conversion inside Amplify Shader Functions. I took a look on the generated file corresponding to a simple Amplify Shader Function, it's not really clear how to add my own code, there are a lot of different strange fields (fileID, guid, ...).

    Brett
     
  30. SpyChar

    SpyChar

    Joined:
    Jul 15, 2012
    Posts:
    11
    Hi. Is it possible while using POM node to tile only the heightmap without tiling the albedo?
     
    Last edited: Aug 27, 2017
  31. Carrion-Crow

    Carrion-Crow

    Joined:
    Apr 3, 2015
    Posts:
    15
    Hi, I got an error related to the texture array instance is there any way to get around this problem

    Shader error in 'test': undefined variable "TextureArray0" unable to find compatible overloaded function "texCUBE(error, float3)" at line 28 (on d3d9)

    Capture.JPG Capture.JPG
     
  32. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    POM always uses the input texture object as the reference for the tilling, so in a sense, it's should already be doing what you want, I took a look at it and there's a bug preventing the use of it. I'll fix this asap, it's a simple one, expect it on the next release.

    That is somewhat the intended behavior, we don't really want to have cases where you can generate shader code with errors, that part is not intended but we are aware of such cases, what's somewhat intended is how you are linking your texture array nodes. The blue one is the original, the grey is a copy, without generating the code for the original the grey can't generate his, and in your case your blue one isn't connected to any masternode port. We've been changing this in the past few builds so that the grey node forces the blue one to generate code even if it's not connected (if you try to do the same with samplers it will work). There are various reasons that I wont go in detail here as to why this is a bit more complicated than it seems. Either way, you can expect this to change soon, so just bare with it a lit bit more until we fix it. For now though just keep in mind that your blue original must be connected somehow to the masternode.
     
    Last edited: Aug 28, 2017
  33. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    POM (Parallax Occlusion Map) method: 65 fps
    Distance Based Tessellation method: 170fps
    View attachment 244278 View attachment 244279

    Also i have created terrain shader using ASE but the AddPass version does not worked correctly
    The FirstPass was OK (Edited shader manually to match with unity terrain AddPass and FirstPass shader)

    First Pass Shader :
    1. All names must we matched with unity terrain shader names :Control,Splat0,Splat1,Splat2,
    2. You can duplicate FirstPass shader and use Dependency keyword manually to connect AddPass to FirstPass
    https://alastaira.wordpress.com/2013/12/07/custom-unity-terrain-material-shaders/

    Untitled.jpg
     
    Last edited: Aug 28, 2017
  34. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    I found the terrain shader in visual style :
    Unity 4 Simple terrain shader :
    Code (CSharp):
    1. fixed4 splat_control = tex2D (_Control, IN.uv_Control);
    2.     fixed3 col;
    3.     col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb;
    4.     col = col +(splat_control.g * tex2D (_Splat1, IN.uv_Splat1).rgb);
    5.     col = col +(splat_control.b * tex2D (_Splat2, IN.uv_Splat2).rgb);
    6.     col = col +(splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb);
    7.     o.Albedo = col;
    Now same thing inside ASM :
    Untitled.jpg
    Generated code by ASM:

    Code (CSharp):
    1. float2 uv_Control = i.uv_texcoord * _Control_ST.xy + _Control_ST.zw;
    2.             float4 tex2DNode1 = tex2D( _Control, uv_Control );
    3.             float2 uv_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
    4.             float2 uv_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
    5.             float2 uv_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
    6.             float2 uv_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
    7.             o.Albedo = ( ( ( ( tex2DNode1.r * tex2D( _Splat0, uv_Splat0 ) ) + ( tex2DNode1.g * tex2D( _Splat1, uv_Splat1 ) ) ) + ( tex2DNode1.b * tex2D( _Splat2, uv_Splat2 ) ) ) + ( tex2DNode1.a * tex2D( _Splat3, uv_Splat3 ) ) ).rgb;
    8.             o.Alpha = 1;
    note : My shader name is "0" for FisrtPass and "1" for Add Pass
    1. Open this shader code ("0")and add :
    Code (CSharp):
    1. // used in fallback on old cards & base map
    2.     [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {}
    3.     [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1)
    into end of the your properties :
    Code (CSharp):
    1. Properties
    2.     {
    3.         [HideInInspector] __dirty( "", Int ) = 1
    4.         _Control("Control", 2D) = "white" {}
    5.         _Splat0("Splat0", 2D) = "white" {}
    6.         _Splat1("Splat1", 2D) = "white" {}
    7.         _Splat2("Splat2", 2D) = "white" {}
    8.         _Splat3("Splat3", 2D) = "white" {}
    9.         [HideInInspector] _texcoord( "", 2D ) = "white" {}
    10.         // used in fallback on old cards & base map
    11.     [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {}
    12.     [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1)
    13.     }
    2. Update sub shader tags :
    Code (CSharp):
    1. Tags{ "SplatCount" = "4"
    2.         "Queue" = "Geometry-100"
    3.         "RenderType" = "Opaque"}
    3. Add Dependencies to your shader (before Fallback) :
    Code (CSharp):
    1. Dependency "AddPassShader" = "0"
    2. Dependency "BaseMapShader" = "Diffuse"
    3. Dependency "Details0"      = "Hidden/TerrainEngine/Details/Vertexlit"
    4. Dependency "Details1"      = "Hidden/TerrainEngine/Details/WavingDoublePass"
    5. Dependency "Details2"      = "Hidden/TerrainEngine/Details/BillboardWavingDoublePass"
    6. Dependency "Tree0"         = "Hidden/TerrainEngine/BillboardTree"
    7.     Fallback "Diffuse"
    8.     CustomEditor "ASEMaterialInspector"
    4. Now duplicate this shader and rename it to "1" to use it as AddPass .

    5. Open "1" shader and remove :
    Code (CSharp):
    1. // used in fallback on old cards & base map
    2.     [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {}
    3.     [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1)
    from properties

    6. Update shader tags :
    Code (CSharp):
    1. SubShader
    2.     {
    3.         Tags{ "SplatCount" = "4"
    4.         "Queue" = "Geometry-99"
    5.         "RenderType" = "Opaque"}
    7. Remove Dependencies and set fallback to "off"
    Code (CSharp):
    1. Fallback off
     
    Last edited: Aug 28, 2017
    hopeful likes this.
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Is this from the template? Sweet
     
  36. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    No. I didn't see templates at all. I just converted Unity 4 Terrain shader to Amplify nodes. Final version with tessellation :
    Untitled.jpg

    Now i found some new problems :
    1. Accessing to AddPass displacement float variables
    2. Blending AddPass layer with FirstPass seamlessly
     
    antoripa and brisingre like this.
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Nice... I am trying to convert the Alloy Hair to ASE, but having a tough time with that. I got the normal, albedo, and opacity working, but for things like Specular highllights, that isn't working out
     
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Would be nice if there's a built in template from ASE
     
  39. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Hi,

    You can create UI shaders using our latest Templates feature.
    This feature is still not available at the Unity Asset Store. To get access to it , please go on our Download page, place your ASE invoice number on the text area and it the Unlock button.

    After you've imported this new build you can create a new UI shader by hitting the right mouse button on the project view and selecting Create > Amplify Shader > Default UI.
    This UI template is based o Unity Default UI shader.

    You can also check some UI examples we already made at our samples folder AmplifyShaderEditor\Examples\Official\TemplateExamples\UI.


    Thank you for reporting this. We'll take a closer look at its generated code/results and see if there's an issue on it.

    You do not need to edit manually a shader function.
    The easiest way is to create your own shader functions and edit them inside ASE.
    Select Create > Amplify Shader Function. After you've named your shader function it will automatically be opened on ASE.
    Here's a brief explanation on how to work with shader functions.
    You also have another option, which is creating a Custom Expression node and manually add your new color conversion code on. Please take a look on it's documentation for further details.


    Hi aliyeredon2,
    Thank you for posting these results.
    They are bit as expected as they are quite different techniques. POM does occlusion mapping , for each pixel it calculates if it's occluded or not. This is heavier than Distanced Based Tessellation which simply tessellates the geometry over the GPU according to the distance to the camera.


    Thank you so much for letting us know your process and what type of obstacles you're encountering.
    This is really useful.

    Yes, unfortunately ASE still doesn't support Unity terrains. Having to always edit a shader manually is not something that we want our users to have to do.
    As we improve our templates feature to have support to multiple passes we will be able to include an official Terrain template.
     
    Last edited: Aug 28, 2017
  40. Carrion-Crow

    Carrion-Crow

    Joined:
    Apr 3, 2015
    Posts:
    15


    Not in this case
    If we do this with the usual textures, then everything is fine Capture.JPG
    But if we do this with texture arrays
    Capture.JPG

    Shader error in 'test': undefined variable "_TextureArray0" unable to find compatible overloaded function "texCUBE(error, float3)" at line 28 (on d3d9)
     
  41. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Like I said, we've been changing this in these past builds, the texture sampler was the first one because it's one of the most common ones. Internally we already did the changes for texture arrays as well, should come up in the next build.
     
  42. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hi,
    Is there any way to define variable name created in the code?
     
  43. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    How are you creating the variable in code? custom expressions?
     
    antoripa likes this.
  44. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hi Paulo ..
    I think I was not really clear in my question. I was thinking to the capability to customize the node variable name for the generated code. That becuase can happen that I do some optimitation on the code and when is large it not easy to trace the flow ..


    upload_2017-8-29_18-2-35.png
     
  45. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    While you are creating your shader you can always use the register variable node, that will force you to create a local variable anywhere in the code and you can customize it's name, it wont prevent individual nodes like the append node from creating them as well tho. You could then remove those register nodes when you finish the creating and let the editor do the optimizations itself.
     
    antoripa likes this.
  46. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Yep . .that is my current approach .. I was asking just to put less node on the canvas for a better organitation ...thanks a lot
     
  47. 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.0 dev 03:
    • Improvements
      • Completely refactored and changed the graph and node rendering to use a semi-MVC model
        • Improves the overall performance in several orders of magnitude
      • Various small visual fixes and improvements
      • Various changes to prevent most memory allocations heavily reducing GC
      • Changed zoom and auto-pan to a smooth version and fixed its auto-boundaries
        • This should make the editor feel more snappy and responsive
      • New object pickers for 'Substance Sampler' and 'Triplanar Sampler'
      • New outline for selected Wire nodes
        • Now is easier to see in all situations
      • Various previews were added,improved or fixed
        • Texture Sampler' nodes now properly display default values
      • Tweaked Input Type labels on 'Custom Expression' nodes to match shader variable type names
      • Custom Lighting nodes now show internal data and have additional Normal options
    • Fixes:
      • Fixed 'Texture Array' node issue when referencing an un-connected node
      • Fixed UI issue on 'Custom Expression' qualifiers
      • Fixed issue on shader name being overwritten when changing template
      • Fixed issue on copy/cut/paste not being correctly caught by nodes search bar

    Talking about the performance update:

    This build completely changes the way nodes are being rendered while still trying to maintain compatibility with user-created nodes. We are taking advantage of how Unity GUI works to make these improvements significant to the point where really huge nodes trees still render pretty fast.

    We did test it a lot internally to make sure everything is working as before but faster.

    That being said there's still the possibility of conflicts and bugs with this new system so we really appreciate if you could report any weirdness you encounter after updating.

    We also recommend closing your ASE windows before importing this new version, just in case.

    Have you also tried out creating shaders using our Templates feature? Please check its documentation to see how you can start using them.

    Here's a sneak peek on one of our newest samples using the Particles Template.



    Happy shader creations!
     
  48. RoyArtorius

    RoyArtorius

    Joined:
    Jul 11, 2013
    Posts:
    73
    I do have a bug that I'm not sure if has been fixed yet.
    When I have a shader that has tesselation on and vertex color is being used, the result is pretty bizarre. I'm developing a voxel terrain system and using vertex color to determine the voxel type (the texture) displayed, red is one texture, green is another texture, etc. The problem is that with tesselation on, only the red vertex color texture is displayed, but not in the scene view. In the scene view, the shader works fine. After fiddling with it for far too long, I just disabled tesselation. I'm honestly just reporting this bug and hopefully someone could tell me what is the cause.
    Using the latest version of Unity 5.6 and the version of amplify shader editor on the asset store (I think)
     
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I need to read into this. I'm trying to convert the Hair shader from Alloy and the ASE tags will help.
     
  50. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Today i found a big problem and its solution about terrain tessellation :

    Tessellation will be skipped on the flat terrain. But after painting some Heights ,everything will work properly

    This issue killed my day to find this. I thought the problem was from nodes.



    Untitled.jpg