Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

[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. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    151
    Yes. I've already checked that they are the latest version.
     

    Attached Files:

    • hdrp.JPG
      hdrp.JPG
      File size:
      59.9 KB
      Views:
      283
  2. Johny-Gull

    Johny-Gull

    Joined:
    Apr 22, 2014
    Posts:
    3
    Yeah! Thanks, Amplify Borba for Screen Depth :)
    I should have read the wiki carefully

    UPD: as it turned out, the problem was in the scene in which I worked. Advice to everyone, just in case, create a shader in a clean scene :)
     
    Last edited: Dec 20, 2018
  3. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    279
    Hey there ! Any ETA for GrabPass support for the HD SRP ? I've been looking into some forum threads about an official support from Unity (for their shadergraph) and so far I've only seen some sort of workaround for the LWRP (??), using an hack with _CameraOpaqueTexture. Nothing related to HDRP yet...How do they make their glass shader then?

    The only thing I want right now is to get the pixel rendered behind, just to make a lerp with the result of my shader. I don't think I can achieve that with the different blend modes, so I ended up going with grabpass, but hey, no support yet :(
     
  4. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    151
    @Amplify_Borba I've created new project in 2018.3 and done the update again. Some shaders still show warning "floating point division by zero" but they don't have any error. I'm not sure what's the problem with previous project. It may be because the Amplify plugin wasn't updated properly when I updated it from Asset Store version to your website version.
     
  5. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    195
    In case you are packing your textures, here is a comparison for normal map packed in different channels.
    Of course this meters only if the texture is compressed.

    Left image: Nx (Green channel) Ny (Alpha channel), this is how unity packs the normal map
    Right image: Nx (Red channel) Ny (Green channel)

    upload_2018-12-20_17-1-5.png
     
  6. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    No problem, thank you for letting us know you've sorted it out!


    Hello, due to lack of grab pass support in the HD SRP, I'm afraid that we'll only be able to support Refraction in our upcoming HD Lit Template, which is based on Unity's HD Lit master node and will solve some issues that the HD PBR has.

    We have no ETA for this, but it should be coming soon as we're actively working on it!


    Glad to know you've managed to solve the issue you were having!

    It's possible that if your previous project had errors present in the console, Unity's package manager could to fail to import ASE correctly. This is usually solvable by clearing the errors first and then reimporting ASE.

    If there were no errors in your project, it might've been a compatibility issue with another tool or asset in your project.

    Regarding the warning, you can disregard it as it's harmless, hopefully we can remove or hide it in a future build.


    Thank you for sharing!
     
    Last edited: Mar 20, 2019
    cAyouMontreal likes this.
  7. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    279
    Thanks for giving me an answer, I'm stuck right now with an blend I want to achieve, and I think I can't do it without getting the pixel rendered behind and doing some quick math (like an average). I basically encode "wind" direction into red and green channel, with a zero vector set at 0.5/0.5. So if you have first a color of 1/0.5 and then on top of it a color of 0/0.5, the logical result should become 0.5/0.5. And this result can't be achieve using basic blend modes. I can't even find a way to set the BlendOp on the HDRP template, I don't know if it's supported or not, and if there is a reason why it's not.
     
  8. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,382

    Hey there,

    I've been keeping an eye on this case and I would like to remind everyone that while we encourage you to distribute your custom content, we cannot allow anyone to freely distribute our editor; be it partially or any other form of source replication.

    We've requested that you remove our editor from your repository, nothing more. Making it private is a viable choice, how you distribute your content will definitely depend on your requirements but allowing other users to access our source violates the Asset Store terms of service. This situation is not a direct result of your forum post, it's the result of distributing our assets for which we occasionally search GitHub for; you would be surprised with how many people accidentally include paid packages in their public projects.

    I would appreciate it if you could explain why you need to include our source in your repository.

    Thanks!
     
    Last edited: Dec 21, 2018
  9. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,958
    It's easy to believe that people accidentally post partial or entire assets online.

    I know that in the Unity forum, every once in a while a developer new to Unity that's having a problem with a plugin will append their "problem project" to a public comment, thereby allowing anyone reading the thread to download the entire plugin for free. That's one of the reasons we have and need moderators. ;)
     
  10. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,382
    It's a common issue, hence why the only action we usually take is letting users know they might need to make a few adjustments.

    Thank you for clearing that up, we appreciate it.

    I have to say that I also don't fully understand your reasoning but your contribution is always welcome here, let's just all play by the same rules in future.

    Have a great holiday!
     
  11. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    279
    I finally found a way to do it. I didn't know you can write negative values to a rendertexture through a camera, and this solved by blending issue, as I have now values from -1 to 1, and blending them additively works perfectly.
     
  12. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    57
    Testing expanding the sample water shader, added world UI coordinates and now looking to add flow maps and waves. Any one have any examples for that?
     
  13. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    450
    Hi guys, I have a vertex wind shader, normally the wind is "masked" by vertex colors, for example any areas that are black will not have any wind effect. However, instead I want to define this by texture, for example areas that are black on the grayscale texture will not effect the nearby vertices, is this possible? This is the wind function I am using. Would appreciate if someone can point me in the right direction, with some sort of example, etc. I have been looking online forever.

    upload_2018-12-24_5-0-34.png
     
    hopeful likes this.
  14. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    279
    I've been talking about masking on my tutorial about global wind/bend effect on grass, you check it on my twitter here
    but the idea is to create some UV based on vertex y position, and use a grayscale texture to get a multiplier of your bend effect.
     
    Amplify_Ricardo likes this.
  15. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    450
    Hey, thanks for the tutorial, only issue is the reason for not wanting to use vertex colors is because I have complex tree meshes with leaf cards facing every which way direction. I have a wind function working fine, but I want to exclude some vertices based on a grayscale texture using the same texture cords as my leaf card texture.

    Let me know if you have any idea how to achieve this.
     
  16. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    279
    Why don't you just leave the UV on original settings and just multiply the R value from your grayscale texture to the wind force? Sorry I might get it wrong here.
     
  17. Branxord

    Branxord

    Joined:
    May 13, 2018
    Posts:
    14
  18. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    279
    Is it more like if(value < 0) output 0 else output value ?
     
  19. Branxord

    Branxord

    Joined:
    May 13, 2018
    Posts:
    14
    i think so yeah!
     
  20. deadlycrow

    deadlycrow

    Joined:
    Feb 10, 2014
    Posts:
    122
    Hey, i would appreciate if anyone could help me with this glitch:



    It happens when you use custom lighting, outline and static meshes (not sure how many, because with just a few it doesnt happen). if anyone encountered this glitch at some point? is there a workaround?
     
  21. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    156
    Hello!

    I have a distortion shader, i would like to apply this to a mesh with 2 material, but when i added as a third material only the first material get the effect, any idea what i need to do to cover all two material with the third material?
     
  22. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,382
    We don't have anything on the official package but we might be able to add something soon.

    Check your PM.

    I suppose it should be possible, have you run into any issues?

    We used to but we removed it during development, we might need to add a node for that soon. I recommend using a Custom Expression node for that effect.

    We just replied to your thread on our forum, the problem is caused by batching.



    ** ATTENTION **

    Our response will be severely slower due the holiday season, we should be back to full speed in a couple of weeks.

    Thank you for understanding.
     
  23. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,382
    Hey there, I think we will need to examine a sample to be sure. (support@amplify.pt)
     
  24. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    939
    @Amplify_Borba

    Hi, so Im running 2018.3.0f2 and installed ASE 1.6.1r3. When I open your example SRP HD Material Types shaders, I get this error:
    Error!!! Invalid current template. Switching to Standard Surface.

    Even my previous shaders that I created for the HD pipeline gives that worked before gives me the same error and conversion. Thoughts?

    Thanks.
     
  25. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    450
    @Amplify_Ricardo Yes, I have tried, no luck :confused:, I can't seem to figure it out or where to even start, do you have any examples of a masking a vertex animation with a texture instead of vertex colors? Any help would be amazing, I have looked everywhere!

    Cheers!
     
    Last edited: Dec 29, 2018
  26. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    156
    Hello!

    Any good way to make an outline shader with deffered rendering? as i see the outline option in the output node are only forward.

    Thanks!
     
  27. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    Is there still no possible way to display the wireframe in the shader? I really don't want to be rendering the wireframe of every model to texture to be used for the effect I want. :(
     
  28. uboncukcu

    uboncukcu

    Joined:
    Dec 13, 2011
    Posts:
    9
    Hello ,

    I am trying to do add a splash image on hit point , but my splash image is soo big how can I scale and set hit position?

    Thanks!

    s.PNG
     
  29. RTVDM

    RTVDM

    Joined:
    Nov 16, 2017
    Posts:
    2
    Hi there,

    when using the outline node in HDRP it generates a null reference

    NullReferenceException: Object reference not set to an instance of an object
    AmplifyShaderEditor.OutlineNode.PropagateNodeData (AmplifyShaderEditor.NodeData nodeData, AmplifyShaderEditor.MasterNodeDataCollector& dataCollector) (at Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Vertex/OutlineNode.cs:85)
    AmplifyShaderEditor.MasterNode.SetupNodeCategories () (at Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/MasterNode.cs:174)
    AmplifyShaderEditor.TemplateMultiPassMasterNode.CollectData () (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPassMasterNode.cs:1301)
    AmplifyShaderEditor.TemplateMultiPassMasterNode.BuildShaderBody () (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPassMasterNode.cs:1249)
    AmplifyShaderEditor.TemplateMultiPassMasterNode.Execute (System.String pathname, System.Boolean isFullPath) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPassMasterNode.cs:1286)
    AmplifyShaderEditor.MasterNode.Execute (UnityEngine.Shader selectedShader) (at Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Master/MasterNode.cs:470)
    AmplifyShaderEditor.ParentGraph.FireMasterNode (UnityEngine.Shader selectedShader) (at Assets/AmplifyShaderEditor/Plugins/Editor/Graphs/ParentGraph.cs:2573)
    AmplifyShaderEditor.AmplifyShaderEditorWindow.SaveToDisk (System.Boolean checkTimestamp) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:1421)
    AmplifyShaderEditor.AmplifyShaderEditorWindow.OnToolButtonPressed (AmplifyShaderEditor.ToolButtonType type) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:1516)
    AmplifyShaderEditor.ToolsWindow.OnButtonPressedEvent (AmplifyShaderEditor.ToolButtonType type) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/Tools/ToolsWindow.cs:206)
    AmplifyShaderEditor.ToolsMenuButton.Draw (System.Single x, System.Single y) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/Tools/ToolsMenuButton.cs:172)
    AmplifyShaderEditor.ToolsWindow.Draw (UnityEngine.Rect parentPosition, UnityEngine.Vector2 mousePosition, System.Int32 mouseButtonId, System.Boolean hasKeyboadFocus) (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/Tools/ToolsWindow.cs:234)
    AmplifyShaderEditor.AmplifyShaderEditorWindow.OnGUI () (at Assets/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:4343)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:310)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:363)
    UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:322)
    UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)
    UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)
    UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421)
    UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401)
    UnityEngine.Experimental.UIElements.EventDispatcher.PropagateEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:754)
    UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:599)
    UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307)
    UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176)
    UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245)
    UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)
    UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
     
  30. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, apologies for the delay in our response. If you've created your shaders using an older version of the HD SRP you'll need to update them for use with the new template we've created for the 4.6.0 HDRP.

    After updating to the latest ASE 1.6.1r3, you'll need to update your project's HDRP to 4.6.0 through Unity's Package Manager, then extract the HDSRPTemplates.unitypackage which contains the updated template for this version.
    Then you'll have to open each shader that has been authored with an older version of the HDRP template and compile it manually, including our HD Samples, so that they use the new template.

    Unfortunately there's no automatic way of doing this process at this time, apologies for the inconvenience.


    Hello, you should be able to do so by replacing the Vertex Color nodes with a Texture Sample, although it would be optimal to use vertex colors rather than a texture mask.


    Hey there, you'll have to set up your own custom outline solution, since the one that we currently offer is limited to forward only.

    I would suggest that you consider implementing a custom screen space solution, which might involve additional scripting, but it can be much more flexible.
    The following article might be a good reference for this: Unity Shaderlab Outline - Screen Space.


    Could you please elaborate on your current implementation so that we can provide some further insight?


    Hello, you should be able to scale your textures through the Texture Coordinates node, which will allow you to set different tiling values for the texture's UVs.

    In order to pass coordinates to the shader, you'll have to resort to scripting in order to feed such values to it.
    Feel free to refer to our Smear sample, which makes use of global variables and sets them via script, as a working example.
     
  31. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    151
    I've a problem rearrangin the shader properties.
    I don't know why, but some texture array nodes don't respect the properties position I've set.

    I've also tried to rearrange with text editor and when I create a material, the positions are good but if I open the material with ASE editor and I save shader again, the positions are wrong again.

    Where should I send the shader?

    EDIT: I've deleted the the texture array nodes and recreated and all is fine now. I don't know what happened.
     
    Last edited: Jan 3, 2019
  32. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    553
    Hi,

    I am making a custom template with LWRP and ran into a bit of a problem:

    These error are thrown when I switch into my template in ASE. I am pretty sure it means something are expected to be unique but wasn't. But I can't figure out what's causing this. Any suggestion?

    Screen Shot 2019-01-03 at 23.28.57.png

    EDIT: looks like it doesn't like my custom "Meta" pass. I am trying to add this pass to a custom template based on LWRP Unlit template. Do you spot any problem with this pass?

    Code (CSharp):
    1.         // This pass it not used during regular rendering, only for lightmap baking.
    2.         /*ase_pass*/
    3.         Pass
    4.         {
    5.             /*ase_hide_pass*/
    6.             Name "Meta"
    7.  
    8.             Tags
    9.             {
    10.                 "LightMode" = "Meta"
    11.             }
    12.  
    13.             Cull Off
    14.  
    15.             HLSLPROGRAM
    16.             #pragma prefer_hlslcc gles
    17.             #pragma exclude_renderers d3d11_9x
    18.             #pragma target 2.0
    19.  
    20.             #pragma vertex vert
    21.             #pragma fragment frag
    22.  
    23.             /*ase_pragma*/
    24.             uniform float4 _MainTex_ST;
    25.             #include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
    26.             #include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/MetaInput.hlsl"
    27.             #include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/ShaderGraphFunctions.hlsl"
    28.             #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
    29.  
    30.             CBUFFER_START(UnityPerMaterial)
    31.             /*ase_globals*/
    32.             CBUFFER_END
    33.  
    34.             /*ase_funcs*/
    35.             struct GraphVertexInput
    36.             {
    37.                 float4 vertex : POSITION;
    38.                 //float4 ase_normal : NORMAL;
    39.                 float4 texcoord1 : TEXCOORD1;
    40.                 /*ase_vdata:p=p;;n=n;uv1=tc1*/
    41.                 UNITY_VERTEX_INPUT_INSTANCE_ID
    42.             };
    43.  
    44.             struct VertexOutput
    45.             {
    46.                 float4 clipPos : SV_POSITION;
    47.                 /*ase_interp(0,):sp=sp*/
    48.                 UNITY_VERTEX_INPUT_INSTANCE_ID
    49.             };
    50.  
    51.             VertexOutput vert (GraphVertexInput v/*ase_vert_input*/)
    52.             {
    53.                 VertexOutput o = (VertexOutput) 0;
    54.                 UNITY_SETUP_INSTANCE_ID(v);
    55.                 UNITY_TRANSFER_INSTANCE_ID(v, o);
    56.                 /*ase_vert_code:v=GraphVertexInput;o=GraphVertexOutput*/
    57.                 v.vertex.xyz += /*ase_vert_out:Vertex Offset;Float3;4;-1;_Vertex*/float3(0.0, 0.0, 0.0)/*end*/;
    58.                 //v.ase_normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_Normal*/v.ase_normal/*end*/;
    59.                 o.clipPos = MetaVertexPosition(v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST);
    60.                 return o;
    61.             }
    62.  
    63.             half4 frag(VertexOutput IN/*ase_frag_input*/) : SV_TARGET
    64.             {
    65.                 UNITY_SETUP_INSTANCE_ID(IN);
    66.                 /*ase_frag_code:IN=GraphVertexOutput*/
    67.                 float3 Albedo = /*ase_frag_out:Albedo;Float3;0;-1;_Albedo*/float3(0.5, 0.5, 0.5)/*end*/;
    68.                 float3 Emission = /*ase_frag_out:Emission;Float3;1;-1;_Emission*/float3(0.5, 0.5, 0.5)/*end*/;
    69.                 float Alpha = /*ase_frag_out:Alpha;Float;2;-1;_Alpha*/1.0/*end*/;
    70.                 float AlphaClipThreshold = /*ase_frag_out:Alpha Clip Threshold;Float;3;-1;_AlphaClip*/0.0/*end*/;
    71.  
    72.                 #if _AlphaClip
    73.                     clip(Alpha - AlphaClipThreshold);
    74.                 #endif
    75.  
    76.                 MetaInput metaInput = (MetaInput) 0;
    77.                 metaInput.Albedo = Albedo;
    78.                 metaInput.Emission = Emission;
    79.  
    80.                 return MetaFragment(metaInput);
    81.             }
    82.             ENDHLSL
    83.         }
    EDIT 2: never mind, silly me, the port number is wrong, that's why.
     
    Last edited: Jan 3, 2019
  33. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    659
    Hello, thanks for the great tool!

    I have 2 questions:
    1) How can I toggle between Additive and Premultiplied mode?
    (this value by script). The reason for this is that I do not want to have a duplicate of 2 shaders because then I must change both every time I decide to make a change.
    upload_2019-1-4_5-38-50.png

    2) Is it possible to only have my VFX affected by bloom? If so, how can I do it?
    I would like my VFX to be affected by a higher bloom than the rest of my game.
     
  34. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    279
    So far I've only see someone from ASE team talking about this: https://docs.unity3d.com/ScriptReference/Material.SetOverrideTag.html
    Where you can force a blendMode for a specific material, no matter what settings it uses. Worth giving it a try !
     
  35. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    659
    Something like this? I'm really shooting in the dark here since I don't know the names of the values I want to change.

    Code (CSharp):
    1.         switch (BlendMode)
    2.         {
    3.             case GameBlendMode.AlphaPremultiplied:
    4.                 Material.SetOverrideTag("BlendRGB", "AlphaPremultiplied");
    5.                 break;
    6.             case GameBlendMode.Additive:
    7.                 Material.SetOverrideTag("BlendRGB", "Additive");
    8.                 break;
    9.         }
     
  36. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    553
    I could really use a more thorough document on how template tag are processed:

    In particular, consider this tag:

    Code (CSharp):
    1. float AlphaClipThreshold = /*ase_frag_out:Alpha Clip Threshold;Float;1;-1;_AlphaClip*/AlphaClipThreshold/*end*/;
    I know:

    - ase_frag_out is keyword
    - Alpha Clip Threshold is port name
    - Float is port type
    - 1 is port order
    - _AlphaClip is the linking property for multi-pass
    - but what are -1?
     
  37. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, do you recall the steps taken that lead to this issue, or can you replicate it?

    Be sure to let us know as we don't believe we've come across this problem before.


    Hello, thank YOU for your support!

    1 - I don't think that you can change those properties through the SetOverrideTag as suggested in a subsequent post, but you can set your 'Blend RGB' to Custom and then only expose the 'Dst' property, since the 'Src' remains equal for both Additive and Premultiplied modes. You can then set up a Float node as a Property Type, and add the Enum attribute with the correct value as depicted in the screenshot below:


    The If node will then allow you to pass specific operations / data depending on the chosen blend mode ( don't mind the Custom Expressions as they're just there as an example ). Although this example is geared towards exposing this property in the inspector, you can still change it through script by using the Material.SetFloat.

    2 - Depending on the bloom solution you're using, you might be able to generate a mask in order to define which assets are affected by it.


    Apologies for that, we do hope to improve the documentation and we'll happily take any suggestions regarding what could be added or elaborated.

    Regarding the tag you've shared, the '-1' value stands for the Port ID, setting it to -1 has it set the ID automatically.
    It has been superseded by the last parameter, in your case the _AlphaClip, which serves the same purpose while also linking the properties for multipass.

    We intend to remove this field in the future but, for now, you should leave it at its default value of -1.
     
    cAyouMontreal, FeastSC2 and bitinn like this.
  38. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    First of all, and since this is my first post of 2019, I would like to wish you all an amazing new year.
    I truly hope for it to be a year full of successes for our wonderful community!

    As always I'm posting to let you know that we've uploaded a new build into our website.

    Here are the release notes:
    Release Notes v1.6.1 rev 04:
    • New Node:
      • Linear Depth
        • Converts values given on logarithmic space to linear
    • Improvements:
      • Minor improvement on nodes loading time when initializing ASE
    • Fixes:
      • Fixed local variable duplicate issue when using 'Depth Fade' and 'Screen Position' nodes
      • Fixed serialization issue with Additional Use Passes and Fallback data when going into play mode
      • Fixed HDRP issues on Motion Vectors pass
      • Fixed issue with uniform keyword usage inside cbuffers (SRP templates) over PS4
      • Fixed issue with 'Common Transform Matrices' node over SRP templates
      • Fixed object to world/world to object space transform on transform nodes over HD templates
        • 'Transform Position', 'Object To World' and 'World To Object' nodes
        • They now take SHADEROPTIONS_CAMERA_RELATIVE_RENDERING keyword into account
      • Fixed issue with 'Pixelate UV' node when used over vertex functions
      • Fixed foldout issue between Additional Surface Options and Custom SubShader Tags on Surface node properties

    Happy shader creations!
     
    Gruguir and hopeful like this.
  39. rodhurt

    rodhurt

    Joined:
    Apr 30, 2018
    Posts:
    4
    Did you find a solution?
     
  40. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    279
    Oops indeed, I misread the question :O Is it because the blendmode it's not a tag? Your solution will work for sure !
     
  41. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    659
    Thanks for the answers :)

    I have been using the Post Process of Unity so far. Can Unity's PP be used in combination with yours? Say I wanted to use yours for my VFX and unity's PP for the rest? Is that possible?

    The problem is that I want more than just bloom (Unity's Post Process has other features that are useful).
     
  42. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    151
    At the moment I can't replicate the issue. I remember that I starting build the shader using 2 texture array nodes, one for albedo and one for normal. Then I copy&paste these main nodes setting on these copies the "reference" option.
    Some of those copies reference to the "master" albedo and some to "master" normal.
    After that, I had to change the "master" and I switch other 2 of those copies as "object" and try to reference the old master and the other copies to these new "master" nodes.
    Doing this, the new "master" arrays weren't rearrangeable on the material properties.
     
  43. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    553

    Hi there, not sure these changes are included in latest build, but may I suggest 2 changes:

    A) I think the instancing property for LWRP can be changed to this (LWRP shaders and Shader Graph use this instead of UNITY_INSTANCING macro, AFAIK they are equivalent.)

    Code (CSharp):
    1.         public static readonly string LWSRPInstancedPropertiesBegin = "CBUFFER_START(UnityPerMaterial)";
    2.         public static readonly string LWSRPInstancedPropertiesEnd = "CBUFFER_END";
    3.         public static readonly string LWSRPInstancedPropertiesElement = "{0} {1};";
    4.         public static readonly string LWSRPInstancedPropertiesData = "{1}";
    At the same time, the LWRP shader template can be changed to avoid CBUFFER wrapper (currently it is wrapping the properties twice, this is unnecessary).

    B) LWSRPInstancedPropertiesElement is never used by ASE internally, I suggest changing it to:

    Code (CSharp):
    1.         public string GetInstancedPropertyValue( bool isTemplate, bool isSRP )
    2.         {
    3.             if( isTemplate )
    4.                 return string.Format( isSRP ? IOUtils.LWSRPInstancedPropertiesElement : IOUtils.InstancedPropertiesElement, UIUtils.FinalPrecisionWirePortToCgType( m_currentPrecisionType, m_outputPorts[ 0 ].DataType ), m_propertyName );
    5.             else
    6.                 return string.Format( IOUtils.InstancedPropertiesElementTabs, UIUtils.FinalPrecisionWirePortToCgType( m_currentPrecisionType, m_outputPorts[ 0 ].DataType ), m_propertyName );
    7.         }
    To allow for SRP instancing, which doesn't need UNITY_ACCESS_INSTANCED_PROP macro.
     
  44. ScaniX

    ScaniX

    Joined:
    Apr 10, 2016
    Posts:
    27
    Hi!

    Since I updated to one of the most recent (official Asset Store) versions, there is a bug with the Unity Shortcuts.
    Ctrl + 1, Ctrl + 2 are one of the most used keyshortcuts to switch to the scene or game views in Unity.
    Those still work, but the shader editor gets stuck in a "create node on click" mode until I press escape. That happens pretty much every time I save a shader to check it out in the game and come back to the shader editor, which is like... 100 times a day. Xd
    Can you please remove those keyshortcuts or at least offer an option to disable them? Thanks. :)
     
  45. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    119
    Does Amplify Shader support StructuredBuffers? We are using GPU Instancer and want to be able to edit the color of our materials at runtime and need StructuredBuffers to do so.
     
    Last edited: Jan 5, 2019
  46. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    152
    Hello everyone!

    I am currently trying to learn to use the custom expression node.
    I was wondering, would it be possible for the team to create a template with some examples custom expression nodes that do basic stuff as a tutorial? (things like "multiply" or "sample2d" or "fract", really common things)? And then add it in the basic template package?

    Have a good day!
     
  47. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    659
    I'm trying to change the Blend Alpha settings (additive, alpha blend, ...) on my shader. But no matter the settings I set it on there is 0 difference on my vfx.
    What do I need to do in order to use the Blend Alpha?

    (My goal is to make the vfx particle systems blend more with each sprite that's a part of it. Right now the sprites can look like one sprite on top of another one).

    This is my goal, but it's blending better between each sprites I believe:

    Here's what I have:


    Any additional tips are most welcome, I think the problem comes from blending somehow. I'm really interested to learn more about blend alpha in Amplify. Please give me your thoughts about this :)

    upload_2019-1-7_2-42-26.png
     
  48. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Tags can't be altered in the inspector, which is why we can't expose them, the solution I've shared is simply a workaround.
    You might be able to do so through a custom inspector, but that's out of the scope of ASE.



    Although our solution is not integrated into PPS, it can be used simultaneously, just add the component for our asset before the PPS component.

    Also, be sure to try out the trial version first to see if it suits your project before committing to a purchase!


    Thank you for providing additional details, we'll run some tests on our side to see if we can track this one down!


    Hey there, thank you for your feedback!

    I'll pass these suggestions to the developer for further consideration, keep them coming!


    Hello, thank you for reporting this issue, we've managed to replicate it on our side and we'll be sure to fix it as soon as possible!


    Hello, unfortunately ASE doesn't support Structured Buffers at this time, hopefully we can add support for this in the near future as it still requires some further investigation.

    I've registered your interest so that we can reach out to you as soon as we have any developments regarding this feature, thank you for understanding.


    Hello!

    The Custom Expression node was added to allow for shader code to be injected into the graph, allowing for some additional flexibility in authoring shaders through nodes.

    It can serve a multitude of uses, such as performing simple mathematical operations or allowing you to directly paste the code for complex functions. Here's a simple example of how to use it:



    In this example, I'm declaring a variable within the function's scope, "myVector", which will be returned through the Out port, and a I'm initializing the custom Out0 output as a different value.

    We also use it in the SimpleTerrain sample in order to be able to access the final color for the splatmap.

    Nevertheless, I've registered your feedback so that the developer can consider it for future samples.

    Hope this information helps!


    We ran some tests and, code-wise, the blend alpha is working as expected.

    This parameter is meant to be used when you want the alpha channel to blend differently than the rgb channel, which doesn't seem to be necessary according to the shared example, so could you please elaborate on why you're blending the alpha differently than the rgb?


    Hello, although you can use a standard shader for UI, ideally you should be using our 'Default UI' template in order to author shaders specifically for UI elements. Is there any specific reason why you're trying to do this on a standard shader?



    You're also using a very outdated version of ASE, please download the latest ASE build from our website.

    In case you have a specific need to use the standard shader for this, send us a sample through support@amplify.pt so that we can examine it on our side and provide further insight, thanks!
     
    FeastSC2, ScaniX and arnoob like this.
  49. Wawruch2

    Wawruch2

    Joined:
    Oct 6, 2016
    Posts:
    29
    Hi, I have a little problem with HDRP and amplify shader editor (Unity 2018.3.0f2 -- HDRP 4.6.0).

    After importing HDSRPTemplate it gives me:

    Setting HDRP Template in the window shows the same thing. Of course materials are pink.

    Am i doing something wrong?
     
  50. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    659
    I'm only trying to figure out every option that I have to make this shader be as good as possible.
    Is there an example where blend alpha is being used in one of the shaders examples? I can't make this blend alpha work in my project and I have the latest version. However it certainly is due to something I don't understand about it.