Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    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. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Hey!

    I'm afraid that's one of those features we can't toggle off.
     
  2. hufeng923

    hufeng923

    Joined:
    Jun 10, 2015
    Posts:
    8
    find a pbr lit Transparent mat bug in latest ASE: URP 12 buildin SSAO draw over the TransparentSurface upload_2021-12-22_15-28-31.png
     
    Last edited: Dec 22, 2021
  3. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    67
    Hi Amplify,

    I have an question to a problem, which I can't solve on my own.

    I have the newest version 1.8.9.033 on Unity 2020.3.24. My pipeline is URP.

    I want a lit shader, but it should ignore environment lighting. Also ignoring environment reflection.
    I created a Universal/PBR shader, connected some textures but then I'm stuck.

    When I use "Surface" a got the rendering options, where I can disable ambient light. But using URP these options disappear. I could imagine, that I have to set additional directives (under pass) for my shader... some "pragma noambient" magic, but to be honest: I have no idea, what to write in. Maybe someone can give me some help. In general, bringing the rendering options to urp would be nice.

    best regards
    Simeon
     
  4. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    That might be expected since the transparent shader does not write to depth, does a Shader Graph transparent shader not produce the same result?

    Hey there!

    This can indeed be confusing as those parameters changed a bit since Built-in on Unity's side, thankfully you can still do it in URP Lit shaders with a Static Switch which allows you to disable specific Shader Features.

    _SPECULARHIGHLIGHTS_OFF
    http://paste.amplify.pt/view/raw/a74e4bc0

    _ENVIRONMENTREFLECTIONS_OFFFF
    http://paste.amplify.pt/view/raw/4095910b

    Paste each link into your editor window; these nodes are already set to "Auto-Register" so you don't need to plug them into your graph.

    upload_2021-12-22_10-55-58.png

    For reference, the links above were created using our Share Button which allows you to share selected nodes with other users.

    upload_2021-12-22_10-58-35.png
     
  5. hufeng923

    hufeng923

    Joined:
    Jun 10, 2015
    Posts:
    8
    Shader Graph get correct result. I find out when is option enabled ASE have right result
    upload_2021-12-22_19-10-0.png
     
  6. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    67
    Thank you for your fast reply. I added these nodes (which is pretty easy), but still can't see an effect.

    Is there a documentation which lists these shader features? I could't find some.

    Your examples seem to turn off specular highlights and reflections... most important would be to turn off environment lightning. So that under Lighting->Environment->Environment Lightning the Intenstity slider does nothing, if the source is set to color and white.

    I duplicated your node and tested _ENVIRONMENTLIGHTING_OFF as property and custom name, but it didn't worked.
     
  7. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Ah sorry, misinterpreted your original post, you want something similar to the actual Ambient Toggle on ASE Surface Shaders. Unfortunately, that function(noambient) is not available, afawk, in URP.

    Apologies for the lack of details but references for this are a bit scattered, and somewhat lacking, on Unity Documentation and Forum Posts/Answers; it's not really specific to our editor.
     
  8. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    67
    Ok, thank you. Good to know, that I not oversee something easy. Then I'll have to find a workaround.

    edit some hours later: glad, that urp is so scriptable. my workaround is the following: I used a second camera (as overlay camera for the main) and set object and lights to an extra layer, also the masks. To also exclude ambient lightning I wrote a script, which saves the values of intensity or color at beginCameraRendering event, sets them 0 or black and then writes back endCameraRendering. works as expected.
    see here:
    https://docs.unity3d.com/ScriptReference/Rendering.RenderPipelineManager.html
     
    Last edited: Dec 22, 2021
  9. TyrusPeace

    TyrusPeace

    Joined:
    Jun 30, 2009
    Posts:
    37
    I've been having problems with point lights resulting in rectangular color through on objects when used with Amplify Shader Editor's Custom Lighting. I tried to drill down and fix the problem and realized it happens with the simplest possible custom lighting shader:
    amplify-customlights-test2.gif

    Default surface shader with the custom lighting model selected, running in the built-in render pipeline. Amplify Shader Editor 1.8.9r33, Unity 2019.4 LTS, happens in a fresh project with only ASE imported.

    Is this expected behavior? I don't see a way to handle point lighting separately in the shader, and there's nothing in this shader that should care about light attenuation any way.

    I'm poking at all of this to try and fix my game's ASE toon shader, which gets these rectangular halos if I have point lights in a bright area. It's as if point lights keep adding some light/color value which I don't have a handle on. This test definitely seems to confirm that suspicion.
     
    Last edited: Dec 29, 2021
  10. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    638
    The box projected cubemaps look distorted compared to the standard shader. I'm using custom lighting where I plug the "indirect specular light" node to get the reflections. How can I solve this?

    The above is the standard shader, the bottom one is ASE

    box project.jpg
     
  11. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Happy to know you found a workaround! URP may not offer some older options present in Built-in but it's definitely flexible.


    Hey there, sorry for your troubles but this is expected. That is the Unity provided value, lighting and shadow information is actually provided by the Attenuation node; which you'd normally multiply with the Light Color node to get the "correct" value.

    If you decide to tackle Custom Lighting in URP, keep in mind that you'll need to use the SRP Additional Light node. This is covered on this stream(LWRP used there, same for URP):
     
  12. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Hey there! Would it be possible to compare both on our end?

    Thanks!
     
  13. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,466
    I just made my own foliage nature shaders with amplify and I love the amplify editor so far. Somehow I managed to even fake branch bending on my own without having pivots and now I'm converting the shaders to URP but how do I make the shaders work with URP Deferred? When I switch the rendering in URP to deferred the models become invisible. I don't see any option to add deferred in the editor?
     
  14. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    You shouldn't need to do anything provided that you're using the latest ASE version with URP 12.x or higher. Reach out to us via support@amplify.pt with a shader sample, we'd be happy to have a look. Does depend on the shader, and shader type.
     
  15. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,466
    Thanks, I'll send an email as soon as I have some time, my shader types are the default URP lit one and they all seem to disappear on deferred rendering.

    Btw right now I have another question. Why isn't HDRP translucency affected by shadow? I tried both deferred and forward, made sure all the HDRP settings are on, and messed around with the diffusion profile. Results have been the same, it's not occluded by shadow and glows from the front too. If I try translucency or sub-surface it makes no difference. Did I miss something or is that this HDRP scattering works? If it is how do I go about making translucency in HDRP?

    HDRPmess_01.jpg hdrpmess_02.jpg
     
  16. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,466
  17. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
  18. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    905
    got projector project in backward ! what's i can do for fix that's thank's
     

    Attached Files:

  19. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Hey there, can you elaborate? Thanks!
     
  20. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,466
    No need, I figured that out too, it looks like, certain types of properties don't work in deferred. That's actually kind of annoying, is there any way to have the shader fallback somehow without me needing to make 2 different shaders? I'm making a foliage shader and the translucency option doesn't work in deferred so I'd like it to not read the translucency when I switch to deferred. I don't know if that's possible.
     
  21. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    905
    got projector inside sphere with inversed normal

    i make video maybie it's more easy too see what's happen

     
  22. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Do you have any type of falloff on the projector?

    Seems to work ok with it, but not without: http://files.amplify.pt/RT/2022/01/gLcEaQqzME.gif

    This could be specific to how projectors work.
     
  23. mjako64

    mjako64

    Joined:
    Feb 9, 2017
    Posts:
    7
    Hi again.

    I'm using the depth fade node to get this outline effect, which works great for the most part. My only issue is that having this shader in the scene doesn't automatically enable the depth texture on the camera, which in my game is turned off by default unless AO is enabled. Is there a flag in the rendering options or elsewhere that will do that for me without having to enable it via script?

    Thanks in advance!

    upload_2022-1-12_11-20-28.png
     
  24. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,466
    Never mind about the translucency when I switch to deferred, I figured out now, lol
     
  25. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    5
    Hey there!

    Unfortunately, Unity does not handle that automatically for you regardless of the shaders used, it really depends on your project. I should point out that this is not a requirement with Deferred rendering as Unity will always provide the required data there, only Forward rendering requires you to manually activate it.

    With the Universal Renderer you can just enable it in the URP Asset Parameters, along with the Opaque texture required for any effects that may use the Grab Color node.
     
  26. mjako64

    mjako64

    Joined:
    Feb 9, 2017
    Posts:
    7
    Ah okay, that makes sense. Thanks for the info!
     
    Amplify_Support likes this.
  27. Controller51

    Controller51

    Joined:
    Thursday
    Posts:
    1
    Hi Folks!

    I'm trying to create a a shader that supports GPU instancing. I can set my floats, ints to 'InstancedProperty' and If I debug my shader with "RenderDoc" I can see the GPUinctancing working. When I replaced the 'instancedProperty' with a texture sample there's no 'instancedProperty' type available and I guess the GPUinstancing is not working because the texture is a property type, right?!

    So my question is: How can I get GPUinstancing work with a texture? I don't need different textures for this shader so it would be okay to set the texture somwhow to 'const'...
     
  28. Amplify_Support

    Amplify_Support

    Joined:
    Jul 19, 2013
    Posts:
    5

    That's not possible AFAIK, check this post: https://forum.unity.com/threads/instance-of-texture.500408/#post-3255686

    I recommend looking into Texture Arrays(Texture Sample node) and Sampler States, both can be used with ASE.
     
    Last edited: Jan 14, 2022 at 8:08 PM
  29. cajphrase

    cajphrase

    Joined:
    Apr 24, 2021
    Posts:
    6

    This doesn't work for me. I get the following error (multiple times, once for each pass):

    Shader error in 'TerrainScatterASE': redefinition of '_AllInstancesTransformBuffer' at line 1083 (on d3d11)


    This generates the following after the #pragma's:
    Code (CSharp):
    1. #pragma multi_compile_instancing
    2. StructuredBuffer<float4x4> _AllInstancesTransformBuffer;
    And then this after the CBuffer:
    Code (CSharp):
    1.             UNITY_INSTANCING_BUFFER_START(TerrainScatterASE)
    2.                 UNITY_DEFINE_INSTANCED_PROP(float4x4, _AllInstancesTransformBuffer)
    3.             UNITY_INSTANCING_BUFFER_END(TerrainScatterASE)
    and finally this in the vertex shader:
    Code (CSharp):
    1. float4x4 _AllInstancesTransformBuffer_Instance = UNITY_ACCESS_INSTANCED_PROP(TerrainScatterASE,_AllInstancesTransformBuffer);
    Any help would be appreciated.
     
  30. Elfinnik159

    Elfinnik159

    Joined:
    Feb 24, 2013
    Posts:
    144
    Hello,
    I am trying to rotate an object in the shader as if it were a simple Transform,
    For example, I'm using the Rotate About Axis node for LocalVertexOffset.
    I duplicated the operation for LocalVertexNormal, and when I output VertexNormal to the color channel, I see the same result as if I rotated the object's Transform and output WorldSpace. This is what it should be.
    However, when I connect NormalMap, it looks terrible, as if the light falls in a very strange way. And even changing the value of the rotation angle only for LocalVertexNormal, I could not manually achieve the desired result.
    VertexOutput: absolute.
    I tried to just rotate each vertex by the transformation matrix (assigned from the script), but the result was the same.
    Please advise: how can I use NormalMap after modifying LocalVertexNormal (multiplication by transformation matrix)
    upload_2022-1-15_16-54-48.png upload_2022-1-15_16-58-9.png
    (I tried inverting the matrix but that didn't help)
    Without connecting NormalMap, no problems with normals are imperceptible

    The screenshot shows an attempt to rotate an object by 90 degrees. When rotated 180 degrees, the normals seem to be inverted (the Y channel seems to be)
    In fact, what I need in the end is to rotate the object by the matrix (from the script) and render it further as a regular Standard shader

    UPD:
    Okay, it looks like I found the problem: in addition to VertexNormal, you also need to modify VertexTangent. I added it manually to the shader and it looks like it works. But I don't understand how to set tangent value in ASE? I don't see such an output.
    Code (CSharp):
    1.             float4 ase_vertexTangent = v.tangent;
    2.             float4 appendResult67 = (ase_vertexTangent);
    3.             v.tangent = mul( MatrixInverse, appendResult67 );
     
    Last edited: Jan 15, 2022 at 2:45 PM
unityunity