Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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:
    157
    I'm using the simpleRefraction shader applied to a particle system for the rain on a windshield.

    https://drive.google.com/uc?id=0B53omuMBfAaNQW92YU53clc0Vnc

    I'm not so expert so my question is: why the distortion take into consideration also the object outside the windshield?
    Take a look neat the central rear mirror. You can see the black of the mirror border and the light grey of the mirror.



    Do you have any tips to avoid this?

    Thanks in advance.
     
    Last edited: Oct 29, 2017
  2. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    255
    Hi guys,

    will there be a live preview like the one in shaderforge?
     
  3. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    Thx for the detailed report, in our first tries we weren't able to reproduce, could you please send us that shader so we can take a look? we'll look into and try to fix it next build, sorry for the inconvenience :\

    Well, that shader is from shader forge so I can't help you with that, either way, like I said previously the main feature of the ice effect is the reflection, which you wont get by using ASE or even SF, what you need is reflection effect, you could use unity's screen space reflections but the results wont be as good as the one in your screenshot, what you need is a planar reflection solution which takes a shot from beneath the ground up. It's expensive but if you control it well it's doable. And like I said previously you can get a version of it in unity standard assets for their water shaders.
    No, we don't have any tool to measure performance... yet.
    Truth is, it's something we have been investigating but so far we aren't happy with any solution. We want to integrate the instruction count into the editor but it has proven to be more difficult that it seems. We do have other ideas besides that one but it would be far better to have the final instruction count. I can tell you tho that any solution we thought about so far are for shaders created with ASE, unity shaders are out of scope from this project. However, if, we end up having the instruction count like we want there's nothing stopping you or anyone from comparing it with standard shaders.

    Short answer: yes, maybe? I can't say LIKE shaderforge, we've been trying different stuff. I can't promise you anything since it's still in development but we've successfully transformed the preview from the material inspector to be able to show custom meshes since that seems to be the primary reason why people want it anyway. I'm still not convinced of the usefulness of the previews, it seems that people want more and more of it, at some point I'm not sure if it isn't more effective to simply create a new scene with your model in it.

    I think @brisingre already did a good job covering it. I'll just add that you can also set some of the stuff to render later for you case. For instance you can set your mirror to render 10 queue offset later from anything else and then have your refraction shader somewhere in the middle. That way you make sure that your refraction effect only picks what behind it.
     
  4. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    So I did my research on the weekend and unfortunately I couldn't get any useful information about that particular case or any other similar case about intersection.

    The good news is, I did found out the guy who worked on the physics for the batman cape in the latest games and decided to ask him directly. He was a really nice guy and answered me what I needed to know, in fact he gave me a lot details of the various systems that make the cape work as good as it does (at least as far as his nda could allow him) and I think that was good enough so we can work on a solution.

    In short, most of the intersections are solved with physics and animation (keep in mind they didn't wanted a totally realistic cape because it's.. well.. batman :D ) by mixing the two in clever ways when necessary. This solves the majority of them and the smaller intersection issues were solved by rendering the cape a little by closer to the camera (a depth offset). This clears the remaining artifacts for all important cases, the few remaining aren't really noticeable. He also recommended looking at Apex for physics.

    All in all, I guess there isn't a generic shader solution for the problem, at least not an easy one (I did try stencil buffers but it was really funky) but a good mix of solution should give you an acceptable one ^^
     
    arnoob and brisingre like this.
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,727
    Thanks a lot for investigating and sharing! I have to accept there is no magic bullet and will have to play a bit with offset and some animation. The part where you do a depth offset, how is that best done in ASE if you don't mind me asking?
     
  6. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    I would use the offset from the depth options in the main panel, turn on Offset and put something like -1 in the factor field and something like -10 or even -100 in the units field.

    I would need a real case scenario of a cape to know for sure if those values are okay, these were just from quick tests I did. They seemed okay'ish for the most part. I'm assuming the rest must be solved with proper cloth physics :p (the talk about GPU physics from last year Unite comes to mind)
     
  7. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    513
    Hi everyone,

    We've just uploaded a new build into our website.

    This build is pretty similar to the one we've uploaded on Friday, as this was mostly an update to sync up the Asset Store version with the one we have over the website.

    Release Notes v1.3.5 dev 01:
    • New Shader Functions:
      • Blinn-Phong Half Vector
    • Fixes:
      • Fixed issue on 'Toggle Switch' node not being correctly registered when created

    @pwTA can you please give this version a try and let us know if the Toggle Switch is now behaving correctly on your end?

    Happy shader creations!
     
    KRGraphics likes this.
  8. Remer

    Remer

    Joined:
    Mar 24, 2013
    Posts:
    70
    Sorry! Wrong Shader :p
    If i understand correctly, i have a Texture 2D named "ReflectionTex" to "fill" with Planar Reflection script. Right?

    Now i have to understand how to make the broken ice effect.
     

    Attached Files:

  9. pwTA

    pwTA

    Joined:
    Mar 20, 2014
    Posts:
    5
    You guys/gals rock! Toggle switch issue is fixed.

    ..I probably should have mentioned in my original post that I'm in Unity 2017.2.0f3. But you obviously figured that out somewhere along the road to a fix.

     
  10. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    271
    Would it be possible to add a way to do multiple drag select operations while holding ctrl? This is a must have feature in my option for selecting large clusters of nodes, having to select the biggest possible cluster then select the remaining nodes one by one is a bit annoying.
     
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,997
    Sweet! I am still eagerly awaiting Skin Shader models so I can REALLY go to town
     
  12. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    255
    Hi guys, is there anyone manages to replicate UNREAL's fake interior using cubemaps through ASE?
     
  13. StudioEvil

    StudioEvil

    Joined:
    Aug 28, 2013
    Posts:
    57
    Hi!
    I'm trying to understand how to use the LODFade node.

    I'm creating a shader that needs to fade between lods using dithering. LODFade node returns 0 when i am near the object. Returns 1 when the fade start, back to 0 when i am away from it. I was expeting that it returns 1 when near the object and gradually fade to 0.
    What's the correct method to use that node in combination with the dithering node?

    Thanks :)
     
  14. StudioEvil

    StudioEvil

    Joined:
    Aug 28, 2013
    Posts:
    57
    Also, i think that the disappeaing pixels of the first lod, should be the appearing pixels of the second lod, during the fade phase.
     
  15. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,817
    unable to find compatible overloaded function "texCUBE(sampler2D, float3)"
    Code (CSharp):
    1.             float3 texArray91 = UnpackScaleNormal( UNITY_SAMPLE_TEX2DARRAY(_NormalM, float3(( uv_NormalM * temp_output_64_0 ), 0.0)  ) ,_Normal_Scale_1 );
    2.  
    Latest update from asset store

    Only happens when i use separate Texture Array for normal maps, but when i use albedo texture array as normal map, everything works fine
     
    Last edited: Oct 31, 2017
  16. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    157
    brisingre likes this.
  17. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    152
    Hello amplify paulo. I was really baffled when I read your post about how to make alpha blended materials that can receive shadows, as I thought it was nearly impossible to do in unity. I tried to do the manip you described but with no success. Do you think it would be possible to add an example shader in the example package that has an example of this technique?

    Seriously, I think that it could become a reason to buy the whole asset only for that for a lot of people! I was really surprised that there wasn't more showoff about it, IMO it's even more important that the POM features (which, don't misread me, are also really really impressive)!
     
  18. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    Now that you mention it I've had that issue before as well. I guess we need to revisit the UX because I'm not sure if the correct one has any keys left to do some sort of combo for that. But thx for the suggestion anyway.

    When you use lod fade keep in mind that both objects must have support for that lod fade (either by using the same material or two different ones that do the fading). The first represents the opacity of object, not how much close or far it is, so you use it to make your object disappear or reveal itself. What drives this is the lod group component so the shader has no notion of near and far. The issue tho, and probably why you are having troubles using it, is that by itself it does not work correctly outside the fading. Instead it will revert back to 0 and hiding your objects. You have three ways to solve this, in the first one you use an if node to check whether the value is 0 and if it it you set the opacity to 1. The second one, and probably the not that is most safe to use is to create a static node that uses unity's internal keyword for lod crossfade to make that correction yourself. This solution also requires you to use a custom pragma to tell the shader to compile with that keyword in mind (screen shot in attachment). The third one, and probably the simplest way of doing it is by going to the rendering options group and turning on the LOD group crossfade which will do all the heavy lifting to create the crossfade just like unity does. Use only the second solution if you need to do some custom behavior, like, if you want to use your own dithering pattern for example.

    Show me your graph setup or just share the shader, from the code I don't see anything wrong with it and I just did a quick test with texture array with normal maps and it seems to be working fine.

    Don't be surprised, it's not the best way to solve it anyway and that's why it doesn't deserve more credit. That way basically forces the dithering to kick in some situations and makes it look like everything is fine, truth is, you are still getting the typical transparency ordering issues and now the dithering somehow connects to the skybox (depth issues) and starts to show some artifacts when the skybox is behind it. So yeah, definitely not the best solution, more of a hack to be honest. Probably only usable indoors, not sure what other issues it might have to be honest.
     

    Attached Files:

    arnoob likes this.
  19. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,817
    From performance side, texture array is better or multiple tenures ?
    My terrain shader has not too much good performance with 16 texture samples using texture array
     
  20. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    The array should be better, but of course, sampling isn't cheap either when done multiple times. There might be a way for us to optimize that part, but no promises. I have to look if it's possible to reduce the number of samplers.

    Also you might consider looking if the problem is not the 16 sampling of texture but what you do with them afterwards.

    Share with us your shader (email it if you don't want to share it here) and I'll see what I can do with it.
     
    LightingBox2 likes this.
  21. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Hi there,

    First, just posting to say how awesome Amplify is! I love the included custom toon lighting example. I'm trying to adjust it slightly and I wonder if what I want to do is possible.

    I've adjusted the shader in the following ways:

    1. Removed the color node for the rim color that was multiplied by the light color. I want the rim color to pretty much be influenced by the exact lighting of the scene / lights hitting the object.
    2. Added a rim intensity fader to the light color multiplier to increase the strength of the RGBA values coming in.

    It does pretty much what I want it to do, however I would really like it if I could either do one of the following.

    1. Tell the rim lighting part of the shader to ignore the RGB values or intensity values from certain lights in the scene (I dont want them effecting the rim lighting at all)
    2. Or I guess, if this would work, remove any white light sources and just display anything else(obviously white light is just RGB at max, so I dont think this would actually do what I want)

    The end result would be:

    Multiple directional lights in the scene lighting my character (flood lighting if you will) but not influencing the rim lighting, with spot lights also casting their light onto the character, and having the spot lights color etc influence not only the lighting hitting the character, but also the rim lighting properties.

    Is this possible?
     
  22. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    Hi rekka!

    What are the lights you don't want to show up in Rim effect? Are they random? All of directional lights? The problem with your idea is that shaders don't have particular data about lights, more importantly the way shaders work the first light is always treated differently from the others, this "first light" is usually the main directional light. It seems you want to use multiple directional and point lights, this is fine but in order for the shader to do what you want it to do you have to create some kind of rule. For instance, if you say you want all directional lights with toon ramp and all point lights with rim light then in the shader you can "filter" point and directional lights to do just that. But if you want that any light can be treated either as a toon ramp or as a rim light how is supposed the shader to know which one is which? How do you want to tell your light "this is a rim light" and another one "this is toon ramp light".

    You need to make your decisions because they dictate how the shader is built. And some solutions are hard than others. If you simply want to differentiate between point light and directional lights you can use this node to get the results only when needed. If instead you want to arbitrarily say which light acts as a rim light you need to use some information about that light to do that or pass it yourself to the shader. For instance, you could make it so when the intensity of the light is a very specific value then it behaves differently, this is of course a hack in which you would lose some dynamism from that light, but maybe its a comprise you are willing to take.

    Either way, with more information I can give you more objective response.

    cheers
     
    rekka3000 likes this.
  23. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    33
    Hello, I have a little problem with tessellation shader and normals, why the tessellation sample look like this? and the same thing happen when i make my own tessellation shader.https://imgur.com/a/KPRZ1
     
  24. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Wow, awesome! Thank you for the detailed response.

    Actually it is exactly as you said, I want the the directional lights and the point lights with the toon ramp, and just the point lights with the rim light. Looking at the node you gave me I think I know how I can integrate that into the example toon code... I'll give it a try.


    Although, actually to be even more specific about what I would ideally want.

    1. Base toon shading on the character, exactly as you have made with the example.
    I'd turn off the rim lighting color value node and do as I did and have the color be influenced by just the spot lights. I guess I can filter the lights using that node you introduced me to.

    2. I'd have just the directional lights with the toon ramp.

    3. If possible, I'd like to mix the toon ramp / shader with the directional lights hitting it with another lighting shader (if thats the word?) which would keep the base toon look, but have a more realistic look to how the light hit the character on top of the base toon shader, more smooth falloff around the details of the model etc.

    The rim light with the toon ramp basically does the look that I want. However, any spot light that hits the character when its toon ramp shades too much of the mesh with that color and isnt realistic, but we still like the toon look.

    I've made the same character with a standard unity shader and the way the spot lights hit the character is more realistic, but thats obviously going to happen because its not a toon shader.


    To further explain what I'm doing;

    I'm the technical director at a holographic theater in Japan. We do a lot of anime content. If you've ever seen or heard of the Michael Jackson holographic concert, its like that but with anime! We have a real stage, with real lights on the stage all controlled by DMX (A way to send information to lights to tell them what color they should be, etc).

    With the help of another company I have created a plugin that will take that DMX information over ethernet and show it in Unity. I've created an identical stage / lighting set up in Unity, and the information from the lights on the real stage will be sent to Unity, and I'll be lighting the character in real time.

    Because its anime, we dont want the character to be too dark or have any crazy shadows, but we want absolute control over the look of the character, so I've created additional lights in Unity that dont exist on the real stage that can also be controlled by DMX (These lights are the directional lights).

    So basically the goal is:

    To show anime characters in holographic form in real time using Unity. The characters should be lit using several directional lights (although really, for the anime look just one is enough) The look should still be anime, but when the real lights and unity lights hit the character, the lighting should look realistic.

    The rim light does this job pretty well, but if I can improve on it even more, thats great!

    Sorry for the long explanation but I hope that helps you understand what i'm trying to do!
     
  25. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46

    Actually, looking at it im not entirely sure how I should go about integrating this into the shader..
     
  26. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    In short, it looks like that because the sample is trying to only show tessellation. When you change vertices around their normals don't change accordingly without any work, we decided to not change them so they remain flat and it looks like that. We even refrained from adding any normal map to make the effects obvious. Understandably, doesn't look very good with just that. I'll look into it to see if I can improve the visuals without increasing the complexity. Keep in mind we purposely provide some very simple examples (which sometimes are not the prettiest ones) for new users as a guiding point.

    [edit] you can look at out waving flag example to know how to reconstruct the normals

    That project seems pretty cool.. and complicated.
    Anyway.. I'm not sure exactly what you mean on your point #3 but is this what you want for the rest? (see attachment)

    About #3 we have a standard surface light node which mimics unity lighting in a custom lighting model, I'm not really sure if that is useful to you because like I said I'm not sure if I understand what you want but you can use that node and mix it with other effects, you can see the use of it in our double layer sample.
     

    Attached Files:

    Last edited: Nov 3, 2017
  27. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    33
    Yeah look very bad, thanks
     
  28. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We've just uploaded a new build into our website.
    Here are the release notes:
    Release Notes v1.3.5 dev 02:
    • New Tool:
      • Added Texture Array Creator tool
        • Available at Window > Amplify Shader Editor > Texture Array Creator
    • Fixes:
      • Fixed Undo not being able to recover some nodes
    • Improvements:
      • Changed Custom Material Inspector to be able to set and show custom meshes in it's Preview
      • Template Data nodes now expand individual channels if data selected is from vector/color type
      • Expanded individual channels ports on:
        • 'Object Space Light Dir'
        • 'World Space Light Dir'
        • 'World Space Camera Pos'
        • 'Position From Transform'
        • 'Vector From Matrix'

    Here's a sneak peak on the new Texture Array Creator tool:

    TextureArrayTool.png

    And on the new preview custom functionality:

    MeshPreview.png

    Both the new material preview options and the Texture Array creation tool are works in progress, they don't yet support all the intended features. Please report any issues you may find with them.

    We also had to rename some script files on this latest package. Since the Unity importer unfortunately does detect renamed files, we would advice on removing the previous package before importing this new one so all files are named correctly. We hate to have to make this kind of changes and ask you guys this but unfortunately it had to be done.

    We deeply apologize for the inconvenience.

    Hope you guys have an awesome weekend and happy shader creations!
     
    arnoob, petersx, KRGraphics and 3 others like this.
  29. Remer

    Remer

    Joined:
    Mar 24, 2013
    Posts:
    70
    I have updated my shader by inserting reflection, refraction and a snow effect on the edges, but I do not know how to combine it all. Suggestions?
     

    Attached Files:

  30. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    ISSUE with FRESNEL (Android).

    Does someone also expirience probs with the node "fresnel" which is connected onto "emission". I got this error only when targeting Android. So, after assigning this fresnel to an object, the complete object disapear. If i disconnect fresnel from emission, everything else works fine & the object displays correctly on my Android build...whats wrong there ?
     
  31. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Excellent, thank you.

    I’ll take a look at the example but I’ve already messed about with the double layer sample and I think it will do what I want, I’m not exactly sure about how best to blend the two layers though, I could use lerp but what would I use to accurately blend on the opacity input?

    Or maybe a blend node? I noticed some pretty cool ways to blend on that node but haven’t played with it yet.

    Also can you please help me with the light filtering node you mentioned? I see that the type output will display either 0 or 1 depending on the light, but I’m not sure how to take that info and do what I need... kind of a shader newbie I’m afraid

     
  32. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    271
    Hey,

    I've been using an overlay shader that was layered over my scene to give a Photoshop style tint, but now i'm trying to recreate the shader in ASE so that i can overlay a color over my _MainTex and tint it the same way, but i get a different result, i've tried the Blend Operations/Overlay node but it also gives a different result with very high contrast, some help recreating this in ASE so that i can tint my _MainTex with a _Color property would be appreciated.

    Here's the shader:

    Code (CSharp):
    1.  Shader "Photoshop/Overlay"
    2. {
    3.      Properties
    4.      {
    5.          _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    6.      }
    7.  
    8.      SubShader
    9.      {
    10.          Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    11.          ZWrite Off Lighting Off Cull Off Fog { Mode Off } Blend DstColor SrcColor
    12.          LOD 110
    13.    
    14.          Pass
    15.          {
    16.              CGPROGRAM
    17.              #pragma vertex vert_vct
    18.              #pragma fragment frag_mult
    19.              #pragma fragmentoption ARB_precision_hint_fastest
    20.              #include "UnityCG.cginc"
    21.              sampler2D _MainTex;
    22.              float4 _MainTex_ST;
    23.              struct vin_vct
    24.              {
    25.                  float4 vertex : POSITION;
    26.                  float4 color : COLOR;
    27.                  float2 texcoord : TEXCOORD0;
    28.              };
    29.              struct v2f_vct
    30.              {
    31.                  float4 vertex : POSITION;
    32.                  fixed4 color : COLOR;
    33.                  half2 texcoord : TEXCOORD0;
    34.              };
    35.              v2f_vct vert_vct(vin_vct v)
    36.              {
    37.                  v2f_vct o;
    38.                  o.vertex = UnityObjectToClipPos(v.vertex);
    39.                  o.color = v.color;
    40.                  o.texcoord = v.texcoord;
    41.                  return o;
    42.              }
    43.              float4 frag_mult(v2f_vct i) : COLOR
    44.              {
    45.                  float4 tex = tex2D(_MainTex, i.texcoord);
    46.            
    47.                  float4 final;          
    48.                  final.rgb = i.color.rgb * tex.rgb * 2;
    49.                  final.a = i.color.a * tex.a;
    50.                  return lerp(float4(0.5f,0.5f,0.5f,0.5f), final, final.a);
    51.              }
    52.              ENDCG
    53.          }
    54.      }
    55. }
    Oh and by the way, i did write a shader in ASE that got me the same results, but when used with a texture and a color property the result is slightly different as mentioned above, also using Grab Screen Color seemed unnecessary.

    Here's the ASE overlay:

    Overlay.png
     
    Last edited: Nov 4, 2017
  33. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Hey,

    Just to say that I’ve done some investigating and the rim light setting without any additional layer shading does exactly what I wanted!

    Also about 6 pages back there was a post about the toon shader and light filtering, that post helped me do what I needed with the directional light and now it’s great!

    Love this software!!
     
  34. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    143
    Hi, I think I have found a bug with the "Fog and Ambiant Light" node. If you put it with the ambiant light legacy in a simple custom light emission output, the shader will not react to a skybox ambiant light color for example. But it will react to "sky color" or "ambiant color", like if the node was set to "sky ambiant light".

    To make it short, here a custom lit shader is totally unable to get a skybox shader ambiant light color.



    Tested on unity 2017.2.0f3

    Best,

    Jonathan.
     
  35. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    143
    Oh ok I just realized by looking at the already made toon shader in the pack that things like light probes or ambiant light could be get with the "indirect diffuse light" node. (With Zero Normal, it's even better, I'm make a Breath Of The Wild shader style, that's why).
     
    arnoob likes this.
  36. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    157
    I'd like to use a texture array with a triplanar mapping. The triplanar sampler seems to not accept Texture array and it hasn't the controls like "index" like the texture array.
    Is it possible , at the moment, to combine the two nodes or not?

    Is it possible to develop the possibility to use them together?

    Thanks in advance
     
  37. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    Does the issue only shows up when connecting to emission? Does it needs additional nodes or just the fresnel node alone does the trick? Turning cast shadows option on or off make any difference? Send us one of those shaders which is not working and we'll compile it here to see what's wrong with it.

    Hey there!

    In your case I think the best way to do what you want is to use a template. When you use the generic surface shader there's a lot of additional stuff which doesn't really serves your purpose and only changes the result needlessly. We do provide one template for post process effects and I don't see a reason for it to not work, still, as a practice exercise I decided to create a template out of your shader. So in attachment you'll find two shaders, one is a template that you place somewhere safe on your project, ASE will detect this file as a template and will let your create other shaders out of it. The second shader is one that I created from that template and mimics what your shader was originally doing.

    Hope that helps, report back the results.

    Sorry for the late reply, glad you got it sorted out. You use the type of the light by multiplying the result, which will only show when the type is 1 (point lights). Was the shader I shared helpful in any way? The way I was filtering the light was by multiplying the result to the light type (or its inverse in case you want to filter directional lights instead) because multiplying anything by zero will return zero and multiplying by 1 will return the same value.

    That node gets unity built-in values for ambient lights, these are constant values that you set in your camera and lighting tab settings so they can never provide a full skybox with it's multiple colors. You are correct in your finding about the indirect light nodes, these do actually use the values provided by the GI which correctly return the skybox. We've also update that node documentation recently since were finishing the remaining nodes.

    No, you can't yet. I'll see if I can squeeze that into the next build. Similar to what it's done with the POM node. Sorry for the inconvenience :|
     

    Attached Files:

    marcatore likes this.
  38. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46

    Yes! Actually I used your sample as reference when I did it! Worked perfectly and I used the same method!

    For my final task for this shader, I want to adjust the outline. Ive applied it to a model and for the most part its great, toon parts work great and everyone is super happy (been trying to get this toon shader going for ages!!) but the outline is a little bit simple right now. There are places, especially around the mouth and nostril where we either want it to show up or not show up. In Maya I would make adjust the crease min and max angle to set at what angles two polygons should be at for the outline to show up, but that doesn't look like its possible out of the box here.

    Is there anyway for me to create this effect?
     
  39. Remer

    Remer

    Joined:
    Mar 24, 2013
    Posts:
    70
  40. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    Sorry, your case just takes longer so I decided to post pone your reply. I need to setup an environment with camera reflection to see how it's looking. I just need more time and I'm currently busy with some bugs and features. If you have a simple sample project with everything set up I can definitely help you faster. (support email in my signature)

    However, I don't think there a "correct" way of mixing the different effects, it's just a matter of taste tbh. In the double layer custom lighting sample I used a fresnel to mimic how real world reflection work, maybe that will work for you? You can take a look at it and see what we did it but in short you use a fresnel in the alpha value of a lerp node and you interpolate the reflection and the original surface values. This is just a quick suggestion without any testing.
     
  41. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,997
    Good morning guys, it's been a while since I posted here. Has anyone been able to create a double sided shader with correct lighting? I'm trying to replicate the double sided transmission shader from Alloy for vegetation and so far, setting CULL OFF is the only way.

    Also how close are we to being able to create a custom Skin Shader with the Editor? The closest to this is using translucency and that is still not enough for what I need.

    I love how fast this is coming along. :)
     
  42. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    I can tell you that we currently finishing the documentation (most probably today) and next comes the extra features for templates which should allow whatever you need for skin shader, so just be patient for a little longer.

    For double sided illumination you need to set up your normals correctly, you can do it by either using the face node or the switch by face node. Check links for a practical example. And of course you need to set you cull to off.
     
    KRGraphics likes this.
  43. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    271
    First of all i really appreciate the help, I had to download the most recent version of ASE for the shader to open and i'm getting some errors when opening "Overlay Test" in ASE:

    "
    NullReferenceException: Object reference not set to an instance of an object
    AmplifyShaderEditor.TemplateMasterNode.FetchCurrentTemplate () (at Assets/Plugins/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMasterNode.cs:63)
    AmplifyShaderEditor.TemplateMasterNode.OnNodeLayout (AmplifyShaderEditor.DrawInfo drawInfo) (at Assets/Plugins/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMasterNode.cs:263)
    AmplifyShaderEditor.ParentGraph.Draw (AmplifyShaderEditor.DrawInfo drawInfo) (at Assets/Plugins/AmplifyShaderEditor/Plugins/Editor/Graphs/ParentGraph.cs:877)
    AmplifyShaderEditor.AmplifyShaderEditorWindow.OnGUI () (at Assets/Plugins/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:4090)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation."

    "
    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[AmplifyShaderEditor.TemplateShaderPropertyData].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    AmplifyShaderEditor.TemplateShaderPropertyNode.SetPreviewInputs () (at Assets/Plugins/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateShaderPropertyNode.cs:191)
    AmplifyShaderEditor.ParentNode.RenderNodePreview () (at Assets/Plugins/AmplifyShaderEditor/Plugins/Editor/Nodes/ParentNode.cs:2903)
    AmplifyShaderEditor.AmplifyShaderEditorWindow.UpdateNodePreviewList () (at Assets/Plugins/AmplifyShaderEditor/Plugins/Editor/Menu/AmplifyShaderEditorWindow.cs:4635)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:109)"
     
  44. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    271
    Also about that template, the thing is i'm trying to use this in a surface shader i wrote that blends multiple rentertextures on a quad, in this shader i have my main rendertexture as _MainTex, i'm trying to overlay a color property over this texture to tint it, would the template method still be what you suggest i use?
     
  45. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    107
    Sorry for the late reply, i got caught in another project.

    Well at this point i dont know if im doing something wrong, i downloaded the latest version, opened the custom lighting example scene, recompile the shader as you said, but the indirect lighting is not in the objects using the toon shader, i noticed that this only happen using fully baked lights, in full GI or mixed the indirect lighting works fine (in mixed works because of the realtime GI), i dont know if this is the intended behavior or im missing something.

    Deactivating the lights in the scene, i can see the baked light maps in all the objects, except in the ones using toon shader.

    Shaded view with lights deactivated. (after baking) (mixed Lighting) upload_2017-11-6_18-12-7.png


    Baked Lightmap View:
    upload_2017-11-6_18-11-45.png


    Only baked Lighting (no GI):
    upload_2017-11-6_18-24-37.png
     
  46. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Hi Paulo.

    Here are my quick answers:
    Does the issue only shows up when connecting to emission? -- YES
    Does it needs additional nodes or just the fresnel node alone does the trick? -- NO, just the Fresnel-Node
    Turning cast shadows option on or off make any difference? -- Didn´t tryed it yet...

    In the meantime , i attached a pic, where you can see those connections.
     

    Attached Files:

  47. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,997
    Wow!! When did you guys add this?! That is awesome. And I will hold on a little longer... I still need to learn how to use templates to do stuff like the skin shader in Alloy with a bit more control over my diffuse bump
     
  48. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    295
    Uhm, there's definitely something wrong there, I went and downloaded the files from my own post to a clean project and I can reproduce the problem, sorry of the inconvenience, we'll check it out.

    Regarding your question, yes I would say that the template is your best solution but only because it's faster, you can still render it with a surface shader tho, you simply need to use an unlit surface shader that only has one pass by turning off most features. Example in attachment, it only multiplies a color to the maintex but you can you what you need with it.

    Ahhh I think I get it now, that's because that particular example is purposely set up in a way that gets completely dark when the lights are out. So it's not exactly an issue with the baking stuff. Still, refresh me again to what you want, do you just want that particular sample to have indirect light when there are no lights?

    There's also another thing I did to the light attenuation on purpose that maybe there are reasons against it. I actually set it black when there's no light while unity sets it white. It made sense to me that when there's no light you see nothing but maybe unity uses that to force indirect lighting to shine through? not sure, but I'm willing to change that if I find thats the case.

    Correct me if I'm wrong, does it work when you add dx11 to the rendering platforms?

    [edit] nevermind that, I just successfully compiled your shader to a galaxy s5 android 7 phone, perhaps your phone doesn't support that version of opengl? have you tried adding the rest of opengl rendering options?

    [edit2] update, are you perhaps using the gles3 api in your unity project? I suspect that either your project or your phone is using gles3 and since you only select gles2 it doesn't work, in the beginning I thought the issue was only about the editor (that's why I talked about dx11) but now I can confirm that I can break the shader if I purposely select gles3 in the project settings. You should add the remaining platforms in the shader, just tick gles3 and opengl 3/4 just in case and give it a go.
     

    Attached Files:

    Last edited: Nov 7, 2017
  49. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    271
    Yeah, i've converted a lot of shaders from Shaderforge to ASE so i'm getting pretty familiar with it by now, most of my sprite shaders are unlit shaders with most of the rendering options turned off, but i'm just unable to recreate that overlay effect as mentioned in my initial post, i understand what the template is but i need to recreate that effect in an unlit surface shader and for some reason i'm getting a slightly different result so i thought i'd ask for help, thanks for giving it a try though!
     
  50. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Hey,

    I know you’re probably rushed off your feet but any can you let me know if it’s possible to customise the outline more than the given options? I need a way to either set where the lines appear in the model (vertex color Black or white to set inner lines)before exporting the fbx or ideally a way to set the min / max crease angle.

    Also if possible a way to set the Line colour to be the original color from diffuse texture where the colour of the Outline will change depending on the color closest to it on the mesh (via diffuse texture)
     
unityunity