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

    Poupi

    Joined:
    Jan 11, 2012
    Posts:
    111
    Yes, I removed the folder, closed Unity, reopened Unity, reimported ASE + URP Templates (sorry made a typo, I'm not using LWRP at all, only URP). I don't get any error after importing ASE and the templates.
    When I try to open my shader (with many errors spamming in the console), keep the ASE window open, close unity, reopen unity, I have these errors (and the ASE window now working) :

    I'll send you in private a link with a repro project if it helps you.
    Thanks !

    Code (CSharp):
    1. FormatException: Input string was not in a correct format.
    2. System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) (at <437ba245d8404784b9fbab9b439ac908>:0)
    3. System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <437ba245d8404784b9fbab9b439ac908>:0)
    4. System.Single.Parse (System.String s, System.IFormatProvider provider) (at <437ba245d8404784b9fbab9b439ac908>:0)
    5. System.Convert.ToSingle (System.String value) (at <437ba245d8404784b9fbab9b439ac908>:0)
    6. AmplifyShaderEditor.InlineProperty.ReadFromSingle (System.String singleLine) (at Assets/AmplifyShaderEditor/Plugins/Editor/Utils/InlineProperty.cs:260)
    7. AmplifyShaderEditor.TemplateOptionsUIHelper.SetReadOptions () (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateOptionsUIHelper.cs:805)
    8. AmplifyShaderEditor.TemplateMultiPassMasterNode.SetReadOptions () (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPassMasterNode.cs:546)
    9. AmplifyShaderEditor.TemplateMultiPassMasterNode.OnRefreshLinkedPortsComplete () (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPassMasterNode.cs:539)
    10. AmplifyShaderEditor.ParentGraph.OnRefreshLinkedPortsCompleteInternal (AmplifyShaderEditor.UsageListTemplateMultiPassMasterNodes masterNodes) (at Assets/AmplifyShaderEditor/Plugins/Editor/Graphs/ParentGraph.cs:3143)
    11. AmplifyShaderEditor.ParentGraph.OnRefreshLinkedPortsComplete () (at Assets/AmplifyShaderEditor/Plugins/Editor/Graphs/ParentGraph.cs:3131)
    12. AmplifyShaderEditor.ParentGraph.Draw (AmplifyShaderEditor.DrawInfo drawInfo) (at Assets/AmplifyShaderEditor/Plugins/Editor/Graphs/ParentGraph.cs:1299)
    13. AmplifyShaderEditor.AmplifyShaderEditorWindow.OnGUI () (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:4915)
    14. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    15. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    16. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    17. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    18. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    19. UnityEditor.HostView.Invoke (System.String methodName) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    20. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    21. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    22. UnityEditor.DockArea.OldOnGUI () (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    23. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    24. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Code (CSharp):
    1.  
    2. ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint
    3. Aborting
    4. UnityEngine.GUILayoutGroup.GetNext () (at <35bab3c7b0dc4999845bcfccc7758d96>:0)
    5. UnityEngine.GUILayoutUtility.BeginLayoutArea (UnityEngine.GUIStyle style, System.Type layoutType) (at <35bab3c7b0dc4999845bcfccc7758d96>:0)
    6. UnityEngine.GUILayout.BeginArea (UnityEngine.Rect screenRect, UnityEngine.GUIContent content, UnityEngine.GUIStyle style) (at <35bab3c7b0dc4999845bcfccc7758d96>:0)
    7. AmplifyShaderEditor.NodeParametersWindow.Draw (UnityEngine.Rect parentPosition, AmplifyShaderEditor.ParentNode selectedNode, UnityEngine.Vector2 mousePosition, System.Int32 mouseButtonId, System.Boolean hasKeyboardFocus) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/NodeParametersWindow.cs:101)
    8. AmplifyShaderEditor.AmplifyShaderEditorWindow.OnGUI () (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:4962)
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    12. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    13. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    14. UnityEditor.HostView.Invoke (System.String methodName) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    15. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    16. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    17. UnityEditor.DockArea.OldOnGUI () (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    18. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    19. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    20. UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    21. UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    22. Rethrow as ImmediateModeException
    23. UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    24. UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    25. UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    26. UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    27. UnityEngine.UIElements.Panel.UpdateForRepaint () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    28. UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    29. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    30. UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    31. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <35bab3c7b0dc4999845bcfccc7758d96>:0)
    32.  
     
  2. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    [/QUOTE]

    What do you mean? You can't use both at the same time, not sure what you're asking.

    Thanks, we're going to try to replicate this asap!
     
  3. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    I can have both, but only in Stack Lit - but AS doesn't have Stack Lit template, and SG doesn't have tesselation :(
     
  4. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    Code (CSharp):
    1. Shader "ele/Main Item - Baked Vertex Lighting Bumped Specular IBL" {
    2.  
    3.     Properties
    4.     {
    5.         _Color ("Main Color", Color) = (1,1,1,1)
    6.         _MainTex ("Base (RGB)", 2D) = "white" {}
    7.         _BumpMap ("Bumpmap", 2D) = "bump" {}
    8.         //_IBLPower ("IBL Power", Range(0,8.0)) = 2.0
    9.         _Cube ("light cubeMap", Cube) = "" { TexGen CubeReflect }
    10.         _RimColor ("Rim Color", Color) = (0.26,0.19,0.16,0.0)
    11.         _RimPower ("Rim Power", Range(0.5,8.0)) = 6.0
    12.         _IgnoreBagpuss ("Ignore Bagpuss", float) = 0
    13.   //    _CubeReflection ("reflection Cubemap", CUBE) = "" { TexGen CubeReflect }
    14.     }
    15.    
    16.     SubShader
    17.     {
    18.         Tags { "RenderType"="Opaque" }
    19.         LOD 200
    20.  
    21.         CGPROGRAM
    22.         // Upgrade NOTE: excluded shader from Xbox360; has structs without semantics (struct appdata members vertex,color)
    23.         #pragma exclude_renderers xbox360
    24.         #pragma surface surf IBLLambert
    25.  
    26.         samplerCUBE _Cube;
    27.         //float _IBLPower = 3;
    28.         float _Bagpuss = 0.0;
    29.         float _IgnoreBagpuss = 0.0;
    30.         half4 LightingIBLLambert (SurfaceOutput s, half3 lightDir, half atten)
    31.         {
    32.             lightDir = normalize(lightDir);
    33.             half NdotL = dot (s.Normal, lightDir);
    34.             half diff = NdotL * 0.5 + 0.5;
    35.             half3 ramp = texCUBE (_Cube, s.Normal) * 2.5;//_IBLPower ;
    36.             half4 c;
    37.             c.rgb = s.Albedo * (ramp  + _LightColor0.rgb * diff ) * (atten); // super bright with light
    38.                
    39.             // bagpuss effect
    40.             float bp = _Bagpuss *(1.0-_IgnoreBagpuss);
    41.    
    42.             half g = (c.rgb[0]+c.rgb[1]+c.rgb[2])/9;
    43.             g = g/2+0.5;
    44.             c.rgb = c.rgb * (1.0 - bp) + bp * half3(g,g,g);
    45.             // end bagpuss
    46.            
    47.             c.a = s.Alpha;
    48.             return c;
    49.         }
    50.  
    51.         sampler2D _MainTex;
    52.         float4 _Color;
    53.         sampler2D _BumpMap;
    54.         float4 _RimColor;
    55.         float _RimPower;
    56.         float _Highlight = 0;
    57.         struct Input
    58.         {
    59.             float2 uv_MainTex;
    60.             float2 uv_BumpMap;
    61.             float3 viewDir;
    62.             float4 color : COLOR;  
    63.              // float3 worldRefl;
    64.         };
    65.  
    66.      // samplerCUBE _CubeReflection;
    67.         void surf (Input IN, inout SurfaceOutput o)
    68.         {
    69.             half4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color * IN.color;
    70.             o.Albedo = c.rgb;
    71.             o.Alpha = c.a;
    72.        
    73.             // o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
    74.    
    75.             //half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
    76.             //o.Emission = _Highlight * _RimColor.rgb * pow (rim, _RimPower);
    77.             //o.Emission = texCUBE (_CubeReflection, IN.worldRefl).rgb;
    78.         }
    79.         ENDCG  
    80.     }
    81.     Fallback "VertexLit"
    82. }
    83.  
     
  5. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Hey,

    I asked here a while ago if there will be support of custom post process for HDRP in amplify shader :https://docs.unity3d.com/Packages/c...efinition@7.1/manual/Custom-Post-Process.html

    Just wanted some news about it, do you have an eta, or is it planned on your roadmap somewhere ? I'm asking because I'll start a new production next july, this will be very important for the project, so I'll base my choice for choosing HDRP or Built-In after your anwser.

    Edit : or maybe there is already a hacky way to do it ? With a plane in front of the camera ? The problem with that solution I can already see is "As for all SRP, anything previously rendered in the Overlay layer like lens flares on light isn’t supported. Grabpass doesn’t exist anymore."
    A post process without the ability to grab screen color won't be very usefull. Unless there is a way to recreate some sort of grabpass in amplify with the HDRP ?

    Custom post process is a big deal for HDRP. As you don't have custom lightning in it, a very good way to create advanced stylised aesthetics is to use a custom post process, exactly like you would do in Unreal Engine :


    Thanks :)
     
    Last edited: May 14, 2020
  6. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    http://paste.amplify.pt/view/raw/26109490http://paste.amplify.pt/view/raw/26109490
    Ok, I see what you meant. Hopefully in the near future, we definitely want to support as many shader types as possible.

    Something like this perhaps? http://paste.amplify.pt/view/raw/26109490

    Looking at this older thread: https://forum.unity.com/threads/confused-on-example-of-surface-shader.607243/#post-4062010


    Hey, thanks for checking back.

    Actually it's bad news on that one, the plan that we initially had to support it via the Post Processing Stack was scrapped due to changes in how HDRP now handles post effects. With the new HDRP Volume system Custom Effect support, we need to provide an alternative tool to generate the necessary scripts.

    Grab pass works differently, but you can still use the Grab Screen node.

    Apologies for the inconvenience.
     
  7. Ahmadhp

    Ahmadhp

    Joined:
    May 31, 2013
    Posts:
    33
    Hi,

    You can setup precision for shaders which it's recommended to set to half for mobiles.
    But the generated code is still has a lot of variables defined in float and when I look at the shader in the xcode's frame debugger there is always this warning which is saying like ~70% of the floating point operations are in 32bit or something similar and it recommends changing it to 16bit.

    I wonder if there is a way to change this? and how much performance gain is here in mobiles?

    Thanks
     
  8. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    request: make the node search behave like unity's, when pressing up and down arrow, select the last and first item respectively.
     
  9. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    bug: when auto building the shader, if I rename a node that rename gets validated mid-build and since rebuild shader is triggered as soon as i rename a node....
     
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    I didn't know you could paste nodes directly like that. So cool.
    And yes like this thanks.
    That's the result.
    Front spheres are IBL lambert + reflection probe cubemap
    Back spheres are standard material, it kinda looks the same but at a grazing angle the standard shaders moves the reflection even with smoothness to 0 so it is still a specular "lighting"
    upload_2020-5-14_18-26-37.png

    Now this is almost there but I'd like a chery on this cake: how do I blend between reflection probes?
    Currently here is how I do it, I'd like it be automatic, like the built in renderer.
    redlection probe to custom
    upload_2020-5-14_18-29-16.png
    bake then drop the reflection cube into the IBL material
    upload_2020-5-14_18-28-48.png
     
  11. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    As a reference to other users, we isolated the problem via PM. It seems to only be present in systems with its language set to French, we've made a few fixes that should correct the issue in the next update.


    As far as shaders go, you can set the precision of individual variables as you do for the shader; they also have an "Inherit" option which would have them use the actual shader precision by default.

    upload_2020-5-15_10-26-49.png

    As for how Unity than handles these values internally, that's beyond our control as with manually created shaders.

    Thanks for the request, it's actually already on our list ;)


    Interesting, please list your exact steps so we can replicate any issues on our side.



    Yeah, it's very handy, we should promote it more.

    Glad to know it's working!

    I'm afraid there's not much you can do on the shader side to blend between them. We usually would recommend using the existing probe system with a Custom or Bake probe set to control blend; on the shader side, you'd have to adjust things a little bit and actually get the cubemap directly using something like the Indirect Specular Light node.

    Hope it helps!
     
  12. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    168
    Thanks for the quick answer !
    No problem, you are doing an amazing job with amplify and SRP :) Support for HDRP and URP currently seems like hell.
    Jason booth deprecated his really good stochastic node for shader graph. Staggart will stop dev for support SC post effect for HDRP. Both because Unity SRP team is making too much changes every releases. I thought it would get better as all SRP packages are now out of preview, but it looks like nothing has changed...
    Really worried about this, I wanted to switch to HDRP, but the more I think about it the more it seems like I'll actually get a better and faster result by using built-in and some plugins like Aura 2 and NGSS 2.
    Anyway, glad to hear it's still on track, even if it's delayed because of Unity.
     
  13. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    where is it?
    upload_2020-5-15_4-31-55.png
    select a node, change its name, as you change the editor bakes the new shader and interrupts the renaming
     
  14. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Indeed, we also had to drop support for our custom SG node on Amplify Impostors. We will continue to support SRP, hopefully things are stabilizing and we can finally support post-processing via the new system.



    My bad, I thought you were using Custom Lighting. In that case, I don't see many options unfortunately. I suppose you could have 2 Texture sample nodes and blend between them(controlled via a custom script); not sure if I'm not reinventing the wheel here, there could be an alternative.

    Thanks for the heads-up on the auto-save, I see what you mean now. We've actually corrected a few things related to the auto-save recently, we'll check if we can avoid saving if a text box is still active.

    Thanks!
     
    corjn likes this.
  15. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    This is cool, I'm almost there but the indirect specular light node returns a specular thing even when fed a world normal.
    http://paste.amplify.pt/view/raw/89bf3c56
     
  16. cyuxi

    cyuxi

    Joined:
    Apr 21, 2014
    Posts:
    49
    It's just a cube map sampler, which means you need to switch the Auto-Cast Mode to "Locked to Cube" on the Texture Object or Texture Sample node.
     
    Amplify_Ricardo likes this.
  17. owenchen1994

    owenchen1994

    Joined:
    Oct 26, 2019
    Posts:
    7
    Hi~
    I want to create a shader that only stretch or squeeze a part of the uv.
    Something like the picture below:
    I want to stretch 0.4v to 0.6v, and leave other places undeformed, how to achieve this with amplify shader editor?
    Thanks!
     

    Attached Files:

  18. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Hi I'd like to use my amplify imposter to optimize my scene.
    However I'm using a shader made by URP shadergraph.
    I tried to convert the shadergraph to an ase graph. But this shader contains a supernode "Custom Function" which reference to a .hlsl file.
    What should I do to take advantage of imposter?
    Could shadergraph shader be compatitbile with Amplify Imposter?Or could ASE work with shadergraph hlsl file ?
    Thanks.
     
  19. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there, thanks for recording the video, we appreciate it. I'm having a bit of a hard time following it, not sure if it's an audio problem on our side.

    Please elaborate, or refer us to specific time stamps, so that we can best advise.

    Hello,

    Is this for UI?

    Regarding the Custom Function:
    You can also include files for use in your Custom Expressions, as we do with Curved World.

    What should I do to take advantage of imposter?
    What is this referring to?

    Could shadergraph shader be compatitbile with Amplify Imposter?
    Amplify Impostors actually supported Shader Graph until that type of functionality was removed on their side. You should be able to recreate the same shader with ASE, let us know if you need additional details.

    Thanks!
     
  20. LCGC

    LCGC

    Joined:
    Apr 22, 2015
    Posts:
    2
    Hi: Just wondering if others ran into this as well: The node 'Vertex TexCoord' starts at 1. It refers to UV0. Number 2 refers to UV1, etc....

    Just wonding why that is and why the convention of 'start at zero' was not used... Amplify - Vertex TexCoord - Mismatch - text.png Amplify - Vertex TexCoord - Mismatch - editor.png
     
  21. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    As odd as it seems, that's expected. Unless you're running into any problems, in that case we can help sort it out.
     
    Last edited: May 19, 2020
  22. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    Thanks Ricardo! Does .hlsl file works as well as .cginc?
    Another question: I'm using URP, however I could only find "Additional Directives" option under "Surface" shader type.
     
  23. apan-bin

    apan-bin

    Joined:
    May 15, 2015
    Posts:
    29
     
  24. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    I don't think that's a factor, what's relevant is the content. You can call a function from an external file, just make sure to add the include file the Additional Directives group in the main property channel; also works with ShaderFunctions.

    From our first tests, it seems to be working. Please double-check that the Light is set to mixed or baked, and that the problem is also present on our Terrain sample.

    Can you share a simple example with the Terrain for further examination? (via support@amplify.pt)

    Thanks!
     
  25. zIyaGtVm

    zIyaGtVm

    Joined:
    Dec 27, 2017
    Posts:
    131
    I'm sorry I can't see Additional Directives group in the property channel.
    Does it mean I have to use Surface shadertype template to create an URP shader?
    add.png
     
  26. MikeChr

    MikeChr

    Joined:
    Feb 2, 2018
    Posts:
    43
    Hello. I am experiencing a problem with Unity's inspector tab when an object's material uses a Amplify generated shader. The material inspector in the tab is closed by default. When I expand a material, the entire inspector tab (inspectors for all components on the game object) becomes compressed at the top of the tab. If I resize the inspector tab, the layout goes to normal. This problem occurs every time I select an object using a Amplify shader.
     
  27. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Expand the Pass section.

    upload_2020-5-19_15-33-57.png


    Hello,

    The inspector can be a bit iffy in certain situations with the more recent SRP's. What's your current Unity and SRP version?

    I should point out that the same is true in some conditions with Shader Graph materials, not just ours.

    Thanks!
     
    Last edited: May 20, 2020
  28. ade72

    ade72

    Joined:
    Mar 20, 2019
    Posts:
    17
    Hello. I have a problem with Amplify shader. I tried create a terrain shader for unity, Albedo and Normal textures could be accessed by _Splash0..3 and Normal0..3. So far so good. A simple terrain shader is working now. But: How can I access "automatically" the MaskMap Texture, I defined in the terrain material´s? It would be nice to get the AO, Height and metallic information, because _Metallic0..3 does not have the same result as if I use the information provided in the MaskMap texture file.
    I read something about using unity´s naming convention for terrains would make things easier, but there is so few documentation about all of it.

    Any ideas? Thank you for your help!
     
  29. Amplify_Ricardo

    Amplify_Ricardo

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

    Not sure I fully understand, what do you mean by "getting" in this context? Specifically regarding AO, Height and Metallic information.

    If you double click our terrain Shader Function(this is included in our sample), you can see how the Control Splat(mask) is being used, including AO and metallic blending, etc.

    upload_2020-5-20_11-3-5.png

    Be sure to use the same naming convention as Unity.
     
  30. ade72

    ade72

    Joined:
    Mar 20, 2019
    Posts:
    17
    @Amplify_Ricardo In HDRP pipeline I would like to apply the metallic and the smoothness by using a maskmap, which I added to my terrain materials in unity.
    1) So my first question is, if it is possible in amplify shader to get "access" to ta mask map texture as it is possible to access _Splat0 or _Normal0 textures, like _MaskMap0?
    Is _Metallic0 taken from the MaskMap? Is _Smoothness0 taken from the MaskMap? Or are that only floats that apply the metallic or the smoothness to the whole texture? I would like to have control for the metallic parts and smoothness parts of one texture by using a map (MaskMap) and not a float... Sorry for my bad explanation... 2) Is the HD/Lit Shader (the metallic and smoothness inputs) capable of using maps instead of floats? Eg. if I have a texture that consists of different areas of smoothness or metallic?
    If I use your provided example, the whole texture is globally NOT smooth, though it has smooth parts, which are reflective... there is no control about reflective parts of a terrain texture.

    2) Which naming convention? I cannot find anything about it...

    Thanks a lot!
     
  31. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    Ah, thanks for clearing that up, we don't actually officially support HDRP terrain shaders at the moment, only Built-in, URP, and Lightweight.

    1. If you want to learn more about terrains go into the standard renderer(3d project) and check our Simple Terrain sample; this is how you'd access the control splat(the mask) which is that used to mix your textures; this is what I showed you in the screenshot. Metallic or smoothness can be whatever you like, you can either take it straight from the splat map(check shader function) or use your own float property to control it.

    2. I'm referring to the naming of the properties we use in our shader function; Terrain Shaders have specific requirements.

    HDRP terrain support will be added at a later stage.

    Additional Terrain details: http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Terrain_Shaders
     
  32. ade72

    ade72

    Joined:
    Mar 20, 2019
    Posts:
    17
    Okay, thank you so much, I will try that. But is it possible to apply a MASKto the smoothness input of the HD/Lit node? Or only a float?
     
  33. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    No problem!

    I'm sorry, I don't understand the context of what you're asking. What is this mask you're referring to?

    You can add pretty much anything to the Smoothness input.

    upload_2020-5-20_11-53-37.png
     
  34. ade72

    ade72

    Joined:
    Mar 20, 2019
    Posts:
    17
    As far as I understand I can input a FLOAT to the smoothness input of a shader, that means, this float sets the smoothness for the WHOLE texture / splat.
    Or I can input a TEXTURE (like a mask map or so) to the smoothness input, so this mask sets the SMOOTHNESS for different parts of the texture / splat differently (e.g. if I have a texture that has reflective and non reflective parts).

    If I apply a texture mask as in your example to the smoothness input of the HD / lit shader, all parts of the texture get the same smoothness, they are all reflective (smoothness = 1) or all non reflective. No?

    This is the unity terrain renderer (one can see very reflective parts and non reflective parts in ONE texture):

    Unity Render.jpeg

    And this one is with my custom amplify renderer:

    Amplify HD Lit Render.jpeg

    As one can see, all areas have a lot of smoothness and too much reflection. I have applied the same texture for the control of the smoothness (a maskmap that keeps the smoothness values in the alpha channel).

    The question is: Is HD/Lit shader in amplify capable of applying textures to the smoothness input?

    Sorry for my questions.
     
    Last edited: May 20, 2020
  35. ade72

    ade72

    Joined:
    Mar 20, 2019
    Posts:
    17
    Amplify_Ricardo I think that HD/Lit shader in amplify is maybe not capable of putting maps into smoothness control...
     
  36. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    I think there's some sort of misunderstanding here, allow me to clarify.

    1. ASE does not support HD terrain shaders yet.

    2. I cannot speak for your sample as I don't know what you have on your side. However, to be clear, you can connect any type of value into the smoothness input, how it's used is entirely up to you; it works just as the Smoothness on a regular HDRP shader.

    Please explain what the problem is, what's preventing you from using the mask? What's your shader setup?

    A sample, or shots, could help.

    Thanks!
     
  37. ade72

    ade72

    Joined:
    Mar 20, 2019
    Posts:
    17
    Amplify_Ricardo
    So maybe this is the problem, that I did not realize, that HD terrain support is not working yet. Because for me it IS working, only Smoothness is not working. When I use the following Amplify Shader on a unity-material, and use this unity-material as a terrain material, I can use the amplify shader as a unity terrain shader. I can mix terrains, I even can use stochastic texture controls and so on. All that does not work on HD terrain shaders is the masking of smoothness....

    Bild 20.05.20 um 15.19.jpeg

    When I use the above shader on a unity material which I choose as a terrain material for my unity terrain, I get this picture of a terrain:

    Amplify HD Lit Render.jpeg

    So the amplify shader IS working on unity HDRP terrain (only smoothness as a mask is not working). Smoothness is applied on the whole splat, not only on parts of it.

    But okay, I so HD terrain is officinally not supported, I have to change my strategy. The problem for me as a unity starter is, that there are no (easy) possibilities of getting nice terrains, because tiling is a real problem of unity terrain shaders, and the only possibility would be to use the stochastic shader for amplify (which works!). My only problem is now the smoothness, if this would work, one could use amplify shader for unity HDRP terrains...

    Thank you so much.
     
  38. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Thank you for clearing that up, we appreciate it. There's no telling what could be happening there, best to wait for official HDRP Terrain shaders as they often require specific steps, it could very well be the case for the Terrain Smoothness.

    Apologies for the inconvenience, hopefully it wont be long until we're able to support it.
     
  39. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    3:29 -- when using world normal into indirect specular lighting i get a specular behavior. how do I get a diffuse behavior instead?
     
  40. Ruskul

    Ruskul

    Joined:
    Aug 7, 2014
    Posts:
    72
    Heyo,

    I am curious. I contemplate buying amplify shader editor but I need it to do several specific things.

    All items need to work in URP with the 2d renderer.

    1.) I need to be able to do a screen color grab. Currently this doesn't work in 2d in built in shader graph. Does screen color node work in 2d in amplify shader editor?

    2.) I need to be able to grab light data in a 2d shader. Basically, I have several materials, and each needs to be lit differently and then combined for the final result. In the built in shader editor, I can't access anything about 2d lights. Further, since I can't access the light data in built in, I can't have more than one texture affected by different lights.


    I can achieve everything I need in URP 3d with built in shader graph, but I want to work with 2d lights.

    Let me know if my two requirements make any sense. I just wanted to check before I buy.

    The final product is to be a 2d, cell shaded game with faked specular highlights, SSS, and emissive internal glows. I am prepared to move the project to 3d, but I really like the simplicity of working with 2d lights. All I would need to get things to work is have a node in 2d for light direction, distance, and approximated "height" (unity uses distance variable to do normals). The game has many lights, so hopefully I could get some sort of applied lightmap to use as a texture to calculate my custom lighting. Idk.
     
  41. Sibylline-Siren

    Sibylline-Siren

    Joined:
    Jul 8, 2012
    Posts:
    22
    Hi.
    I implemented an outline effect under URP following this tutorial:
    .
    Thanks.
    I have two doubts:
    1. Following this method, would it be possible to avoid having the outline render over the original mesh? I tried messing with the render queue and stencil buffer in the pre pass thinking maybe I could make it render before the original mesh and be occluded by it but didn't manage to get the result I wanted. If not, would using sprite impostors and and rendering the outline on the sprites be the solution?
    2. Is it possible to enable and disable the extra pre pass from script? The outline is only needed to signal to the player an object is selected, and the width is set to 0 when not Rendering many objects' polygons twice for no reason seems like a waste.
    This is what I meant in the point 1. To the left, how it is now; to the right, the ideal version, where all of the object is rendered above the outline:
     
  42. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Based on your scene; can't really tell if that's the expected result or not. Can you send us a small sample for further examination by one of our devs? (including the scene)

    Hey there!

    Not sure actually, I suspect there might be some sort of limitation if it does not work with Shader Graph. In any case, I can ping the developers for additional details.

    Which URP version are you using?

    1. Actually had some difficulty getting it to behave as so in URP; I've requested additional developer input, I'll get back to you on this.

    Does work with the built-in renderer:
    upload_2020-5-22_20-7-48.png

    2. Not possible due to the way shaders are generated, best choice would be to swap over to a material using a simpler shader without the extra pass.
     
  43. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    here it is.

    Also this outline node: how do I use it? Normally I'd add an extra pass but I don't know how to do that with standard specular in amplify.
    upload_2020-5-22_14-17-49.png
     

    Attached Files:

  44. Sibylline-Siren

    Sibylline-Siren

    Joined:
    Jul 8, 2012
    Posts:
    22
    Thanks a lot
     
  45. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    112
    Hey Amplify,

    I hate to be a pest but I am following up again on my post page 111 : #5540 regarding manual Mip Map Level generation. I know you guys said you were backed up but it's been more than a month since the original post and I would really like to solve this bug issue I am having. How backed up are you? Any idea when I might be able to expect a resolution to that issue?

    Big thanks for any info you can provide.

    Cheers!


    Direct Link:
    https://forum.unity.com/threads/bes...er-creation-tool.430959/page-111#post-5738125
     
  46. Amplify_Ricardo

    Amplify_Ricardo

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

    The Outline node goes into the Vertex Offset input.

    Thanks for the sample, we will check it out as soon as possible.


    So, after some more testing, it turns out that it's actually not possible with the built renderer; the screenshot/test was a bit misleading, you can actually cause it to fail by placing the cube in specific positions. It's not really a URP limitation, it's simply due to the way Unity handles it.

    A possible workaround is to use 2 different materials so that you can place them in different rendering queues; 1 material for the boxes and 1 material just for the outline which could be placed in render queue Geometry -1.

    It's not perfect but it could work; alternatively, using an image effect based solution for the outline is usually a good choice.


    Apologies for the delay, it has been hard to keep up at times in the last couple of weeks. Let me ping the developers, we've been trying to get up to speed on both ASE and AI so we've been alternating between them, we should be close to your ticket.

    I'll let you know in a couple of hours.

    Thank you for your patience.
     
    laurentlavigne likes this.
  47. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Ok, we're not 100% sure on this one so please excuse us if we're not fully accurate here as it seems that Unity's own filtering options somehow interfere with the results; we're not quite sure how that's happening in this particular case.

    As per-developer input, what you're doing is almost complete but you need two more steps. 1. Make sure that the texture coordinate node is referencing the correct Texture Sample, 2. You need to use a Texel node to get the width and height so that you can multiply it with the UV's before the DDX/DDY operation.

    As with this example:


    However, you can get different results depending on your texture filtering settings; the example above seems to work as with Bilinear Filtering and an Aniso level of 1. It's important to note that this will no longer make sense if Anisotropic Filtering is forced in the Quality settings.
     
  48. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    Hi Amplify,

    I'm working on a procedural skin shader in which I'm using Substance designer. Ideally I would love to have it entirely shader driven. Is it possible to position an image with coordinates, and then scale that image relative to itself?

    As an example; say I have a 3d box and I would like to position an image in the lower left of the boxes face (see image). Then I would like to be able to scale its size at the location. If you're familiar with Substance Designer, I typically would use a Shape node or SVG, then a Transform node to position and scale, followed by a Blur node to soften the shape.

    Thanks!

    transform_02.png
     
  49. Amplify_Ricardo

    Amplify_Ricardo

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

    You can manipulate UV position as required, we provide quite a few nodes for it along with the basic Texture Coordinate node. It's important to keep in mind that such manipulation will rely on your mesh existing UV's; triplanar projection is also possible but I'm not sure that this is what you're looking for. (be sure to adjust your texture parameters to not repeat the texture, clamp it)

    Hope it helps!
     
  50. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    Hey there,

    Just to confirm that you are getting the expected result; that node is returning the Reflection Probe value. If you want a diffuse result, you should use the indirect diffuse light node, not to be confused with the previous, which will return the Light Probe value.

    Alternatively, maybe you can explore a solution using a Custom Expression for full control.