Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    130
    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
  2. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    356
    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
  3. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    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.
     
  4. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    272
    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 !
     
  5. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    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.         }
     
  6. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    356
    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?
     
  7. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    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.
  8. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    349
    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.
  9. rodhurt

    rodhurt

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

    cAyouMontreal

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

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    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).
     
  12. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    130
    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.
     
  13. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    356

    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.
     
  14. ScaniX

    ScaniX

    Joined:
    Apr 10, 2016
    Posts:
    22
    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. :)
     
  15. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    111
    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
  16. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    148
    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!
     
  17. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    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
     
  18. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    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.
  19. Wawruch2

    Wawruch2

    Joined:
    Oct 6, 2016
    Posts:
    19
    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?
     
  20. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    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.
     
  21. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    111
  22. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    Hello! We currently provide two HD Template packages within the AmplifyShaderEditor \ Plugins \ EditorResources \ Templates \ SRP folder:

    HDSRPTemplates (Legacy).unitypackage for the HDRP 3.0.0
    HDSRPTemplates.unitypackage for the HDRP 4.6.0

    Can you confirm that you've imported the non-legacy one?

    If not, simply extract the correct one and it will overwrite the templates. Let me know if this helps!


    Since its not common to use different factors for blending the alpha channel, we have no samples that make use of it.

    Although I'm not entirely familiar with using this particular feature, there are a few test cases shared in this thread that could perhaps shed more light on how it could be used.
     
  23. o2co2

    o2co2

    Joined:
    Aug 9, 2017
    Posts:
    10

    The same situation
     
    Last edited: Jan 8, 2019
  24. Wawruch2

    Wawruch2

    Joined:
    Oct 6, 2016
    Posts:
    19
    Thank you for the answer! I tried bove, Legacy don't work cause it's HDRP 4.6.0. It gives me more errors, while I'm trying to import the HDSRPTemplates.unitypackage (NON Legacy) it gives me only this error:


    Unfortunately shaders are pink :(
     
  25. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    46
    How do I do this in amplify shader?
    Code (CSharp):
    1. half3 specular;
    2.  
    3.  
    4.  
    5.     float3 tangentX = worldVectors[0];
    6.  
    7.     float3 tangentY = worldVectors[1];
    8.  
    9.     float3 N = worldVectors[2];
    10.  
    11.     float3 V = data.worldViewDir;
    12.  
    13.     float3 iblNormalWS = GetAnisotropicModifiedNormal(tangentY, N, V, anisotropy);
    14.  
    15.     float3 iblR = reflect(-V, iblNormalWS);
    Specifically what is the "GetAnisotropicModifiedNormal" function? I feel like I'm missing something here.

    Like I would assume it's some kind of math function thats taking 4 vector3's and combining them into a new vector3 somehow. But I don't know what that math function is.

    Maybe 4x4 matrix?

    Oh I see it's a reference


    Code (CSharp):
    1. float3 GetAnisotropicModifiedNormal(float3 grainDir, float3 N, float3 V, float anisotropy)
    2.  
    3. {
    4.  
    5.     float3 grainNormal = ComputeGrainNormal(grainDir, V);
    6.  
    7.     // TODO: test whether normalizing 'grainNormal' is worth it.
    8.  
    9.     return normalize(lerp(N, grainNormal, anisotropy));
    10.  
    11. }
    As an FYI i'm looking at this shader, it's a anisotropic version of the standard shader and i'm trying to mimic the normal adjustment stuff for the reflections.

    https://github.com/Kink3d/AnisotropicStandardShader

    FINAL EDIT: Ok I figured it out I think XD


    Still any help with recreating this would help a ton to get reflections to stretch too!
     
    Last edited: Jan 8, 2019
  26. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    It would be really nice if you guys created a .dll with all the code from Amplify Shader Editor.
    It's really a lot of scripts and Unity already takes a load time compiling.

    The team of Odin Inspector provides the .dll and a .zip file with the source code in case the user would like to take a look at the code. That would be the ideal.

    Is that something you guys can do?
     
  27. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428

    I've just ran some further tests with the latest ASE version currently available for download on our website, and can't seem to replicate the issue.

    In case you're using the Asset Store version, I believe that its current build doesn't yet support SRP 4.6.0, so you'll have to update through our website as it usually takes longer for our submissions to get accepted and make it into the store.
    If this is not the case, however, we could really use a sample project sent to support@amplify.pt so that we can debug it on our side.


    Unfortunately, assisting with replicating custom shaders is outside of the scope of our support due to our limited resources, although we'll be happy to answer any specific doubt or question, if we can!


    Thank you for your feedback, I'll bring this up with the developer for future consideration!

    For now, you might want to try and put the Amplify Shader Editor as a whole inside an Editor folder to prevent its samples from being included in the build as possible a workaround, since otherwise they will increase build times.
     
  28. Skyfly

    Skyfly

    Joined:
    Jan 25, 2014
    Posts:
    100
    um yeah... but it was quite drastic. I found Unreal worked out of the box for that specific case... (keep in mind: just use the tool that's best suited for a job, both engines are awesome).
     
  29. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    245
    Incorrect code generation when using HDRP:
     

    Attached Files:

  30. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    Hello, thank you for reaching out to us!

    We've confirmed the issue and will correct it for the next build, which should hopefully be released towards the end of the week, apologies for any inconvenience.

    EDIT: As a temporary workaround you may wish to use the Transform Position node as follows:

     
    Last edited: Jan 9, 2019
    julian-moschuering likes this.
  31. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    69
    Well I wanted to make an efect like how these buildings are created;



    They start off as a wireframe pulsing green.

    Then they become filled in with green with the wireframe still visible.

    Then filled in with texture colour with the wireframe still visible.

    Finally the building is finished and no wireframe is visible.

    My current method to do this would be in my 3d modelling package rendering a wireframe to texture to be used in the shader, but that requires every mesh to have it's own wireframe texture which is a little clunky. I'd like to be able to use the actual wireframe of the mesh in the engine as part of the effect but it doesn't seem possible to render the real wireframe in game.

    What I mean when I say actual wireframe of the mesh;
    https://i2.wp.com/1darray.com/blog/wp-content/uploads/2016/11/unity-wireframe-shader.gif?resize=493,323
     
  32. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    46
    I've decided I may just look into making a custom "indirect specular light" node or something...that would be the easier solution to this maybe.

    You guys have documentation for that type of thing right?
     
  33. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    356
    Is there a way to use a predefined variable like unity_LightmapST directly? I want to scale the lightmap uv in the vertex shader myself, but can't

    (I am working with LWRP)

    EDIT: never mind, setting Vector4 to fetch mode and using Vertex to Fragment node is what I needed.
     
    Last edited: Jan 10, 2019
  34. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    Thank you for elaborating!

    Such wireframe effects are authored in geometry shaders, which unfortunately are not currently supported by ASE, so it can't access the necessary geometry data to handle this type of effect. Your suggested workaround of using a wireframe texture is the only alternative I can think of as well.


    Hello, you can look into our own Indirect Specular Light node's code and our API documentation, which has all sort of relevant information regarding custom node creation.


    Hey there, thank you for letting us know you've sorted this out!

    For other users that might be interested, we do include a Shader Function for fetching lightmap values called FethLightmapValue, which can be double clicked to access its node setup content.
     
  35. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    How can I share a tree of a created shader with someone that doesn't have Unity/Amplify Editor?

    I want him to see all of my nodes but it's a big shader with lots of nodes. Is there a built-in way to share a shader?
    Like a huge quality picture or somethting?
     
  36. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    Hello, just to be clear you can share the shader freely, as well as any content created with ASE, as long as the editor is not distributed. The shaders can be still have their shader code manually edited and can be tweaked through the inspector.

    Although we don't have any built-in means of taking a screenshot of the canvas for sharing a node setup, we have considered adding something in the lines of that in the future, but for now you'll have to resort to do it manually, apologies for the inconvenience.
     
    FeastSC2 likes this.
  37. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    81
    Is it possible to create a lit cutout shader? For example using a texture to create round particles (so a billboard/sprite) but that is lit in the scene?

    If its not possible I'll give up and use a mesh, but thought I'd ask.
     
  38. CianNoonan

    CianNoonan

    Joined:
    May 19, 2017
    Posts:
    7
    Does anyone know how to set the reflection cubemap on a material basis? We want to be able to change the cubemap that is reflected in our PBR reflections for each material
     
  39. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    Hello! Our Particles Template does not support this, but you could create a Standard Surface shader, using the Lambert or Blinn Phong lighting model for performance considerations, and assign its material to the particle system.

    You'll have to make sure that you set up the nodes correctly and respect Unity's nomenclature though, so the Texture Sample will have to have its property set as _MainTex, for example.


    Hello, you should be able to set it on a per material basis, and we also offer a sample that you can find in the CubemapReflections folder that shows you how to set it up, but please let us know if you have any specific issues regarding this, we'll be happy to help!
     
  40. CianNoonan

    CianNoonan

    Joined:
    May 19, 2017
    Posts:
    7
    Hey Borba,

    That seems to be running it through the EM channel in the example. I would just like to use normal Metallic Smoothness but change what the highlights are rendering. Like changing the skybox but on a per material basis
     
  41. Wawruch2

    Wawruch2

    Joined:
    Oct 6, 2016
    Posts:
    19
    Thank you! Downloading a version from your website solve my problem. Previously I tried an assetstore one.
     
  42. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    How can I change a texture for all of the existing materials of a certain shader in my project?
    I thought about using global but it only works in playmode. For values I can use "constant" of course but for textures this is option is not available.
     
  43. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    Thank you for elaborating, upon looking into this a bit further, I believe that the simplest way to achieve what you intend would be by setting a custom cubemap per object through their meshes. I'm not entirely sure on how to achieve this through materials, but this solution should allow for similar flexibility through scripting.

    First you'll set the Type for each Reflection Probe as Custom, and define its cubemap:



    And in the object's mesh, you'll set the Anchor Override parameter to the one Reflection Probe you want to use:



    You won't have to do anything on the shader's side in order for this method to work, simply set up the unique metallic and smoothness values required for each material.
    Please let me know if this helps.


    No problem, thank you for letting us know that the new build fixed the issue you were having!


    Hello, could you please elaborate on this? If you change a material's texture on the inspector or in the ASE Canvas, for example, all objects using that same material will also have their texture changed.
     
    CianNoonan likes this.
  44. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    I don't mean for one material I mean for all materials sharing a single shader.
    Say I have 3 materials with the unit shader.
    If I change the "OnFreeze" texture in one material, the 2 other materials won't share that texture.
    I'm wondering how I can have a way to have a shared textures between all materials of a shader.

    Just like, for example, when I create a constant float variable in the ASE Canvas. That value is shared between all materials using that shader directly.
     
  45. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    105
    How many problems is ASE having with 2019.1.0a13 ? Cause i've been trying to make it work with the latest version of everything and i've got a cascade of errors everywhere.
     
  46. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    I see, thank you for elaborating!

    You'll then have to set your Texture Sample to Global rather than Property, and change it via script.


    Hello, I'm afraid that we don't support Unity Beta Releases, but we'll definitely be keeping an eye out for any potential issues as 2019 draws closer to release.

    That being said, I've tested importing the latest ASE build ( v1.6.1r5 ) to a new 2019.1.0a13 project and setting up a simple shader, but no errors or warnings were thrown. If you were attempting to use the LW or HD RP, we only support 3.0.0 for 2018.2 and 4.6.0 for 2018.3 at this time.
     
  47. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    Just to let you know that we've uploaded a new build into our website.
    This build was also uploaded and is already available at the Unity Asset Store.

    Here are the release notes.
    Release Notes v1.6.2 rev 00
    • New Template:
      • Unlit Lightmap
    • New Sample:
      • Unlit With Lightmap
    • Fixes:
      • Fixed issue on 'Depth Fade' node with custom Vertex Positions
      • Fixed issue with using the X,Y,Z,W output ports on 'Object To World' node
    Happy shader creations!
     
  48. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    492
    Right but if I do that then I cannot preview unless in playmode like I said in my first message. What can I do to also have that texture be known at editor time? Global doesn't allow this.
     
  49. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    428
    Apologies for not elaborating, Global allows this but you'll need to add [ExecuteInEditMode] to your script in order to see the changes in the editor, for example:

    Code (CSharp):
    1. [ExecuteInEditMode]
    2. public class GlobalTextureSetter : MonoBehaviour
    3. {
    4.     public Texture2D MyGlobalTexture;
    5.     public string GlobalTextureName;
    6.  
    7.     void Update()
    8.     {
    9.         Shader.SetGlobalTexture(GlobalTextureName, MyGlobalTexture);
    10.     }
    11. }
     
    FeastSC2 likes this.
  50. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    245
    While moving from LWRP to HDRP I stumbled upon a difference in ObjectToWorld node. Due to camera relative rendering it now does some additional stuff but throws away w component. Previously I used this node with w=0 when transforming a direction which now get's translation applied too.

    I replaced the parts with a manual multiply by ObjectToWorldMatrix, just wanted to let you know. Maybe you want to fix this or go the other direction and split ObjectToWorld into ObjectToWorldPoint/ObjectToWorldDirection or something. But it should have the same behaviour on all pipelines.