Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our 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. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    upload_2019-3-23_18-13-38.png

    Try this for dithering.

    I had the same problem a year ago, couldn't figure out a good solution cause of the lacking of multipass so i went for edge cutout dithering but i had to get creative in the way i've implemented it. I'm obvioulsy not going for a realistic result here.
    That last Reg node goes into Opacity and this is the blend mode i'm using
    upload_2019-3-23_18-20-19.png
     
  2. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    https://github.com/gkjohnson/unity-dithered-transparency-shader

    I found this which is really nice, it includes a amplify shader node but the implementation doesn't seem right cause i can't search for the node.



    But this implementation would make it MUCH easier to use. The current option isn't clear imo XD

    Tried it myself and it seems really solid. (i had to copy and paste the node from the example given)
    upload_2019-3-23_14-15-46.png
    upload_2019-3-23_14-16-56.png

    I also get errors.

    upload_2019-3-23_14-19-12.png
     
  3. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Pretty cool... My challenge is all of my shaders are in the HDRP, and I am using Kajiya-Kay shading...
     
  4. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Pardon my ignorance, how's that preventing you to have cutout dithering?

    Anyway i found out there's one thing that makes hair more realistic than realistic reflections: softness. That's why i've stopped looking for the multipass solution once achieved my dithered one. Then i found out it's pretty much the same approach Rockstar used for hair and fur in RDR2.

    Break your shader a bit and give it a try :) i'm curious to see how this solution works on realistic made hair!
     
  5. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    I've found.
    The finalgbuffer must set into "additional surface options".
    Now, I've another problem.
    When I save the shader, I have this error
    "Surface shader final gbuffer function 'GBuffer' has 4 parameters; needs to have 6 at line 36".

    Actually I've found that the original shader has this
    Code (CSharp):
    1. void Gbuffer (Input IN, SurfaceOutputStandard o, inout half4 diffuse, inout half4 specSmoothness, inout half4 normal, inout half4 emission)
    while mine is
    Code (CSharp):
    1. void GBuffer( inout half4 diffuse , inout half4 specSmoothness , inout half4 normal , inout half4 emission )
    How is it possible to add the "Input IN, SurfaceOutputStandard o" ??

    Thanks in advance
     
  6. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458

    I'll have to have a play with dithering but without Temporal AA, it will look weird in movement
     
  7. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey! We've added this option as a request by other users, the Default Shadowcaster uses Unity's own shadow caster that is automatically created by the Surface Shader, while the Custom ASE Shadow Caster is our own current shadow caster that we use to correct a few issues regarding normal writting and to react properly to the Alpha Clip.


    Hello!

    1 - The Lit HDRP templates ( both Unity's and our own ) aren't ideal for sprites, it's recommended that you use the Sprite Templates instead.

    2 - You may use our Light nodes in both the HD and LW unlit templates to create your own custom lighting, but you might have to tweak the templates themselves depending on what you intend to create.



    Hey, it should be possible but you'll likely have to create a custom template with the ShadowCaster visible, could you share further details on what you intend to create so that we may be able to provide further information?

    Regarding the Debug port, since it doesn't take lighting into account when generating a preview shader, it's expected that certain nodes such as the Light ones will not produce the correct results.


    Hello, we don't officially support 2019 at this time, as it's still in Beta, but we're hoping to support it as it releases.

    Our HDRP template is currently compatible with versions 4.8.0 through 4.10.0, which are the latest available through Unity 2018.3.


    Hello, it should be possible to create something along those lines through ASE, did you come across any issues?


    Apologies for this, could you send the submission through support@amplify.pt, including the following:

    - Creator URL
    - Description
    - Download URL
    - Confirmation that you've read and agree with the submission terms.

    Thank you!


    Hello, could you please elaborate on what you're trying to accomplish?


    Hello, an additional depth pass would be necessary to deal with the sort of overlap that you see in your current model, which you've enabled in your last screenshot ( Extra Depth Pass ) and I believe that it might've solved this issue.

    As you're trying to use transparency together with shadows, please be aware that tweaking the settings available on the Standard shader might only take you so far, ideally, a custom solution would have to be written and implemented, as by default Unity provides no means of achieving this sort of effect without compromises.

    For such specific needs we provide the Shader Templates feature that allows the creation of custom shaders to handle specific requirements such as this one.

    Additionally, while it is possible to have a transparent object write on the zbuffer in order for it to handle shadows, its not possible to do it partially, meaning that the object will either receive the whole shadow information, or allow it all to go through. The intermediate solution that is present in Unity is to make use of dithering to fake this effect, but its only helpful in the casting of shadows, not the receiving.


    Hello, if you look inside the SimpleTerrainFirstPass shader you'll find a Custom Expression called SplatmapFinalColor, which is registered by the line in the Additional Surface Options in the Main Output node:





    I believe that you can base yourself on this to access the FinalGBuffer, as the procedure should be the same.
     
    Last edited: Apr 1, 2019
  8. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    506
    Thanks! Meanwhile, I tested my self. One of the users using Advanced Dynamic Shaders, reported that the custom shadow caster is not working properly in VR with single pass rendering and cutout. Using the default addshadow pragma fixed the issue.

    For now, I'll stick with the default one, I didn't see any issues so far. I'll test it also with post-processing, there are always problems with normal writing and animated shaders...

     
  9. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Thanks for the answers! Don't worry about it, there's too many things that i don't know about how unity and shaders work in general still so i'll try to figure out what i'm trying to accomplish really cause there's probably a better question about what i really need lol

    Here's one for instance, do we have a tutorial on how to inject and read code via a script by the shader? I gave it a look but i couldn't find it, this is cause a co-worker is trying to recreate a cool toon liquid in a container shader (of which you have an example as well) but physics based and he probably needs something like this to get it to work.
     
  10. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    So you don't think i can solve the transparency reading as black when compared to the skybox without a shader template?

    This is how it looks in the editor which is exactly what i want...
    upload_2019-3-25_10-32-30.png

    This is how it looks in the game view

    upload_2019-3-25_10-28-26.png
    upload_2019-3-25_10-28-50.png
    upload_2019-3-25_10-51-4.png
     
    Last edited: Mar 25, 2019
  11. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Can you try with Zwrite Mode on ?
     
  12. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    I'm not quite sure what you mean by inject and read code via a script by the shader, so I do apologize if my answer is completely misses the mark is not what you want.
    The way a c# script communicates with a shader is only through material properties. If you want a certain effect to be controlled via that script you need to have some parts of the shader dependent of property nodes (Float, Color, Vector, etc) and then set those via the the material.SetFloat/SetColor/SetVector/... methods.

    The problem is that, you are rendering your object on the Alpha Test (2450) + 1 render queue, and the skybox hasn't been drawn yet, thus a black color appears.
    Unity's own Skybox is rendered on a special render queue, after 2500 and before 2501, something like a 2500.5.
    So a possible solution is to add 51 to your Queue Index instead of 1.


    Also, we've just uploaded a new build into both our website and the Unity Asset Store.
    There were a couple versions we uploaded over the website and didn't announce here's the combined release notes of all of them.


    Release Notes v1.6.3 rev 06 - v1.6.4 rev 00:
    • Fixes:
      • 'Indirect Diffuse Light' node now works on the HD SRP templates
      • Fixed memory leak on closing ASE windows
      • Fixed port define issue with linked ports over template options (API)
      • Fixed loading issue on 'Reconstruct World Position From Depth' shader function
      • Added missing ase_frag_input tag on Lightweight Unlit SRP template
      • Fixed compiler issues when using 'Face' and 'Switch by Face' nodes on Vertex Ports
      • Nodes 'Face' and 'Switch by Face' now properly work over the HD Unlit template
        • Fixed issue on missing ase_frag_input tags over HD Unlit
      • Template Port Options can now be properly registered over SubShader (API)
      • Removed unnecessary code being used when on Custom Lighting
      • Fixed 'Light Color' node not being correctly reset when on subtractive lightmaps
        • Removed gi.light.color usage from Blinn Phong Light shader function as it was a temporary fix for the above
      • Fixed issues on 'Light Attenuation' node over Lightweight SRP
      • Removed incorrect N.L contribution
    • Improvements:
      • Minor tweak on Simple GPU Instancing sample for GPU Instancing behavior to be more evident
      • Standard Surface custom ASE shadow caster can now be turned off
        • Toggle on new 'Use Default Shadowcaster' option over Rendering Options group
    Happy shader creations!
     
  13. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Perfect answer cause the moment you said that i've realized how to do it ;) Thanks!
     
    Amplify_RnD_Rick likes this.
  14. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    Thank you it worked.

    Now I'm facing a new problem.
    I can't understand why if I set "blend mode" like this

    the shader will become like this
    Code (CSharp):
    1. Blend One Zero , SrcAlpha OneMinusSrcAlpha
    What I'd like to achieve should be
    Code (CSharp):
    1. Blend SrcAlpha OneMinusSrcAlpha
    What am I missing?

    I have another question.
    Is it possible with ASE to have 2 CGPROGRAM in one shader file?
     
    Last edited: Mar 25, 2019
  15. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    @Amplify_RnD_Rick

    how do i merge mask ... see image, i like to drag my quad towards the other quad, then somehow they will merge together? If you want, i can pm you the shader file merging.png merged_circles.jpg
     
  16. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    You'll need to set the Blend RGB to Alpha Blend and the Blend Alpha to OFF to get the Blend SrcAlpha OneMinusSrcAlpha.

    Regarding your other question, if you create a multipass shader you may you may have one CGPROGRAM per shader pass.


    Hey there, I could suggest attempting to use stencil or transparency with blending modes, as two means of achieving this effect, although additional scripting outside of the shader would always be required in order to deal with occurrences such as detecting when different areas collide and what to do or how to behave in each possible situation.

    Here's an interesting reference: https://mispy.me/unity-alpha-blending-overlap/
     
  17. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    Hi guys, I'm having a weird issue with the billboard node, and I'm not sure if I'm doing something wrong or if its a bug.

    I'm using the billboard node connected to the offset port in the Sprite template.

    It works as expected here:
    why1.gif

    Also works perfectly in the game camera.

    But, when I duplicate the gameobject, it stops working. All gameobjects renders seems to be displaced with nosense over the view:
    why2.gif


    It also happens on game camera and in runtime, when I instantiate new gameobjects using the original sprite.


    Am I doing something wrong or it is a bug? (I'm using v1.6.3 rev 01 from Asset Store)

    Thank you guys.
     
    Last edited: Mar 27, 2019
  18. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    506
    Maybe your objects are dynamically batched. Try setting the Disable Batching to True:
    upload_2019-3-28_19-34-53.png
     
    Suzuka91 likes this.
  19. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
    Oh, yes!
    Thanks a lot for the response, @BOXOPHOBIC, it worked! :)
     
  20. Suzuka91

    Suzuka91

    Joined:
    May 7, 2014
    Posts:
    39
  21. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    506
    That shader is not working for me, I replicated it in ASE, the result is the same.
    I'm also interested in why it is not working... Here is the shader if you want to play with it.
     

    Attached Files:

  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    So I finally update everything in my Unity project and unfortunately, I met with a blank scene :(

    upload_2019-3-31_9-46-19.png

    And a BUNCH of errors...

    I also updated my Core RP and HDRP to 4 10... I have a feeling my GPU is not up to the task.
     
    Last edited: Mar 31, 2019
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    UPDATE: Everything is working again... just had to carefully reimport everything.
     
  24. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    upload_2019-3-31_22-59-22.png

    So I have now gotten back into hair authoring and getting ready to try out the dithering method by @HitsuSan on more realistically authored hair... one of the issues I am already seeing is the lack of shadows and forcing me to redo my hairs...

    upload_2019-3-31_23-1-24.png

    This is the original shader with ZWrite OFF and notice how it looks very natural... but missing the depth...

    upload_2019-3-31_23-2-28.png

    And I can't get AlphaTest to work even though it is turned on in the shader.


    Now does the new version of ASE support refractions?
     
  25. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    For those type of hair you might want to try Airship images hair technique, by adding an opaque base of the hair and use alpha blend for flyaway hairs.
    airship-images.com/division-hair-breakdown/
     
    KRGraphics likes this.
  26. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    506
    @Amplify_Borba /*ase_pragma*/ is missing from the PPS template. I got the error when I tried to connect the reconstruct wpos from depth function.

    Anyone knows, are there any keywords that can be used to detect the current render pipeline?
     
  27. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    @Suzuka91 @BOXOPHOBIC
    Batching is quite a pain in some situations. Since all meshes are batched on a single one, its pivot point changes to one shared across all of them and things like that happen.

    I would really recommend stop using batching and start using GPU Instancing, as you'll have the same benefits and none of these problems.

    @KRGraphics
    Unfortunately we do also have some similar issues working with the SRP packages, but these are conflicts between the packages themselves. We do need to sometimes have to clean the projects cache and reimport the packages for the issues to go away.
    This particular situation is not related to ASE so there'e not much we can do.

    Regarding your question, yes on our HD Lit template we do support Unity own refraction approach.
    On that particular template you'll notice an Additional Options group over the Node Properties. Inside that group you'll see a Refraction Model dropdown from which you can select what type of refraction model you do want.

    You can check our official sample SRP HD Lit Refraction ( Examples > Official > SRP HD Lit Refraction ) for a example on ow to use.


    @BOXOPHOBIC
    Thank you so much for catching and reporting this issue over the PPS template. Expect a new build today with it fixed.

    Regarding your question about the keywords, I'm not 100% sure but I really don't think there are.
    The shaders for each pipeline are quite different, having to include completely different libraries.You also need specify the SRP to use over the SubShader RenderPipeline tag itself.
    As keywords are a limited resource, I not seeing the Unity guys spending one for that.

    EDIT: Already uploaded a new build into our website with a fix to the issue reported by BOXOPHOBIC.
     
    Last edited: Apr 1, 2019
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I would have to remodel the hairs... which is cool... and the method I do for hair is a hair cap to grow hair from realistically, and brush it into place. And then the hair textures are done with CG hair.
     
    Last edited: Apr 1, 2019
  29. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    And it's to my understanding, depth support was added to Unity as well, which I need to get working for hair...
     
  30. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    506
    Thanks! I was just curious, for instance, if I want to create a post-processing shader that supports all render pipelines, in some cases I need to use different functions to get a specific texture, matrix, etc. But I guess I can create the shader for each pipeline and then select it in the post process script, based on the current render pipeline. I'm not sure that it would work, I'll need to try it out...
     
  31. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    upload_2019-4-2_18-25-58.png

    upload_2019-4-2_18-26-56.png

    So I tried to get the dithered hair like @HitsuSan and unfortunately, my hair shader pinks out... and this is in the HDRP..

    I also get an error in the graph when I try to use the noise pattern in the shader...

    upload_2019-4-2_18-32-59.png
     
    Last edited: Apr 2, 2019
  32. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hey there, the error you've shared is due to the Dither node with its Pattern parameter set to Noise Texture not receiving the correct data that it expects, it requires a Texture Object connected to its Pattern input port.
     
  33. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    Hi @Amplify_Borba
    i have a problem for my transparency issue.
    The editor & Build mode gave me like an opacity mask
    Game view just looks soo weird
    However when i click play into play mode, this was what i need.

    2nd image is the shader
    HELP...
    problem1.png
     

    Attached Files:

  34. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello! I would first try to tweak the Blend Mode settings in the shader and add a Saturate node right before the Opacity port, so that the value range stays between the expected 0 to 1 range.

    If the above doesn't help, please share a simple sample project with the issue present to support@amplify.pt for us to be able to debug the issue using the exact same data as you.
     
  35. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    I would first try to tweak the Blend Mode settings in the output node parameters, and add a Saturate node right before the Opacity port, so that the value range stays between the expected 0 to 1 range.

    If the above doesn't help, please share a simple sample project with the issue present to support@amplify.pt for us to be able to debug the issue using the exact same data as you.
     
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Ooooooh... let me fix it now
     
  37. NakoRinn

    NakoRinn

    Joined:
    Jul 17, 2018
    Posts:
    15
    Hello , I need help with my shader.
    I connect this nodes to albedo input for depth checking.
    upload_2019-4-3_16-46-29.png
    And its work fine , terrain contact areas are visible as black.
    upload_2019-4-3_16-48-49.png
    But after adding the vertex displacement for waves simulation , I got async with current vertex position and depth value.
    Depth calculated from flat plane based on default vertex positions.
    You can check it on this gif :
    https://gph.is/g/ZxVbe6E

    At final I need check depth based on current vertex offset position , for correctly foam displaying.
    Are its possible with amplify ?
    Using the "Lightweight PBR" shader type
     

    Attached Files:

  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    upload_2019-4-3_10-14-55.png

    Here is my hair with dithering applied... looks kinda weird up close but I love how realistic and natural the hair feels... I will have to have to do a new texture for the scalp to hide some issues I am running into...

    upload_2019-4-3_10-31-23.png

    Here is the final result with my hair... with TAA on... I will have to tweak the hair settings to avoid the jittered looks
     
    Last edited: Apr 3, 2019
    HitsuSan likes this.
  39. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    It's probably too strong, tweak it a little bit! Also different noise resolution will get you different results (on the lower side)
     
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I just created a 256 noise map just to see how it looks... and it looks LOVELY. I also changed some parameters to make the hair feel more natural to my eyes. The final step is shadows, which DON'T cast :'(

    upload_2019-4-3_11-6-59.png
     
    HitsuSan likes this.
  41. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Looks pretty awesome and i know it looks even better in movement so i can imagine. Can't wait to see how it looks once shadows are in now ;)
     
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    WOW!!! I didn't even have shadows enabled on my lights... in HDRP, you have to turn them on since they aren't on by default... would be nice to get the characters to self shadow :)

    upload_2019-4-3_11-50-8.png
     

    Attached Files:

    Amplify_Borba and HitsuSan like this.
  43. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    19
    Hi, I'm trying to figure out how to get Projectors to respect Cutout shaders.

    In the image I've made a cloud shadow projection shader which looks decent over all opaque geometry, however when it meets a cutout shader, it projects onto the geometry (billboard/quad) without taking the alpha cutout into account. I haven't been able to find a blend mode which works for this.

    Any help would be much appreciated!
     

    Attached Files:

  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I think I have found a cleaner way to create shaders using Local Vars... I might go back and tweak my SSS shader for better control. Would it be possible to create a shader that supports animated wrinkles? I might run into an interpolation issue however.
     
  45. HitsuSan

    HitsuSan

    Joined:
    Sep 28, 2014
    Posts:
    158
    Possible ofc, all you need is a wrinkle map and sliders. The challenge is to make it work with just one additional mask map :p Have fun!
     
    KRGraphics likes this.
  46. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I was afraid of that... and I would have to break it up into different zones of the face...
     
    HitsuSan likes this.
  47. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Hello.

    Is there a way to make a part of shader grath a method, similar to custom expression? Currently, even with register local variable or function, entire graph code is generated in 1 block.

    Sometimes, separate parts of a shader should be execute only in certain cases, using compare node is doing the job. But, the problem is that the calculations are done for both cases.

    If there is no such node, how would you do following:
    Suppose we have 16 samplers, and you need to sample in some conditions case first 8 textures and in other condition other 8 textures. Currently resulting shader will sample all 16 before doing conditional node.

    Hope it's clear enough :)
    Thanks.
     
  48. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    I'm re-tooling our picture widget UI shader and one of the changes the artist wants is to add a slight vignette to the graphics. The problem is the pictures are masked and I'm not really sure if it's even possible to map the vignette to the actual displayed quad instead of the the "real" one.

    Here's what I mean (mask disabled on the bottom one):
    masks.png

    and the vignette section for good measure (pretty straight forward):
    shader.png

    Ideas? Is it even possible?

    Thanks.
     
  49. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, there are several ways to achieve a foam effect through ASE, so it will ultimately depend on how you want to implement the effect. We have a few samples that make use of the depth buffer, such as the ones you can find in the LowPolyWater, SimpleTerrain ( SimpleTerrainWater ) and Water folders that you can check out.

    In regards to your shader, I would have to examine the full shader or a sample in order to provide further insight in regards to it. I can confirm that it's expected for the values to be incorrect if you perform a vertex offset operation in your shader, but in that case you might be able to inject the final position of the vertices in either the depth fade or the surface depth so that the final value is correct.


    Hi, we suspect that this issue might be related to the one described in this post, in any case, can you please share a sample through support@amplify.pt, so that we can look into it?


    Hello, I apologize but I'm not quite understanding what you're trying to achieve, could you please elaborate further?
     
  50. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    Sorry about that.

    I have a UI shader for an image, that's inside a RectMask2D. I'm trying to apply a vignette to the image, but to the actual masked part of the image, not the entire image as a whole.

    If I use an vignette mask like this (for example):
    vignette.png

    The result is this (left: mask on, right: mask off)
    masks2.png

    You can see the vignette effect is applied globally to the image, not mapped to the actual result after the mask is applied.

    Ideally the result would look something like this :
    result.png

    My gut is telling me there's no way to apply the vignette to the result after masking but perhaps I'm missing something.

    Thanks.