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

    Syne3

    Joined:
    Mar 30, 2017
    Posts:
    3
    Ok, clear.
    I have a set of normals that I blend together, but the textures are not set as normals in the import settings, so they are not packed, and thus I do not unpack them in the texture sampler.
    What operation do I have to do to have a correct reading on those normals?

    Thanks
     
  2. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    51
    Hi ( sorry if my english is not perfect im french )
    I'm trying de create a cool comic shader ( like madworld on wii ) my shader work with directional light but not correctly with point light and spot light.

    Here my shader :


    Here the good result with directional light :


    Here the bad result I get with point light/spot light :


    What am i doing wrong ? please help thanks
     
  3. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    When dealing with custom lighting you are responsible by having to take both point and directional lights into account.
    What is happening to you its not a bug, the graph you are setting into the Custom Lighting port is being use by both Base and Add passes which calculate light contributions for directional and point lights respectively.
    So what you now only need to do is, over your graph, filter what you want to be calculated over the Base and Add passes. This can be done by using the Static Switch node.
    So:
    • Create a Static Switch node
    • Set its Mode to Fetch
    • Set ts Keyword to either UNITY_PASS_FORWARDBASE or UNITY_PASS_FORWARDADD
    Let's say you set your Static Switch keyword to be UNITY_PASS_FORWARDBASE, then what you would connect to its True input port would be calculations for Directional Lights. What would be connected to the False input port would be the calculations done on both Point and Spotlights.

    We have two shader functions for that, Terrain Wind Animate Vertex and Terrain Wind Value.
    Our SimpleTerrain sample makes use of that through the GrassBlases shader. You first need to unpack the ApplyGrassWindToTerrain.unitypackage ( which is on the sample folder) to see it in action.

    If the texture itself is not packed then its just a matter of scaling it to a -1 to 1 range, since color values are always on a 0 to 1 range. After that you'll need to calculate the correct z value in order for the final vector3 is normalized.
    I created a shader function called NormalFromColorTex for you ( link here ) that already takes care of everything. You just need to plug the Texture Object over its Tex input port and it will calculate the Normal value.

    No problem at all. You are suffering from is a bit related to the same issue that I previously described earlier on this post to Roxane_ImgSpc.
    You are not taking into account that what you place over the Custom Lighting port is going to be used in both the Base and Add passes.
    Like the name says, the Base pass calculates the base directional light. The Add pass will be run for each one of the point and spotlights and its result will be added on top of the previously calculated base.

    One aspect of your graph that I'm not quite understanding is, why are you adding the inverted Light Attenuation value (the one multiplied by Float 0 ) to your final lighting calculations.

    Also please note that the Light Attenuation node has different behaviors depending if its being used on the Base or Add passes.
    On the Base pass it returns 0 or 1 areas depending if the object is directly lit or in shadow, on the Add pass it also contains the light falloff which changes according to its range setting.
     
    Baldinoboy likes this.
  4. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    51
    Hi Thanks you so much for your answer !

    "One aspect of your graph that I'm not quite understanding is, why are you adding the inverted Light Attenuation value (the one multiplied by Float 0 ) to your final lighting calculations"
    It my first shader I don't know what i'm doing exactly ( hard to explain in english )

    I tried static switch with unity_pass_forwardbase and now point light and spot light works !



    I have another question when I generate lightmaps they don't show up on the shader what I need to add for have lightmaps on my shader? thanks
     
  5. andreadoria

    andreadoria

    Joined:
    Feb 5, 2014
    Posts:
    3
    Thank you for the answer. The target platform is Windows, and no, the color of the XRay is set to a vivid green, as you can see from the picture.



    But i just discovered that the black dots problem is caused by the Post-process Layer! If i disable the Post-process Layer then the black dots completely disappear.

    Here a comparison. Black dots on the left, no black dots on the right.



    But i need to use the Post-process Layer! So... any idea on how to fix that?
     
  6. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Great, Thank you for the info!
     
    Amplify_RnD_Rick likes this.
  7. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    I tried over here with PPSv2 and a couple of effects but no black dots appeared. This may be a particular effect, or a combination of effects that causing that.
    Can you pack and send me that scene with the issue happening? This way I have the exact same PPSv2 setup as you and it will be easier for me to figure out what is happening and a way to prevent it.
     
    Last edited: Jan 10, 2020
  8. AA-Matt

    AA-Matt

    Joined:
    Oct 1, 2016
    Posts:
    8
    Using Unity 2019.2.10f1 and got these errors when trying to use Texture Array Creator with format set to ASTC_RGBA_6x6:

     
    Last edited: Jan 10, 2020
  9. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Hey, I'm using this shader to lerp between two colors depending on how the faces are oriented, but when I scale the object's X to -1 to flip it, it also flips the normals and inverts the colors, how can I avoid that?

    This is for a 2D game so the camera never rotates, I'm trying to fake lighting and color a cloth's faces that are facing up and forward with a color and a darker color when facing down and back, like this:

    Cloth.jpeg
    ColorLerp.jpeg

    Thanks
     
    Last edited: Jan 13, 2020
  10. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Unfortunately there's not much we can do about this. It seems that this particular format you are trying to use is not supported by your current platform.
    ASTC is supported by tvOS (all), iOS (A8), Android (PowerVR 6XT, Mali T600 series, Adreno 400 series, Tegra K1).
    You can check the full texture format compatibility list over here.

    You mentioned your camera never rotates but I'm also assuming that your object/quad also never rotates, is aligned with the camera and moving around the XY plane. Because If not, you should be using the World Normal vector instead.
    I'm a bit intrigued by your issue since vertex normal is not affected by the object's scale. You could set any scale into any of its axis and this vector remains unchanged.
    How are you changing the object scale? Is it through scripting or in the shader itself?
     
  11. fedorval

    fedorval

    Joined:
    Nov 15, 2019
    Posts:
    17
    Hi!

    I've been wondering this for a while and trying to find anything about it in your documentation and such but I never stumbled on it yet.

    I've been using Shader Functions for a while now and they're great, however when I update my SF it doesn't automatically compile shaders using that function so that they update as well. The result of this is that if I use the function on like 30 different shaders, I have to individually open each one and compile them by hand.

    Is there a way to compile all ASE shaders in one go or automatically compile shaders linked to a Shader Function? It would save a lot of time and headaches when trying to understand why one of my shaders change completely after I compiled them before realizing that it's the SF.
     
  12. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Unfortunately there's nothing official on our end that does that.
    This would be a great feature indeed and we have it already registered on our ToDo list for quite a while, but we haven't been able to tackle it yet.
     
    fedorval likes this.
  13. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Hmm, it appears that without the "cloth" component I can flip the scale and the shader is working fine, but when I re-enable it the shader gets flipped with the negative scale, any idea why the cloth component would cause this?

    I'm sending you a small test project in your DMs, the shader's on a cube with a cloth component, just set it's X scale to -1 and you'll see the shader get flipped, if you disable the cloth component it then works fine
     
  14. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Sure thing, it would be great if you could send me a test project because without seeing the full shader it will be a bit hard on my end to figure out what might be happening.
     
  15. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    Hi, guys.

    How would I turn a gradient into a 0/1 mask in amplify, with no gradient?

    So if I have a gradient, and I want everything above 0.5 to be white, and anything below 0.5 is black? How would this be set up?
    I would want to turn something like this
    upload_2020-1-13_16-44-3.png
    into this
    upload_2020-1-13_16-44-34.png



    However I want to be able to specify the values, so I could also do this.
    upload_2020-1-13_16-45-28.png

    I imagine this is super simple & I've tried various setups but am a bit confused, any help would be awesome!

    Thanks
     
  16. Khena_B

    Khena_B

    Joined:
    Aug 21, 2014
    Posts:
    273
    Use the Sign node

    To shift it add a float value between -1 and 1 to the gradient before the sign node

    Also you could do something like this without needing a texture

    Gradient.jpg
     
    Last edited: Jan 14, 2020
    o1o101 and Amplify_RnD_Rick like this.
  17. cdytoby

    cdytoby

    Joined:
    Nov 19, 2014
    Posts:
    181
    Hello,

    I can't find any proper forum support for this plugin, so post it here is the only way I suppose.

    I know little about shaders so I may not use professional words.

    I'm trying to create an easy shader to display an 2D image in 3D world using "Quad" mesh. The Unity Standard Shader was used but there are some minor issues, so I was trying to create a new one, but the same issue also presented.

    The videos of the issue are in attachment.

    The main issue is the "rendering order" is changing when camera moves, even they're both facing the camera.
    The secondary issue is, I want to create: both transparent images are intersecting with each other, just like ZWrite On but with the other image remains uncut.

    There is one important requirement: every element like this are generated in runtime (using prefab), so in Editor time there is no way to know which image is placed in which place, and some of the images are pngs with half transparent or transparent pixels.

    I uploaded the test pngs and shader files are in attachment. Can you help me to solve this?

    I'm using build-in rendering pipeline due to stability but we're considering moving to SRP (URP) with next major LTS update. If there are solution in there it's also fine.

    One more question: how should I start a new thread with such help? I notice the official forum is dead for a year now, and there are no way to seek help except post a Post in this huge thread, and it's not ideal.
     

    Attached Files:

  18. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Our preferred way to offer support is via email ( support@amplify.pt ), since over there we can keep better track of each reported issue/support request.
    If you are a Discord user, you can also join our Discord channel as we are also very active there.

    Regarding your problem, unfortunately this is a common design issue with using alpha blend and there's not much it can be done. If all objects have the same rendering order and they aren't writing over the depth buffer ( since you want them to be transparent ) then the way they will be rendered will be according to the way Unity orders them internally.

    This is what happens over that gif you sent, by transforming the camera, Unity reorders those quads according to where they are in relation to the camera.

    If you want to explicitly let Unity know the correct order you need to modify the shader rendering order.

    One possible solution is, instead of Alpha Blending, use Additive Blending which does not rely on the rendering order.
    For this, you can set your Blend Mode to Custom. After that, select the Blend RGB dropdown and select the Additive option.
     
  19. 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.7.5 rev 02:
    • Fixes:
      • Fixed issue with incorrect _ST variable declaration on templates over 'Texture Array' node
      • Fixed issue on 'Grab Screen Color' node creating a default Grab Pass when using the default grab name with Custom Grab Pass activated
      • Fixed issue on 'Texture Transform' node giving incorrect values on certain connections
      • Fixed node preview update for missing shader functions
      • Fixed issue on 'Static Switch' node using in-existent keyword indices
      • Fixed 'Static Switch' reordering issues when in Reference mode
    • Improvements:
      • Added missing previews to nodes
      • Ortho Param
      • Projection Param
      • Screen Param
      • ZBuffer Param
      • Clip
      • Compute Screen Pos
      • Texel Size
      • Texture Transform
    • Tweaked 'Texture Object' and 'Texture Sampler' node previews to avoid recent for AMD crashes

    Happy shader creations!
     
  20. cdytoby

    cdytoby

    Joined:
    Nov 19, 2014
    Posts:
    181

    Thank you for the reply, I tried the blend RGB option, but with the option additive it "removes" the alpha completely and I can see nothing. I attach the screenshot here.

    I understand that this is a commen design issue but is there any solution in URP (or if I switch to URP in the future)?
     

    Attached Files:

  21. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Unfortunately you will stumble into the same ordering issues when using URP.
    I did a very quick test for you on URP with the latest 2019.3

    As you can see, by changing the camera, the objects draw order changes (as expected).
    Regarding the shot you sent. When using Additive Blend, what happens is that Unity adds to color result of your shader to what already is drawn. The alpha channel is not directly used.
    You can however pre-multiply your color channels with the alpha and then set that result over the master. node
     
  22. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Speedtree application has a really nice shader for leaves where they use various blending edges to make them look very fuzzy yet still opaque. Is it possible to do something like this with ASE as well?
     
  23. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Maybe this is some sort of alpha to coverage implementation on their end. Without seeing the shader itself its tricky to see what are they are actually doing.
    You will need to activate MSAA on your project for you to be able to use Alpha To Coverage. Over ASE, you only need to set the Alpha To Coverage toggle over the Blend Mode options (assuming that your are using the Surface Shader Type).

    AlphaToCoverage.png
     
  24. 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.7.5 rev 03:
    • New Templates:
      • Universal Experimental 2D Lit
      • Universal Experimental 2D Unlit
    • Fixes:
      • Fixed issue on incorrectly setting a wrong instanced block name on non-main passes when using GPU Instancing over templates
      • Added Safe Power option into both 'Power' and 'Fresnel' nodes
        • Ensures base for power operation is always greater than zero to prevent NaN over the result
      • Fixed 'Indirect Diffuse Light' and 'Indirect Specular Light' nodes preview when Normal Space option is set to World
      • Fixed 'Fresnel' node preview as it wasn't showing the correct result when scale was different than 1
      • Fixed Alpha Clip issue across multiple Unlit Lightweight and Universal template versions
    • Improvements:
      • Improved mouse focus behavior when ASE is not focused
      • Migrated Lightweight samples into Universal RP
    Happy shader creations!
     
  25. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    19
    Hi, I'm trying to create a blob shadow shader that will draw in the shadows but not in direct light. I came up with this, but its not working as I expected it to.
    It's very basically a dark circle texture set to transparent, multiplicative. I then add the light via custom lighting to make it bright where there is light. As the shader is set to multiply, I imagined that the light area would not draw, but it does. It seems like the shader is multiply in general, but then the custom lighting is additive. I expected the shader and lighting to be calculated and then multiplied. ambient shadow graph.PNG ambient shadow view.PNG

    I'm sure this is me thinking this through in the wrong way. Any help making this work, or an alternative solution would be much appreciated!
     
  26. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    19
    Sorry let me clarify that node graph a little: ambient shadow view 2.PNG
     
  27. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Custom lighting is a tricky subject. It isn't additive as you mentioned.
    When dealing with custom lighting, you are creating your own custom light which will be used into two separate stages/passes.

    The first one is called Forward Base and its responsible for calculating the light contribution of directional lights.
    The second one is called Forward Add and its responsible for calculation the light contribution of point and spot lights. This stage is the one which is additive as the result of each light will be added on top of the previous one.

    Getting back to ASE, the graph you connect to the Custom Lighting input port will used in both the Base and Add passes.

    You can limit what is used in each stage by using the Static Switch node, setting its Mode to Fetch and selecting either the UNITY_PASS_FORWARDBASE or UNITY_PASS_FORWARDADD over the Keyword dropdown.

    upload_2020-1-23_12-15-42.png

    P.e. if you select UNITY_PASS_FORWARDBASE then what is connected on the True input port will be used over the directional lights and what is connected to False will be used over the Point and Spotlighs.

    Taking a look at your shader, you are multiplying the Light Attenuation node with the Light Color node and connecting that over the Custom Lighting port.

    One other detail to take into account, the Light Attenuation node have a slightly different behavior if on the Forward or Add passes. In Forward it returns a white or black color whether the object is directly lit or in shadow, in Add it also contains the smooth falloff information of the light.

    So internally what is happening is that you are setting that result over the forward base pass for your directional light, but also you are calculating the same result (with that slightly difference from the Light Attenuation node) for that spotlight and adding on top of the forward base which is saturating the overall result.

    I'm also not sure why are you connecting that texture to the Emission port as it adding its color to the overall result as well.
    Maybe you want to set your Blend mode to Transparent, invert its colors and use it over the Opacity port?
    This way you are setting the shape of blob shadow with it.

    Today we'll be streaming around 5pm GMT over our youtube channel and its topic is exactly Custom Lighting so please drop by. I think it will be very helpful for you.
     
    Last edited: Jan 23, 2020
  28. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We've uploaded a new build into both our website and Unity Asset Store ( available soon )

    Here are the release notes:
    Release Notes v1.7.6 rev 00:
    • New Shader Function:
      • SRP Additional Light
        • Returns SRP's additional lights information calculated with a selected lighting mode
    • Improvements:
      • 'Light Attenuation' node on Lightweight/Universal now outputs only the attenuation of the main light
        • Before it outputted the sum of all light attenuations which didn't have a practical use
    Happy shader creations!
     
  29. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    19
    Thanks for you reply. It's great to get some more details about Custom Lighting! I'll tune into the youtube stream later.

    After looking into this more, and taking the information you've given, I'm doubting that custom lighting can be used for what I want it to do specifically. This is mainly because in the most ideal circumstance, this light/shadow information would end up being the mask/opacity which afaik won't work. Here's a photoshopped image to explain what I'm trying to achieve, please let me know if you think this is viable with custom lighting or if there's a more preferable different approach. Many thanks! BlobShadowv2.jpg
     
  30. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    We're going live around 5PM GMT!

    Join us for a Custom Lighting breakdown using SRP.

     
  31. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    I'm not really sure if you can achieve this with custom lighting.


    You can perhaps try something like this:
    upload_2020-1-24_10-49-7.png

    So, what I'm doing over there is controlling the opacity of the generated shadow. I set the Blend Mode to Custom for the Opacity port to be available and then use a Static Switch with the UNITY_PASS_SHADOWCASTER keyword to only change the alpha value on the shadow caster pass.
    The setup of the static switch is similar to what I explained earlier but you select that different keyword.

    This, however has a drawback, as the shadow caster controls the opacity through a dither effect, so the end result may not be exactly as you want.
    I'll continue to give it some thought and let you know if I come up with a better solution.
     
  32. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    We've uploaded a new build into our website.

    Here are the release notes.
    Release Notes v1.7.6 rev 01:
    • Fixes:
      • Fixed usage of legacy variables over SRP on time related nodes
        • Time
        • Time Parameters
        • Sin Time
        • Cos Time
      • Fixed issue on HD Unlit Vertex Offset input code not being set on all passes
    Happy shader creations!
     
  33. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    19
    Hi Ricardo, thanks for your reply. I set the shader up as suggested, its coming out like this:
    ambient shadow view 3.PNG

    Is this looking as you expect or am I going wrong? To me it seems like the fetched shadow pass is not creating any opaque/transparent areas, is this because even though blend is set to custom the render type is still opaque?
     
  34. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    19
    Oh I see, the example you posted should be on the Sphere? With that I get something a bit closer, but there are issues. The dithering which you mentioned, the shadow also draws over the sphere and also how is the texture mapped to the shadow on the ground? ambient shadow view 4.PNG

    In order to rethink the general aim (visualised before) but even more high level, is can we get ambient occlusion (ambient only option on) under the characters when we can't afford actual Post Processing AO... not a small ask ;)
     
  35. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    That shader was being applied to the plane itself but when I came up with that idea I forgot that you wanted to clip the non-shadowed part. So that is a no go.
    I do apologize for the delay between posts but I'm also scratching my brain to come up with a solution for you.
    Have you perhaps considered using Unity's own Projectors?

    EDIT: You can create projector type shaders with ASE. You can check our AmplifyShaderEditor > Examples > Official > Projectors on which we use projectors for lights and shadows.
     
  36. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    19
    Haven't looked into projectors yet, but I will do. Thanks for the suggestion!
     
  37. Hertzole

    Hertzole

    Joined:
    Jul 27, 2013
    Posts:
    422
    Hi!
    I'm wondering if it's possible to create a shader that allows the user to select which type of render mode they want to use, like the standard shader? I want to have one shader that can be opaque, alpha cutout and transparent and can't use the standard one. And as I'm not good with shaders at all, making sense of the built-in shaders is quite difficult, so I can't just copy from that.
     
  38. bagle45

    bagle45

    Joined:
    Jul 25, 2016
    Posts:
    17
    I'm running up against 16 texture sampler limit, and I'd like to work around this using Sampler States. Is this possible with Amplify Shader?
     
  39. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    43
    Hi, I just bought your shader editor and all your materials are pink, as is any material I create which uses them. I'm using URP, and the URP shaders seem to work fine, it's just the ASE ones which are broken. Oddly, when I preview the material with a mesh it looks fine, but in the game or editor, it's always broken.
     
  40. cinemator

    cinemator

    Joined:
    Aug 1, 2014
    Posts:
    7
    Hello, I think this has a very simple solution but I'm new at shading, if you can help mew ith this very simple problem I will be very appreciated,

    I can control the opacity of objects with this slider but I also want to disappear the object's shadow's with same slider with the same opacity too. You can see it in the video.

     
  41. DeadNinja

    DeadNinja

    Joined:
    Jun 3, 2013
    Posts:
    39
    Does ASE support StructuredBuffer yet? Saw some post from 2018 that it will be added soon but cant find any info more than that.
     
  42. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Unity is able to do that via custom material inspectors and not by the shader itself. Unfortunately you can't assign p.e. a property to your Render Type or Queue and to change from the regular material inspector.

    It will be, hopefully soon. We're already working on it but there are still some issues we are addressing before releasing it.

    Thank you for reaching us.

    The samples that are available when you import ASE were created using the standard pipeline and are incompatible with URP ( thus the pink color ).

    For URP specific samples, you must unpack the Universal SRP Samples.unitypackage over at Examples folder.

    Be sure to download our latest ASE version from our website which does have more packed samples under that package.

    When creating your own shaders you need to use specific URP Shader Types for your end for them to be compatible with the pipeline.



    Or on an already created shader, you can change also the Shader Type.



    This is actually a bit tricky because you can't control the shadow's opacity. The only way to control the shadow itself is through the Alpha Clip Threshold node, which means that you'll have to use Alpha Clip over your shader.

    To give you a bit of context, the way alpha clip internally works is, it calculates the difference between the Alpha value and the Alpha Clip Threshold you supply. If the result of that difference is a negative number then the fragment is discarded.
    This means that there's not intermediate stage, the fragment is either drawn or discarded.
    Please notice the following example where I set the Alpha Clip Threshold to 0.1. As soon as the Alpha value is less than 0.1 both the object itself and shadow disappears.



    You can try and play around with alpha clip, p.e. using a Dither node
    Something like this:



    Unfortunately no. We do have that feature already registered on our roadmap for quite a while, but haven't been able to tackle it yet.
     
  43. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    340
  44. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
  45. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    340
    Oops:oops:
     
  46. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We've uploaded a new build into our website.

    Release Notes v1.7.6 rev 02:
    • Fixes:
      • Assured latest fix for time related nodes over SRP is only applied on latest versions
      • Fixed issue on declaring variables inside CBuffer that are already on native template
    Happy shader creations!
     
  47. mostlyhuman

    mostlyhuman

    Joined:
    Mar 16, 2013
    Posts:
    53
    Can you load a shader that wasnt created with ASE and ASE will analyze it and create the nodes so you can edit it within the editor?
     
  48. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Unfortunately no. ASE can only load shaders created with it.
     
    mostlyhuman likes this.
  49. robotmechanic

    robotmechanic

    Joined:
    Dec 29, 2009
    Posts:
    106
    Hello,

    I am trying to replicate some of the functionality of Unity's standard shader in Amplify.

    However, I am unsure of how to do an #ifdef check in Amplify. The provided "if" nodes don't seem to be the right tool for this situation.

    Code (CSharp):
    1. #ifdef _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
    2.         mg.g = tex2D(_MainTex, uv).a * _GlossMapScale;
    3. #else
    4.         mg.g = _Glossiness;
    If I am not mistaken, the above shader code checks if there is albedo map assigned, if not, use the Glossiness value, right?

    If so, how do I do a null check for a texture in Amplify Editor? Custom Expressions?
     
  50. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hi,

    That keyword condition is created using a Static Switch node; you can learn more about the subject in the official Unity Documentation.

    However, keep in mind that the Shader itself is not doing any "null checks", or enabling keywords; Unity uses additional code for that. Additionally, should you want to change your material inspector look based on a specific configuration, you might need to build a custom material inspector.

    Hope it helps!