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

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    What makes lerps slow? Isn't it essentially just (weight*a) + ((1-weight)*b)? And are there any other reasons not to use static switches too often other than the keyword limit? Would it make sense to e. g. use a static switch to save on a single lerp or two if the shader draws ~a quarter of the screen pixels?

    Hopefully with the HDR pipeline. How much have you guys looked into that already?
     
  2. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    The Lerp operation itself is not that expensive or complex, but when overused it might be detrimental to performance, in any case it really depends on the complexity of the node networks connected to any give Lerp Node.


    Lerp doesn't involve recompiling the shader code. Static Switches, however, require that you compile the code every time you toggle it when using the Feature Mode, while the Multi Compile Mode has to compile multiple variations of your shader code, depending on its complexity.


    It depends on whether or not you need to change the actual draw size, as well as the complexity of any other operations involved. However, if you need to change the interpolation value between two inputs in regards to the draw size example you mentioned at runtime, then the Lerp node is the ideal choice.


    Regarding your last question, its actually possible with the actual Render Pipeline, and some users have already implemented their own technique. In regards to the new SRP ( HD and LW ), our editor will support the creation of compatible shaders soon.

    Please let me know if you have any follow up questions, thanks!
     
    EgoJacky, olix4242 and one_one like this.
  3. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I see. To make the example more concrete: I colorise (via multiplication) the albedo based on up to 4 masks stored in the channels in a texture. In this case, saving on a few single lerp operations via static switch is most likely not a reasonable thing to do (targetting desktop), right?

    I was rather talking about unity planning to have a skin shader built-in with the HD pipeline, so I was thinking that hopefully we could at some point also base ASE shaders on that, too. And great to hear you're that far already!

    And a somewhat related question: If no texture is assigned to a sampler, does it still have the same performance implications or is more like a color property?
     
  4. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    For that specific purpose, I suppose Lerp nodes would be acceptable. Think of static switches as something reserved for complex operations or when dealing with specific platform requirements, for example, disabling soft particles in mobile.

    Texture samplers have "Default Texture" parameter, meaning that even if you assign no texture to them, they will default to the selected fallback texture, so they have the same impact in performance since they're performing a fetch operation.
    To be clear, a shader's performance depends on the operations it performs, not on the assigned content.
     
  5. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I see, I'm just trying to get a feel for where 'complex' starts (not talking about clear cut issues such as a toggle for translucency.)

    Ah, fair enough, I was wondering if there may be some internal optimizations going on. But from what I understood, it's generally desirable to keep the amount of texture samplers to a minimum to avoid fetches (as these can at times take longer than a few simple operations)?

    I'm mainly wondering about tradeoffs here, static switch vs. 1 sample, 2 samples..? I mean I understand that for ideal performance during runtime, all unnecessary operations could be completely skipped via shader variations/static switches, but that would lead to unreasonable compile times. I'm looking at a sort of multi-use uber shader; I find it hard to decide how much should be statically switched and for how much it's okay to sample and lerp/toggle to 0 if it's not needed.
     
    Last edited: Feb 24, 2018
  6. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    160
    I'm quite interested about the number of texture samplers and performance.
    Speaking about this, when I use 1 texture sampler and then I create, for example, 10 other texture samplers using the reference to the first one...Unity consider this as 1 texture sampler or like 11 texture samplers?

    Thanks in advance
     
  7. wherewolfjohnson

    wherewolfjohnson

    Joined:
    Jan 20, 2016
    Posts:
    6
    I have a question, can I make a reverse rim light shader? I would like to darken the edges instead of lightening them, maybe with a multiply or soft light.
     
  8. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Hey guys,

    So I took a look at the Sobel effect and it doesn't really do what I want to the best quality, so I decided to look around for other examples and stumbled upon this:

    https://forums.unrealengine.com/dev...g/121539-edge-detection-postprocess-feedbacks

    The results look pretty good and if this was made in Amplify I could then modify it further. I took a look at the node map he posted and made it as best I could but I just can't get it to look correct.

    Attached a zip file with 6 files;

    - Scene file
    - Post Process Script for the Camera
    - Edge Detect shader
    - Convolve Texture Shader Function
    - Normal Depth Combine Shader Function
    - Sample Texture Neighbour UV Shader Function

    End result is a black screen. Anybody able to take a look at what I made and the link above and figure out what I did wrong? I think its something to do with the incoming normal / depth nodes..
     

    Attached Files:

    Last edited: Feb 25, 2018
  9. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    I want to make a custom node that injects a function and a #pragma line to a shader.
    Adding this from a normal node is not a problem but I would like a node with no input and output, Just add it to the shader graph with no connections and it will add some custom code.

    what I am trying to do is add
    Code (csharp):
    1.  
    2. #pragma instancing_options procedural:setup
    3.  
    and inject the setup function the pragma needed for my instanced indirect support.

    Is this possible?

    Lennart
     
  10. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    106
    Hi, I need some help here. I always get a shader error everytime I trying to build standlone build, but I not sure how to fix it


    Target Platform: PC and DirectX 11 only

    Unity 5.6.5p2
    Amplify Version: Latest
     

    Attached Files:

  11. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    I'm wondering if anyone can help me work out how to do the following in a shader.

    I want to grab everything of a certain RGB value in a texture and convert it into a white/black mask, where white is that RGB value, and everything else is black.

    I want to do this so I can have a greyscale mask in just the red channel of a TGA, and create multiple black/white masks out of that greyscale mask. Image below to hopefully clearly explain the result I want.

    Mask_ASE.png


    I found the "Compare" node and thought maybe I could use this, by comparing the texture to a value and then outputting true or false, and using this as a mask. However, I both couldn't seem to get this node to function as I expected, and I'm not even sure it would even give me the result I need.
     
    alienorbit likes this.
  12. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
  13. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    You are correct, not to mention that depending on the Shader Model being used you'll be limited on the amount of Shader Samplers you can use on each shader.

    Regarding the tradeoffs, despite there being a few rules of thumb when it comes to shader optimization, and I would recommend looking into the GPU Gems series for in-depth information regarding this, the best bet would be to benchmark your shader via the following tools: AMD's Shader Analyzer, RenderDoc and GPUOpen, as it can be hard to predict how certain operations would perform under different shader types.


    If you need to sample the same texture more than once, it would be optimal to have one Texture Sample node to fetch the required texture, then set up the required amount of Texture Samples referencing the first one, as they will all make use of the same texture property, instead of sampling each texture individually.


    It really depends on how it's currently setup in your shader but it should be possible. Which shader type are your currently using? I recommend looking into the CustomLightingToon as it provides a basic Custom Lighting example with a simple Rim effect.


    That's an awesome effect! Can you tell us a bit more about any differences/issues you found while converting that shader? I'm not entirely sure where to start but we would be happy to help if we can!


    Hello Lennart, unfortunately, what you intend to do is not fully possible but we might be able to Autoregister it in the future as we do with property nodes. For now, the only viable option is use your own Template or cginc.


    Hello, unfortunately this error is related to a know Unity related issue, you can find more information in the following Issue Tracker post: https://issuetracker.unity3d.com/is...lerunity-lightmap-error-with-specific-shaders.

    As specified in that issue ticket, a possible workaround would be to set Shader Stripping -> Lightmap Modes to Automatic, and later on updating to a version that has implemented a fix for this.


    Coincidentally, we've been having a recent discussion in our own ASE forum regarding this, please take a look into the thread for more information and check the attached samples as well, hopefully they'll help you out!
     
    Last edited: Feb 26, 2018
  14. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Thanks.

    I have it working with a custom include file and 2 added pragmas but it is a bit of extra work for users to understand this. Also copying the cginc file to the correct folder.... All this automatic with adding a node would be way better:)
    Is the auto register functionality far in the future?

    I am some other custom nodes now to support for some shader features in Vegetation Studio. I want to make it as easy as possible for users to use them in shaders. I like the node system was easy to set up some custom functionality.

    In the image i am using a custom node that adds touch/bend functionality to grass/plant shaders.

     
  15. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Just took a look, doesn't seem to be what I'm looking for but thanks. :)

    Haha that's weird, probably should've checked there first. Will take a look at the examples shared there. Thanks.
     
  16. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Edit: Added one more point...


    Well all I get is a black screen with the post process attached to the camera, the thing I couldn't replicate exactly was this;
    https://imgur.com/a/MG9ab

    1. Getting world normals texture and converting it to view space.
    2. Getting depth buffer texture
    3. 1e+04, I guess means 10,000?
    4. I cant figure out what the red node here is: https://imgur.com/a/MG9ab and how to get the "invsize" from it. Googling tells me that invsize is the inverse of the texelsize so i thought maybe the variable function Texel size node and than inverting it would work but not entirely sure.
    5. The example they gave is in the "Emissive color" slot but the post process effect template doesnt have that option. What should I do?

    For depth, I tried using the decode depth node but got a black screen, and the screen depth node gave compile errors.
    For the world normals I used the world normals node and multiplied it with the world to camera conversion matrix node.
    For the 1e+04 problem I just put in 1e+04 and it came up with 10,000

    Could you take a look at the "Normal Depth Combine Shader Function" I provided in the zip and this image:

    http://i.imgur.com/xuVdkmL.png

    and tell me what im doing wrong?
     
    Last edited: Feb 26, 2018
  17. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Although there's no official date for the auto register functionality, I'll register your interest and pass this information along to the developers.

    It would be great to see support for your awesome pack, looking forward to it!


    Thank you for providing additional information! Unfortunately, the ASE developers won't be able to examine this as they're currently overloaded, we're getting ready for a major Unity 2018 update and offer our deepest apologies for the inconvenience.

    As soon as we have the chance, we'll be glad to examine the original content you've provided, along with the supplied information which will certainly prove useful.
     
    Rowlan likes this.
  18. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    No problem at all, take your time and thanks to you and all staff for providing such excellent support! It's not important for a few more weeks and ill keep looking into it myself too. :) Please let me know when you guys do get a chance to look at it though, would be another great example to have in the package I think.
     
  19. alienorbit

    alienorbit

    Joined:
    May 1, 2013
    Posts:
    51
    You're in luck - we just solved specific issue yesterday with help in the Amplify forum!

    I can send you the code shortly, I hope, but really need to solve this other issue - maybe you can help? ;)
    It is a GPU error which i believe is unrelated, which is causing all my texture samplers to turn pink!

    "Shader warning in 'Hidden/SamplerNode': Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)"

    This happens now for ANY Amplify Shader Editor shader during the editing.

    Any Thoughts?

     
  20. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Ahh cool, just been looking at that thread. I managed to create something myself using the examples shared there. I seem to have almost gotten the result I desire, but I still seem to be getting artifacts in my masks, and I seem to get more artifacts the more masking steps I do. I can avoid this by adding enough padding to my texture but I'd like to know why I get artifacts. Would be interesting in seeing your approach.

    I've attached a unity package.

    One strange part about my shader is the value I'm using to decide the range of grey values I'm reading. I expected this value to increase evenly, where I could just add the same amount on each time to get the next range of colours, but this value seems to get more abitrary as the masking goes on. (See the "Add" nodes for these values).
     

    Attached Files:

  21. alienorbit

    alienorbit

    Joined:
    May 1, 2013
    Posts:
    51
    One thing to keep in mind: if you are using these masks for "Transparent Cutout", you must make sure the masks have absolutely no smooth edges / anti-aliasing - I use the *pencil* tool in Photoshop to make sure. Also, you need to disable mipmapping, choose a nearest neighbor resize method, or create your own specific mipmaps to ensure you don't get fringes.

    I will check out your shader, and post my own soon - as I finally just solved my (stupid) TextureSample issue (it was giving error because WebGL doesnt support DirectX11, and I had tested an export).
     
  22. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    106
    The fix doesn't work on my case. Do you have any idea which potential node cause the error?
     
  23. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    106
    Well, seem like I found a workaround by disable Directional Lightmaps in Rendering Options. It not going to affect my object, since the object that using that shader is dynamic object
     
  24. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39
    Hey! I'm just using it in the albedo on an opaque shader. My mask has no smooth edges/anti-aliasing either (it's just rectangles with padding). I'll check out those other settings though, thanks! What is disabling mipmapping doing in this situation?
     
    Last edited: Feb 27, 2018
  25. alienorbit

    alienorbit

    Joined:
    May 1, 2013
    Posts:
    51
    It's preventing the texture from being scaled to smaller sizes, which can introduce anti-aliasing on the edges. As we are defining a *specific* range of brightness levels to determine the are to be affected, any anti-aliasing / smoothing between white and black through re-sizing, or anti-aliased text or shapes, will add pixels with a range of brightness values from 0-255 (that's where the fringing comes from). In my example on the Amplify forum, I purposely left the smooth edges, to demonstrate this.

     
  26. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you for understanding, we'll definitely look into your situation as soon as possible, and we do agree that it would be a great sample for the package!


    Thanks for reporting back on your findings! Even though you can use ASE to create WebGL compatible shaders, we can't guarantee that they will work as expected as you may run into version specific Browser or Unity issues.


    Glad to know you found a workaround for this situation, thank you for sharing it with us!
     
    alienorbit likes this.
  27. Barada

    Barada

    Joined:
    Apr 27, 2015
    Posts:
    99
    I`ve been using ASE for a while now, and i must thank you guys for opening up everything with the use of templates and shader functions. as an artist i`ve found moving into shaders any further than via node based editors, very daunting. After finally biting the bullet last week and with some fantastic source material from shadertoy.com i`m finally getting to where my project needs to be.


    as some will see this isnt all my own work as it is quite recognisable to shadertoy visitors.
    The next stage is adding to this and refining via nodes to produce the final result.

    while developing this shader i have noticed that on some occasions all my auto registered property variables will sometimes... not auto register, and their tick boxes empty. Its just a matter of seeing the shader doesnt compile correctly and rechecking all the boxes. not a big problem, just a minor chore.
     
    alienorbit and brisingre like this.
  28. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for your support and kind words!

    Would it be possible for you to share a sample with the issue present privately through support@amplify.pt, so that we can examine the shader and debug it on our side? We would be glad to assist, and the sample would greatly speed up our resolve.

    Thanks!
     
  29. alienorbit

    alienorbit

    Joined:
    May 1, 2013
    Posts:
    51
    Actually, this issue needs to be considered ANY time you are extracting a mask from an anti-aliased image. Because the smoothing crosses the entire brightness range from 0 to the main brightness of the specific mask, it will leave artifacts, unless the result is carefully considered.
     
  30. alienorbit

    alienorbit

    Joined:
    May 1, 2013
    Posts:
    51
    Here is our near-final Node Graph. 16 of these groups get multiplied together to create both the transparency cutout and a color fringe around the edges of it...

    upload_2018-2-28_1-28-57.png
     
  31. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Are you so sampler or memory limited that using different texture channels are a no go?
     
  32. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you so much for sharing your node setup with the community! Have you considered using Shader Functions for node setups that need to be re-used throughout your shaders?


    Using individual channels would also be a viable option to reduce the number of Texture Sample nodes needed.
     
  33. sazberryftw

    sazberryftw

    Joined:
    Dec 12, 2016
    Posts:
    39

    Thanks for the info about mipmapping. I have also shared my shader with you on your Amplify thread. :)
     
    Amplify_Ricardo likes this.
  34. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    129
    Hello,

    could you make downloading new versions from the website easier? Having to look up and input the serial number every time is really cumbersome. :(

    Otherwise, I am really loving the tool!
     
  35. Amplify_Ricardo

    Amplify_Ricardo

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

    Apologies for any inconvenience caused, hopefully we can provide some sort of account/login based option in the future.

    Thank you for using ASE!
     
  36. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    509
    Hello again,

    I found a bug in the latest version, not sure if it worked in the previous ones. I try to use Screen Space Reflection with a custom Standard light model, but the normal and smoothness deferred passes are black, so the reflection is gone:
    upload_2018-3-1_10-31-6.png

    if I switch to the standard light model, everything is fine:
    upload_2018-3-1_10-33-29.png

    Thanks !
     
  37. Kriszo91

    Kriszo91

    Joined:
    Mar 26, 2015
    Posts:
    181
    Hi,

    Any idea how to get this looking inside unity? its from marmoset
    I have the following textures, basecolor, normalmap, AO, height,metallic, roughness, fuzz, i tried tesselation, but very poor result :/

    000.png
     
    brisingre likes this.
  38. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Good suggestion!

    Automated form filling plugins might also help, LastPass is pretty flexible.

    It should be possible, the only thing missing from the Standard Surface Shader is the Fuzzy effect but that's a simple Fresnel-type effect. We would be happy to point you in the right direction, what have you built so far?

    Thanks!
     
  39. Amplify_Ricardo

    Amplify_Ricardo

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

    Sadly, given that Screen Space Reflections only work in deferred, you wont be able to use it with Custom Lighting. It's actually Unity's Custom Lighting that is limited to Forward but, if your're comfortable with shader programming, I recommend looking into implementing your own Deferred Custom Lighting type using our flexible Template System.

    Apologies for any inconvenience caused.

    Thanks!
     
  40. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hello everyone,

    This is a bit off topic but we should probably address it in order to avoid further speculation.

    We have a great relation with Unity and we'll continue to collaborate with them whenever possible. However, they never approached us regarding a possible Amplify Shader Editor acquisition, or any other official form of editor inclusion. Not to say that we would not have been interested, it simply never came up.

    The new Unity shader editor is entirely developed and maintained by their team.

    Integration is beneficial, it defines standards and pushes us all to improve our products. I believe we can coexist, there will always be a demand for unique products with distinguishing features.

    Happy shader creations!
     
    Last edited: Mar 1, 2018
    KRGraphics, one_one and blitzvb like this.
  41. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    definitely or they will be no asset store with successful assets....
     
    Amplify_Ricardo likes this.
  42. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's important for people to realise that SRP is not for everyone. In fact I would go as far as to say most people should be wary of using them as you will get locked out of features.

    Also, Unity's shader graph will never support built in renderer, and people need to know that too. And finally... Amplify does more - built in - by far.

    Unity's one is at the mercy of whatever is available in the pipeline implementation. This means a lot of less hardcore developers will be stuck and not be able to do certain things. These people should think about using Amplify instead.

    Not dead, business as usual :)
     
    Amplify_Ricardo and KRGraphics like this.
  43. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,151
    How do you make post-processing effects with ASE? I can't for the life of me figure out how to get this to work. Like, how do I get _MainTex in node form?

    edit: I figured it out! Here's a guide in case anyone encounters the same stumbling block I did.

    First, select the post process template from the shader type dropdown. You should be presented with a screen like this:



    Next, either search for the Template Parameter node or find it under Constants and Properties. Select the appropriate parameter in its options. In this case, it's "Screen."



    Finally, grab a texture sample node and drag from the Screen Tex output into the Tex input on the node. This will get you on your way to making a working image effect!

     
    Last edited: Mar 2, 2018
  44. rekka3000

    rekka3000

    Joined:
    Feb 9, 2014
    Posts:
    46
    Any idea on how to get the depth texture or normal texture ? (screen space?)
     
  45. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,151
    That seems to involve writing new parts of the template itself, which I'm noooooooot entirely sure how to do just yet.
     
  46. CGBull

    CGBull

    Joined:
    Feb 12, 2017
    Posts:
    82
    Can i compile a vertex/pixel shader? I think the vertex / pixel shader is more suitable for me to learn.
     
  47. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I'm not sure if shader graph is going to change in that regard, but the fact that ASE creates and modifies actual .shader files is a huge advantage in my opinion.
     
  48. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    A new build was just uploaded into our website.

    Here are the release notes.

    Release Notes v1.4.5 dev 02:

    • Fixes:
      • Fixed Auto-Register option not being saved for property type nodes
      • Fixed issues with generated normalized screen position values over templates
    • Improvements:
      • Cull, Stencil, Color Mask and Depth options can now reference properties instead of standard options
      • Redone visuals of property type nodes Attributes list to be easier to use
      • Added new Enum and Custom attributes to property type nodes
        • Enum on Create Enum mode creates an Enum attribute using the specified Name/Value pairs
        • Enum on Use Engine Enum Class mode creates an Enum attribute from the specified class
        • Custom attribute allows to specify completely custom attributes
      • Outline now forces shader to be Forward only to prevent visual inconsistencies

    On this build we added the possibility for certain shader options like Cull Mode or Stencil to be configured not by their usual predefined values but by shader properties ( Ints and Floats more specifically ).

    For this, just hit the dot button right next to the option to activate the new property select mode and select your property.

    PropertyMode.gif

    There are some options that still don't have this new mode, but we will be adding them over the next builds.

    We apologize for not attending pending questions over this post but they will be answered as soon as possible.

    Have a great weekend and as always happy shader creations!
     
    Last edited: Mar 2, 2018
  49. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    You can get it by using a texture sample with the correct built-in texture. However both need some sort of transformation to output anything useful. In terms of depth you can simply use one of the depth nodes ( screen depth or depth fade ).

    For normals you can do it like this:
    Unity_2017-10-25_18-28-49.png

    The trick here is to set the sampler as a global property and be advise that the normals that you get are in view space. (you would need more transformation if you want them in other "spaces")

    In both cases you might also need to change the depth options and/or culling mode depending on what you are looking for.

    You can, you need to use one of the "templates". In the Shader Type field select one of the other options, every one of those are a template to do a specific effect and each of them compiles a vertex frag shader.

    @sazberryftw You can set your own custom attributes now. Please check whether this works for you or not in building new drawers as we don't have any to try on. Report back if you find anything strange.

    As an added bonus these new custom attributes allow you to create headers and spaces to your properties. At some point we want to create grouping as well.

    Unity_2018-03-02_18-11-25.png
     
  50. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,151
    I'm working on a shader that requires access to the depth and motion vectors of a camera. I've been able to get access to the depth by adding "sampler2D_float _CameraDepthTexture;" to the subshader pass ion the postprocessing template, but when I add "sampler2D_half _CameraMotionVectorsTexture;", I can't access it from the template parameter node. Is there any way to fix this so that I can get access to the motion vectors? I'm not afraid of diving into the code to get this to work, I just don't know where to start.