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

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Hey guys !
    So, I was transfering a shader from shader forge to yours and came across a bunch of issues.

    An error without workaround first:
    A piece of code calling a custom shader expression function doesn't call it correctly.
    Code (csharp):
    1. // Line calling the function :
    2. float4 localBlurExp56 = BlurExp56( computeGrabScreenPos39.xy , ( temp_cast_3 * _BlurOffset ) , screenGrab );
    3.  
    4. // Function, note the different name
    5. float4 BlurExp( float2 UV , float2 Offset , sampler2D Sampler )
    6. {
    7.     float4 sum = 0;
    8.     int count = 0;
    9.     offset = offset * 0.25;
    10.     for(int x = -2; x < 2; x++)
    11.     {
    12.         for(int y = -2; y < 2; y++)
    13.         {
    14.             sum += tex2D(Sampler, UV + float2(x, y)*offset);
    15.             count++;
    16.         }
    17.     }
    18.     return sum/count;
    19. }
    20.  

    Another one is more of a missing feature than a bug. The lack of access to the GrabScreen sampler which means that we have to work around it by creating a custom expression and using the name of the sampler as code, why not just make the grab a sampler anyway since that's essentially what it actually is ?

    There's also a bug with the custom lighting model, if I switch to it with the first shader, it tries to find a variable named ScreenPos47 which doesn't exist.

    There's nothing else for the first shader but I have a second one which has a whole ton of variable naming conflicts that comes from a bunch of repeating code, it's inside the archive with custom functions.

    Its kind of clunky to spawn nodes as well compared to shader forge, pushing a button and having all the nodes that start with that letter is faster than right click -> Node that contains the field's content when you already know/are comfortable with the naming scheme.

    Being able to include specific CGINC files would be nice too.
     

    Attached Files:

    Last edited: Jun 14, 2017
  2. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    We just finished uploading a new build ( v1.0.0 dev 007 ) into our website which fixes this issue.

    We already have node 'Grab Screen Color' which already acts like our Texture Sampler node. You need direct access to the grab pass sampler global variable?

    Regarding the other reported issues, we're currently investigating them and provide a new build as soon as they are fixed.
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    For the upgrade to Unity 5.5 I had to convert all my SF shaders that were used on static baked (with Mixed lighting) objects to ASE. Because shadows from dynamic objects would turn pitch black on baked shadows.

    In 5.6 static objects would still be lit by dynamic light, resulting in overexposure. And dynamic objects would have pitch black shadows in a build (no ambient light?).

    All in all, using ASE shaders works without a hitch when it comes to GI/Lightmaps, in my experience at least. Presumably because they are surface shaders, so they work with Unity's built-in lighting model.
     
  4. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Thanks for the reply @Jonny10, I'll be picking up ASE today then!
     
  5. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Hey,

    I purchased a sprite antialias shader that i'd like to use as a base in all my shaders, right now i use shaderforge but it seems impossible to contact the developer, is integrating that shader with ASE possible?

    Here is a post that i made on their forum thread

    https://forum.unity3d.com/threads/r...ixel-art-and-voxel-games.412287/#post-2934866

    Let me know if this is possible because i'd switch to ASE right away.
     
  6. Caronte3D

    Caronte3D

    Joined:
    Sep 16, 2014
    Posts:
    43
    Hi, I get this error:

    Shader error in 'myShader': undefined variable "myTexture_ST" unable to find compatible overloaded function "tex2D(sampler2D, error)" at line XX (on d3d9)

    myTexture is an sampler2D input.
     
  7. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    Hi,
    My Colleague just recently purchased this plugin im liking so far as Alloy also can inject into, i came across this shader on unreal & i wanna replicate in ASE, but im not getting what i want ASE appearing as gray... help? shader2.PNG shader.PNG

    EDIT:
    i managed to do it, but my plane remains gray... help? shader3.jpg
     
    Last edited: Jun 15, 2017
  8. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    Yes, that would be useful if you are writing generic texture processing functions like a blur for example, you would have a sampler2D as one of the function's parameter and sample the sampler inside the function.
    If you do the same thing with the depth texture we could implement other custom image effects like post processed outlines through a sobel operator, ambient occlusion and the like.

    Thanks a bunch for the fix !
    I might have more infos concerning the issues with custom lighting, the generated code seems to fail whenever you use a grab screen node with a non-connected screenpos, it generates a screenpos inside the surf function while the rest of the shader tries to use it inside the custom lighting function.
     
  9. BillySullivan

    BillySullivan

    Joined:
    Jun 16, 2017
    Posts:
    3
    We've just recently moved to using Amplify after updating to Unity 5.6 and have been recreating our car shaders using it.

    We've ran into a specific issue on Android devices giving us an Artifact look on reflective materials.
    Most noticeable on our Metallic car paints. This also doesn't occur in the Unity editor, or on any iOS devices we've been able to test on.
    On top of this, we are able to run the game on an old Motorola Razr droid with the metallic shader displaying correctly.
    So it seems this is only occurring on higher end devices. I feel like there is something simple i'm missing, this is driving me crazy haha!

    This is what the cars are suppose to look like in the garage.
    And this is what they look like in game on a huawei p9 ( Also tested on s5, s6 edge, htc one M8 with same results )

    The effect is almost as if it's destroying smoothing groups of the mesh while also reflecting craziness. Also note that the reflection of the alloys and bumpers have also either gone dark or gone matte.

    Here's the shader we're using for it

    Any help would be great.
     
  10. BillySullivan

    BillySullivan

    Joined:
    Jun 16, 2017
    Posts:
    3
    We are using OpenGL2.0, and turns out this is fixed when using OpenGL3.0, but we would prefer to only use 2.0. So i guess the real question is, can we avoid these errors somehow using 2.0.
     
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    I'm experiencing some inconsistencies with the property names of global parameters. Usually I create a node, name it, and set it to the "Global" type. An underscore is always added in front of the propertyname, which is normal.

    Sometimes when editing a shader, or in a build, I'll notice some aspect of it stops working. After investigating it turns out that the underscore was removed from the property name of a global parameter. In most cases I also remove the underscore from the target name set in Shader.SetGlobalXXX. Which makes it work again.

    Although in the case of global textures it caused an issue with texture references.

    My parameter was renamed from `uniform sampler2D _PigmentMap` to `uniform sampler2D PigmentMap`. Which gives it the same name as the variable used to define a texture reference: `float4 PigmentMap = tex2D( PigmentMap, TerrainUV )`. Resulting in an error, because it should be `float4 PigmentMap = tex2D( _PigmentMap, TerrainUV )`.

    The solution now is to add an underscore to the parameter name, which also adds it to the property name. But for some reason the PigmentMap texture is now added as a property. So while it is set to "Global" it does not behave like it, as it shows up in the properties block. I have to open the shader text file and comment the property definition out.

    It's a little fickle, because I keep making adjustments, which I seem to have to revert every so often. Which way is up? o_O
     
    Last edited: Jun 16, 2017
  12. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    509
    Hi,

    @BillySullivan - in unity's standard light model (PBR), the cubemap is box projected only on OpenGL3.0, on OpenGL2.0 it falls back to standard cubemap. That could be your problem. Try checking/unchecking the Box Projection checkbox on your Reflection Probe and see if you get the same results you get on devices.

    I managed to access unity's cubemap and use it as box projected on OpenGL2.0. Here is the ASE shader. Make sure Box Projection is checked on Ref Probe. Hope it helps!
     

    Attached Files:

    Last edited: Jun 16, 2017
    sacb0y likes this.
  13. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    509
    Hi,

    First of all, I want to say that ASE is a great product ! The custom lighting is a great addition.
    As somebody said above, Header attributes would be great to have. I always like to group my shader parameters for better readability.

    I recently released Lowpoly Water Shaders on the Asset Store (http://u3d.as/PrN). Now that custom lighting was added I want to change my mobile unlit shaders to have per vertex Blinn Phong light model.

    I recreated the light model and everything works as expected if i do it per pixel. When I do the calculation per vertex, the lighting is correct, but the specular highlight is wrong, isn't aligned with the per pixel specular and it scales with the object.
    Here is a screenshot with the specular: Per Vertex Specular in Green / Per Pixel Specular in Orange.
    upload_2017-6-16_16-1-28.png
    And my ASE setup:
    upload_2017-6-16_15-59-51.png
    Am I missing something? Am I doing something wrong? Is it a bug?
    If somebody could help me out, that would be great ! Many thanks !
     
  14. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Share the specular shader with us, mostly likely one of those nodes or an option on those is generating the code in the frag function. I'll take a look.

    Thx really weird, specially because the shader seems to be so simple. Share the shader, it could be some definition in the master node. Also, keep in mind that your uv coordinates node is not referencing any texture, I don't know if that's on purpose or not but you'd save some stuff by referencing them (either connect the texture into the tex input or use the options in property panel)
     
    Last edited: Jun 16, 2017
  15. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Without the shader or the unreal reference is hard to tell but I can see you connected the first output of the sin Time to the multiply node, I hardly believe thats what you want, you see, that first output is just a collection of all the others, what you want is the one of other four which contains the sintime at various speeds. Most likely you want the last output?
     
  16. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    509
    Here it is. Thanks !
     

    Attached Files:

    kebrus likes this.
  17. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    I can confirm there's an issue with view dir generation, It's using the object local position instead of world position. You can expect it to be fixed soon.
     
    Last edited: Jun 16, 2017
    x4000 likes this.
  18. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We just uploaded a new build into our website, mostly with bug fixes from issues you have been reporting.
    Here are the release notes:
    Release Notes v1.0.0 dev 08:
    • New features:
      • New Output node Rendering Options
        • Disable Batching
        • Ignore Projector
        • Force No Shadow Casting
    • Fixes:
      • Fixed issue with new dynamic 'Add' and 'Multiply' nodes not registering port creation/destruction into Undo system
      • Fixed issue on 'Grab Screen Color' node duplicating code
      • Fixed issue with Opacity Mask port being incorrectly Enabled/Disabled on certain situations
      • Fixed issue on 'Get Local Var' nodes getting wrong ids on certain situations when a 'Register Local Var' node is deleted
      • Small fix to force property name update when changing type on property nodes
      • Fixed issue where 'View Dir' node was generating code in the wrong space when in vertex function for both world space and tangent space
    Happy shader creations and have an awesome weekend!
     
  19. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    Excellent tool! Thanks for much for this.

    Is there a way to expose and control the min/max samples for parallax occlusion mapping? Some surfaces need less samples while others need more.

    Also, will naming variables be coming soon? It seems like I'm locked into naming the variables similar to the property name.
     
    Last edited: Jun 17, 2017
  20. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Hello!

    I'm a long time Shaderforge user, finally trying out the Amplify Shader Editor. I was migrating my project to Unity 2017.1 beta and lots of SF shaders broke (on some platforms). Rewriting them in Amplify Shader editor fixed my issues.

    I just want to say this is an awesome tool! I almost came to this thread multiple times asking how to do something, but taking a look through all the examples when I was stuck always seemed to have something that helped me work through my issues, so good job on all the included examples too!

    A few suggestions that probably have already been brought up.

    1) A way to easier select nodes to add to the canvas, SF spoiled me with the mouse-menu, press a keyboard key and all the nodes come up in a scrollable list that start with that letter is the thing I miss the most. Typing into a searchbar just feels clunky now.

    2) Editor sometimes hangs for a few seconds for no apparent reason.

    3) The refraction input in the main mode didn't work how I expected (coming from SF). I couldn't find any explanation on how it works, but using the (old) grab-pass refraction example worked more or less like I expected.

    4) Modifying texture UV coordinates had me confused, until I realized the the Texture Coordinates node is the ASE equivalent of SF's UV Coords. After that it clicked for me, and it's super cool how you can reference texture samplers with this node.

    Is there any significance to the colouring of the nodes/wires?

    Here's some of shaders I've made;
    Water jets, two layers of controllable/tintable details (waves), vertex offset bulge and refraction
    http://i.imgur.com/SC3ke7S.gif



    Local-space noise gradient for "dirt" on zombies.
     
    Last edited: Jun 17, 2017
    Lex4art and KRGraphics like this.
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I am digging the dirt, especially with the fractal noise... something like this could work for something I am planning
     
  22. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    187
    Hi, I am trying to get more into shader development, nothing fancy, just to get better understanding when coding own projects. I am trying to re-create this shader:



    I have practically everything working (rotation, pulling from separate texture channels) but one thing I can't re-create: Blend mode: Additive setting. The effect is very different when I set Blend RGB to Additive (the only setting I found that had "Additive" value to set"):

    upload_2017-6-17_20-11-15.png
     
  23. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    Is there any way to make post effects with ASE? Something simple like a desaturate camera effect like here:


    Been playing with it this afternoon and can't seem to figure it out. It's one of the last shaders on my list that needed to be reworked from SF. Any tips?
     
    xxPillsxx likes this.
  24. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Sorry if this has been asked already.

    Is there or will there be a custom code node? Or ability to include files, and invoke custom functions?
     
  25. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    There is a custom expression node that lets you write code from inside an ASE graph. I don't know it's current limitations precisely.

    You can also write totally new nodes using the code generation system the existing nodes work off, which can definitely do what you need.
     
    SunnySunshine likes this.
  26. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Neat, I completely missed that. Was searching for "code" rather than "custom expression".

    Doesn't look like you can send a sampler to it though. That's a shame.
     
  27. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hi,
    I am getting couple of issues with function where variable are not reported in the main shader inspector
    I have the below :

    upload_2017-6-18_16-40-24.png

    upload_2017-6-18_16-41-33.png

    upload_2017-6-18_16-43-10.png
    So all looks correct ...
    But if I copy in a shader that what I see :
    upload_2017-6-18_16-45-0.png
     
  28. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    Hi i was trying to replicate this from unreal
    unreal1.PNG

    & this was my result unity2.PNG Capture.PNG
     
  29. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    The problem is that the original sampler is not being used. The reference works to reuse a sampler, not to create one, your original sampler is not connected to anything so it doesn't know what to copy. One of those four need to be the main sampler. That should fix it.

    That was actually added recently so you can pass a sampler through it. You just need to be careful on how you use your UVs. Because the custom expression node will either create inline code or a function so you wont be able to create a global variable like the _ST variables usually used to sample a texture. If you need that, add a float2 input for the custom expression and pass the UVs manually.
     
    antoripa likes this.
  30. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    This was a difficult one. Apparently unreal's tonemapper changes the material transparency. So here's the thing, you are not doing anything wrong, and when I looked at the video I thought it was strange that the result was somewhat transparent when the output is 1 for the emission value (or even for opacity). How can an object that is fully opaque be transparent? After digging a bit the cause is unreal's tonemapper. If you deactivate it you get the same result as unity. But there's even a more serious issue, I can't either use unity's tonemapper and mimic the same result nor I cause change unreal's tonemapper values to make it stop putting transparency.

    I suspect that unreal's tonemapper is using HDR in a way that values between 0-1 are getting a higher range and when they do the transformation between high and low values is increasing and thus revealing any object that uses transparency. This doesn't seem possible with unit's post processing stack effects from my tests, but I could be wrong. I would need to create my own post processing effect just to check this.

    For your case the best solution is simply to scale down the values, like for example using a multiply node.
     
  31. xxPillsxx

    xxPillsxx

    Joined:
    Oct 10, 2012
    Posts:
    31
    I second this. ASE needs more accessible way to create some post process shaders.
     
  32. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    Just uploaded a new build into our website.

    Here are the release notes:

    Release Notes v1.0.0 dev 09:
    • New features:
      • New 'Static Switch' node which allows creation of shader variants
    • Fixes:
      • Fixed minor issue on reading inputs from dynamic 'Add' and 'Multiply' nodes on older shader versions
      • Fixed issue on Parent Graph attempting to delete in-existent connections
      • Fixed issue with always disabling Light Maps when using Tessellation
      • Fixed issue with Texture Nodes reference drop down selector showing incorrect labels both on 'Texture Sampler' and 'Texture Coordinates' nodes
      • Fixed issues on incorrect loosing references with 'Texture Sampler' on Reference mode
    • Improvements:
      • Improved 'Append' node connection management
      • Added Local Var selector directly on 'Get Local Var' node body

    Just a quick note on the 'Static Switch' node, we are now gradually introducing keywords into ASE and this is still a work in progress. With this node you can create and use a shader variant by defining a keyword name and its type between being a Shader Feature or Multi Compile.
    Please take a took at Unity official documentation for more information about shader variants.


    Expect much more regarding keyword support on ASE in the future.

    Happy shader creations.
     
    antoripa likes this.
  33. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    how to use lab's renderer with ASE?
     
  34. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @Amplify_RnD_Rick I created this suggested HoloLens shader in the editor and the shader shows up pink in the editor with a weird compilation error when Amplify is in my project. When I create an empty project without Amplify the shader shows up perfectly normal. Do you know what the issue is?

    Here's the specific shader code:
    Code (csharp):
    1. Shader "Unlit/VertColorWithShadow"
    2. {
    3.     Properties
    4.     {
    5.         _MainColor("Main Color", COLOR) = (0,0,0,1)
    6.         _ShadowColor("Shadow Color", COLOR) = (1,0,0,1)
    7.     }
    8.  
    9.     SubShader
    10.     {
    11.         Tags { "RenderType"="Opaque" }
    12.         LOD 100
    13.  
    14.         Pass
    15.         {
    16.             Tags {"LightMode" = "ForwardBase"}
    17.  
    18.             CGPROGRAM
    19.             #pragma multi_compile_fwdbase
    20.             #pragma vertex vert
    21.             #pragma fragment frag
    22.  
    23.             #include "UnityCG.cginc"
    24.             #include "AutoLight.cginc"
    25.  
    26.             float4 _MainColor;
    27.             float4 _ShadowColor;
    28.  
    29.             struct appdata
    30.             {
    31.                 float4 vertex : POSITION;
    32.             };
    33.  
    34.             struct v2f
    35.             {
    36.                 float4 pos : SV_POSITION;
    37.                 float4 mainColor : COLOR;
    38.                 LIGHTING_COORDS(1,2)
    39.             };
    40.        
    41.             v2f vert (appdata v)
    42.             {
    43.                 v2f o;
    44.                 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
    45.                 o.mainColor = _MainColor;
    46.  
    47.                 TRANSFER_VERTEX_TO_FRAGMENT(o);
    48.  
    49.                 return o;
    50.             }
    51.        
    52.             fixed4 frag (v2f i) : SV_Target
    53.             {
    54.                 fixed atten = 1.0 - LIGHT_ATTENUATION(i);
    55.                 fixed3 shadowColor = atten * _ShadowColor.rgb;
    56.                 fixed4 finalColor = i.mainColor + fixed4(shadowColor, 1.0);
    57.  
    58.                 return finalColor;
    59.             }
    60.             ENDCG
    61.         }
    62.  
    63.         // Pass to render object as a shadow caster
    64.         Pass
    65.         {
    66.             Name "ShadowCaster"
    67.             Tags { "LightMode" = "ShadowCaster" }
    68.    
    69.             ZWrite On ZTest LEqual Cull Off
    70.  
    71.             CGPROGRAM
    72.             #pragma vertex vert
    73.             #pragma fragment frag
    74.             #pragma multi_compile_shadowcaster
    75.             #include "UnityCG.cginc"
    76.  
    77.             struct v2f {
    78.                 V2F_SHADOW_CASTER;
    79.             };
    80.  
    81.             v2f vert( appdata_base v )
    82.             {
    83.                 v2f o;
    84.                 TRANSFER_SHADOW_CASTER_NORMALOFFSET(o)
    85.                 return o;
    86.             }
    87.  
    88.             float4 frag( v2f i ) : SV_Target
    89.             {
    90.                 return float4(1.0, 1.0, 1.0, 1.0);
    91.             }
    92.             ENDCG
    93.         }
    94.     }
    95. }
    96.  
     
  35. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Getting some micro-stuttering every 5 or so seconds when using the Canvas in Unity 2017.1 beta. This warning is also printing to the console every other time it stutters.

    Code (CSharp):
    1. Event.Use() should not be called for events of type Repaint
    It's not unusable but it makes everything very slow and it interrupts my dragging of functions causing me to have to try and drag them two or three times.
     
    x4000 likes this.
  36. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    @kebrus thanks a lot for your help. . Yes, It works .. Function is a great feature
     
  37. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    For now it isn't possible to use external libraries with ASE. Apologies for the inconvenience.

    This is quite strange since ASE doesn't influence shader compilation at all.
    Is it possible for you to share the compilation error so we can try to figure out what might be happening?

    Thank you for reporting this. We'll take care of this issue as soon as we can.
     
    antoripa and x4000 like this.
  38. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    anyone knows how to create a shader where a player can activate a wall sense/hack to find enemies with a pulse distortion
     
  39. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    It looks like the issue was either computer specific, or Collaborate didn't grab all the files correctly. All is good now. Thanks for responding so quickly.
     
  40. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hey All,
    I'm currently working on a shader that fades my 3D text but I'm having some issues (I know fade shaders are tricky) with the wrong parts of the mesh showing through and I was wondering if it is fixable?

    3D exclamation mark:
    model.JPG

    Issue (black outline showing through white front face):
    issue.JPG

    ASE node setup:
    nodes.JPG

    Cheers,
    Colton
     
  41. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    I've a question for ASE developers:
    is it possible with ASE to build a shader interface with UI elements like the Unity standard shaders?
    In particular, I'm referring to:

    - small texture slot;
    - checkbox that enable a feature (like "enable instancing" in the Unity standard shader) or a set of properties (like the "Emission" checkbox)
    - menu list items (like "UV Set" in the "secondary maps" section of the Unity standard shader)

    If it's not possible at the moment, have you planned to develop in a near future?

    Thanks in advance.
     
  42. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    I know you can assign a custom inspector to ASE shaders. I think that's the only way at the moment though -- the only thing you can really change about how the inspector looks from inside ASE is the order of the properties.
     
  43. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    That a really weird setup, what exactly are you trying to do? Do you want the sides of the model to be black and the front to be white and then fade all away? is that it?

    You should avoid conditional statements unless you really need them, they are expensive in shaders.

    Like @brisingre said, the only thing you can change is the custom inspector of that shader. This is by design because you want to be able to create a shader and then move it to a different project without any editor dependencies. For example, you can even sell your shaders, it would be pretty bad if you also needed the editor for a shader to work.

    The things you listed are all custom fields unity created in their own standard custom inspector so the only way to get them is to create your own custom inspector and do the same.

    The checkbox one you might be able to reproduce in some way. In the latest update you now have a static switch node that creates a shader keyword that you can control by a toggle in your material. This is the same to say that you can control parts of your shader with one toggle. For example, you can activate/deactivate certain calculations if you need/don't need them. You can't control the UI tho.
     
    marcatore likes this.
  44. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hey Kebrus, thanks for the reply

    Yes that it exactly what I'm attempting to do. I know I could UV map it better and create a black and white texture but I implemented the current shader so the colors would be easy to change from code. Any thoughts on how to improve it or fix the fading?

    Cheers,
    Colton
     
    Last edited: Jun 22, 2017
  45. Rumbleboxer

    Rumbleboxer

    Joined:
    Dec 26, 2012
    Posts:
    27
    Hi guys,

    Is there a way for me to set it up so a mesh is always rendered with soft sort of edges (like a glow effect)? I attempted to use the rim light but there's no way for me to make the rim light area rendered as transparent. Perhaps I'm doing this wrong?

    regards
     
  46. Rumbleboxer

    Rumbleboxer

    Joined:
    Dec 26, 2012
    Posts:
    27
    Sorry for double posting.. i can't seem to edit my post but here's an example of what i'm trying to do... I'm creating a distortion effect using a mesh but the edges are too hard. I'd like it to 'blend' with the background better. Any ideas how?
     
  47. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Have you tried to sample the fresnel node and use it as a mask for when the distortion is used?


    I am myself trying to do something. I found this video


    I was wondering if it was possible to make something like that in shaderforge (by using the material on a sphere). I am specifically talking about the "volumetric" aspect of the clouds. Maybe using the parallax settings?

    Also in order to do that, it seems that we need to sample a 3D noise texture. I fail to find documentation about 3D Texture (cubic) creation in unity. Does anyone knows where to search?
     
    Last edited: Jun 23, 2017
  48. x4000

    x4000

    Joined:
    Mar 17, 2010
    Posts:
    353
    @arnoob: Generally speaking to do volumetric clouds you need 3D perlin noise sampling, which is pretty darn costly if you're rendering it at any sort of high precision like that. With things like light bleed and whatnot, it only gets worse. I've experimented a lot with procedural terrain, and I've dissected a few volumetric fog/cloud solutions by other folks on the asset store, and pretty much universally I'm not seeing a way to do that in an all-shader fashion. In most cases it requires rendering at a smaller scale and then upsampling, for just one example.

    Edit: This is a fascinating rabbit hole: https://www.gamedev.net/forums/topic/680832-horizonzero-dawn-cloud-system/

    It was linked in the video you posted. There's no way in heck you're going to want to use any sort of visual shader tool to try and create something like that, and it's a post effect anyhow from what I can tell.
     
    arnoob likes this.
  49. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We've just uploaded a new build into our website.
    Here are the release notes:

    Release Notes v1.0.0 dev 11:
    • New features:
      • Additional includes (.cginc) can now be used into an ASE shader via the Additional Includes sections on the Output node
        • Their contents can be accessed via the 'Custom Expression' node
      • Added Node Search bar to quickly find nodes on the canvas
        • Ctrl + F: Shows Search Bar
        • Enter/Return/F3: Goes to next occurrence
        • Shift + (Enter/Return/F3): Goes to previous occurrence
        • Escape: Hides Search Bar
    • New samples:
      • UV Light Reveal
    • Fixes:
      • Fixed issue on creating unnecessary casts from floats
      • Fixed minor issue on GPU Instancing sample
      • Fixed minor UI issues on 'Reflect' and 'Refract' nodes
      • Fixing shader paths for Community Shaders
      • Fixed issue on incorrect cast when using Floats and Ints in certain nodes
      • Fixed issue on resetting in certain situations vertex local variables generated during Output Node fragment code generation
      • Fixed issue on property name update in 'Grab Screen Color' node
    • Improvements:
      • Improved nodes local variables reset behavior to prevent future issues
      • Added previews to 'Gamma To Linear' and 'Linear To Gamma' nodes
      • Forcing 'Dot' and 'Normalize' nodes to store results in local value and prevent with power operations
    Here's a glimpse from our new sample:



    Unite'17 Europe

    Next week we will be attending Unite'17 in Amsterdam and won't be able to provide support and new builds to ASE.
    Please come by our booth ( B03 ) if you are in the neighborhood. It would be awesome to meet you all in person!

    Happy shader creations!
     
  50. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    I have two vertex animations that are texture driven, and I would like to combine together to export it to the Local Vertex Offset in my Material. I tried Lerp, Multiply and Add with little avail. Every time I try those I get a shader error: "undeclared identifier 'temp_cast_6' at line 81 (on d3d11)." Thoughts on how I can do that?

    Thanks.