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

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    I fixed the error by creating a Layered Channel texture with all of the channels in it, and it made the shader lighter. The original shaders had a BUNCH of textures running on it, like an UberShader and with the HDRP, it threw up interpolation errors.

    Now I'm working on converting my glass shader to HDSPR but there is no opacity or refraction channel. I've already set the render queue to transparent and render type to transparent.

    And as far as the SSS is concerned, I'd love to see diffusion profile become part of the shader, like I can create a diffusion profile per objects
     
    Last edited: Aug 29, 2018
  2. Gray_Master

    Gray_Master

    Joined:
    Jun 20, 2010
    Posts:
    152
    Thanks
     
  3. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    In our specific case the expected value is a refraction index, and even though you can pass RGB values it will only access the data from the R channel. You can check out our Soap Bubble sample in the AmplifyShaderEditor\Examples\Official\ReflectRefractSoapBubble folder for an example on how to setup this effect.

    It's likely that SF might have its own way of calculating Refraction, which can differ from out method entirely.


    Good to know that you've found a workaround!

    Regarding your question, unfortunately, we don't think that this is likely to happen.


    No problem!
     
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    @Amplify_Borba I'll have to find ways to get refraction working with this, unless I could update my glass materials to HDRP without modifications to the shader graph...
     
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,389
    No Worries. and i think it might be easier to do it just the same as the GrabPass input node for the HDRP refraction buffer, since it's kinda special not a public global texture like in LWRP
     
  6. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    152
    Just a little vent post, I just made my own pixel shadows solely with ASE and Playmaker in two days, really glad about it! :-D

    Amplyfy_Shadows.png

    Thank you so much for making it possible for a non coder like me thanks to your fantastic asset!
     

    Attached Files:

  7. a_d_69

    a_d_69

    Joined:
    Jun 7, 2017
    Posts:
    9
    Hi! Please tell me, is it possible to somehow implement the ability to switch "UV Set" in Your editor? You have a node "Texture Coordinates" it is possible to switch between mapping channels, so it can be done in the node with the texture, but how to bring this switch to the inspector? In other words, next to each texture, I need a mapping switch that I can use to switch mapping channels directly from the material. Would do as it is done in the standard unity3d Shader?

    Thank you for Your product!
     

    Attached Files:

    Last edited: Aug 30, 2018
  8. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Although we have no official ETA, we do hope to add a Refraction port to the HD Template sometime in the future, as we'll continue to improve this template over time.

    Remember that Unity's HD and LW SRP are still experimental and thus they are always subject to be changed, which is why Unity itself does not currently recommended using them for production, however, we'll do our best to keep up with them through our templates.


    Upon further investigation, we've confirmed that it won't be possible to get access the intended property through the Texture Sample node. As a solution for this specific matter, we'll be adding a new function to the next ASE build, which should be available later on today, thank you for understanding.


    Hello! Thank you for the kind words and for showcasing your achievement with the help of ASE, we're happy to know that you're enjoying using our tool, keep up the good work!


    Hello! I've already replied on that thread in the ASE forum, but I'll also leave the answer here as it might be useful to other users.

    It's possible to achieve this through using the Static Switch node, however, do note that you'll be using up Keywords, which are limited to 256 per project, and about 60 of those are already being used internally.

    I've set up a simple sample for your convenience:



    Each Texture Coordinates node will have a different UV Set selected, and you can change it through the Material Inspector if you have the 'Material Toggle' parameter 'Enabled' in the Static Switch node.

     
    Reanimate_L and KRGraphics like this.
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    After seeing how COOL my skin shader looks, I don't think I want to every switch back :)... trying to figure out how to add peachfuzz.

    And I can always turn off the SRP if needed
     
    Last edited: Aug 30, 2018
  10. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    We've uploaded a new build into our website. This build will be also uploaded into the Unity Asset Store and will be available over there soon.

    Here are the release notes:
    Release Notes v1.5.6 rev 00
    • New Samples:
      • SRP Lightweight Terrain
      • Multi Pass Distortion
    • New Node:
      • Switch by Pipeline
        • Shader function specific node to choose different paths according to current pipeline
    • New Shader Function:
      • Fetch HD Color Pyramid
    • Fixes:
      • Fixed world position issues over HD PBR Template
      • Fixed transparent issues over HD PBR template
      • Prevented WorldNormalVector macro to confuse lerp operations
      • Fixed issue on created shaders being placed in incorrect folders when on two column node
      • Fixed issue on property registering over multi-pass shaders
    • Improvements:
      • Custom Options can now be added directly over templates
      • Adding Final Color x Alpha custom option into LW PBR
        • If toggled on multiples fragment final color by its alpha
      • Apply Fog on LW PBR takes Add Pass directive into account
      • Adding SRP support to Four Splats First Pass Terrain shader function
      • Material Global lIllumination flags for emission can now be modified over Surface Rendering Options
      • Activated Variable mode into 'Texture Sample' nodes

    @Reanimate_L, we've added a new shader function( Fetch HD Color Pyramid ) which lets you fetch the _ColorPyramidTexture texture2D. Unfortunately this was the only way for now for us to give you access to it, as on HD, their internal textures are declared and sampled on a slightly different way and our Texture Sample node still does not take that into account.

    Happy shader creations!
     
    Reanimate_L likes this.
  11. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,389
    @Amplify_RnD_Rick How to use Fetch HDColor node? i keep getting white color. UV should be screenspace isn't?
     
  12. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    491
    Yes it seems to be something like that, gotta be honest we're also investigating it on our end. Unfortunately there's no type of documentation on HD available, so we are also deep on checking their code and investigating on how all works.

    I would strongly suggest for you to pull the Scriptable Rendering Pipeline git project and check the com.unity.render-pipelines.high-definition\HDRP\Material\Lit\Lit.hlsl file to see how they are internally using this texture.

    I do apologize for not being able on giving you a more clear answer.
     
  13. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,389
    No worries, and i've been digging HDRP Lit code for a while and it seems the refraction buffer are too deep inside the HD pipeline, starting to doubt it would be enough just to sample the _ColorPyramidTexture.
    I'm not sure why they haven't give us a proper CameraOpaque buffer for HDRP just like LWRP

    @Amplify_RnD_Rick Oh wait, why there's no distortion vectors pass in HDRP template?
     
    Last edited: Aug 30, 2018
    Amplify_RnD_Rick likes this.
  14. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,407

    Hello everyone!

    Our regular forum users are already aware but, for anyone else, we're happy to announce that we recently added support for the Unity HD Rendering Pipeline to Amplify Shader Editor. This is part of our long term development plan as we aim to provide a reliable future proof-solution for advanced shader creation in Unity. Not only can you now create HD compatible shaders they can also convert existing shaders with ease, effortlessly bringing them to the latest Unity Rendering Standard.


    Converting existing ASE content to the new HD Rendering Pipeline is only a few clicks away.


    We include a few sample shaders to get you started:
    • Subsurface Scattering + Transmission
    • Iridescent
    • Anisotropy
    • Metallic
    • Specular

    Amplify Shader Editor - Asset Store - Amplify Product Downloads

    Happy shader creations!
     
    Lex4art, chiapet1021 and KRGraphics like this.
  15. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    This is awesome!! I need to test on converting my hair shaders to HD, but for most of it, I've had to convert all of it by hand
     
  16. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,389
    @Amplify_RnD_Rick welp, i give up. even trying to recreate HDRP unlit distortion into ASE HDRP Unlit by editing the code manually is confusing AF:(
    i just don't understand how to use DistortionVectors pass
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Hey guys... I have been having a blast with the new HD SSS shader for skin and am wondering what the coat mask does? Does it simulate the secondary specular on the skin? And also the AO map in the shader doesn't have much effect...

    Is it also possible to add in the specular channels for things like Microdetails, primarily in things like skin pores.
     
    Last edited: Aug 31, 2018
  18. TheNathanParable

    TheNathanParable

    Joined:
    Mar 21, 2014
    Posts:
    17
    @KRGraphics If you want a node that can desaturate an existing texture, I think the aforementioned RGB to HSV / HSV to RGB nodes are the ones you're looking for.

    I haven't used these in Amplify, but I have used similar nodes in Daz Studio's Shader Mixer.

    Basically, you'll want to feed your texture into the RGB to HSV node first. This converts the standard Red, Green, and Blue values into Hue, Saturation, and Value (Brightness) values.

    From there, you can fiddle with those values however you want to adjust the look of the texture.

    For example, you could take the new Saturation value and feed it into a Multiply node to adjust the saturation; multiplying it by 1 will have no effect, multiplying by 2 will double the saturation, and multiplying it by 0 will make it grayscale.

    Once you're done messing with the Hue, Saturation, and Value values, you'd then feed those three back into the other HSV to RGB node, so now you can use the new desaturated version of the texture as a regular RGB input.

    Anyways, I hope that works for you! Like I said I haven't used these nodes in Amplify yet, but looking at the Wiki they seem to be very similar to the Daz Studio equivalents.
     
    hopeful and KRGraphics like this.
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    I'm having so much fun with my updated skin shader... added some debug options to enable and disable SSS, show roughness only, and test thickness. Once I'm able to add specular (to add porosity to the skin) with the cavity details, and Fresnel to simulate peachfuzz on skin, I'll be in business :) IMG_20180831_022505_239.jpg IMG_20180831_021600.png
     
    Nirvan and petersx like this.
  20. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    I'll give that a shot to create the epidermis and subdermis maps...should be interesting
     
  21. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    353
    Hello
    I see now HD Rendering Pipeline is officially supported. But I see that with the last Update (1.5.6) none of the problems I had encountered was solved.
    I make again a summary of the problems:
    1- HD SRP Planar Reflection doesn't work with Amplify Shader:
    Planar Reflection.JPG
    2- Amplify Shader have problems with HD SRP Lit Transparent Shader:
    Problem with Transparent HD SRP shader.JPG
    3- Amplify Shader errors with HD SRP Reflection Probes:
    ReflectionProbe.JPG
    This is the simple Amplify Shader used for the test:
    Amplify_Shader.JPG
    Below the link to the project with scenes included (Unity 2018.2.4f1, HD SRP 3.00).
    https://drive.google.com/open?id=1q_hlBzcowYE_1PtrBgSEDoW4Pk8nwpgY
    Please let me know.
    Thank you!
     
    Last edited: Aug 31, 2018
  22. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    220
    Where did you stick specularity? As a coat mask ?
     
    KRGraphics likes this.
  23. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    491
    The HDRP template is still a work in progress, and haven't checked on how Distortion Vectors work yet. We took Unity's own template as a starting point and are expanding on it in order to try and match all the options given by the standard HD material.
    Hopefully as soon as we integrate them into our template, I will have more info to share with you.

    We do apologize for the delay on fixing these issues. Rest assured that your report was not forgotten, we unfortunately weren't able to tackle them yet.

    I will be away for a couple of weeks, but rest assured as soon as I get back, I'll jump right back into the HD template to both expand its features and fix all existing bugs.
     
    Reanimate_L likes this.
  24. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    I tried that and couldn't get the range I wanted
     
  25. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    736
    Just when I thought I understood something, it doesn't seem to be the case.

    I'd like one shader to support two separate cars. But cars might get damaged or burnt or have different paint colors. I thought the difference between "Property" and "Instanced Property" was to cover these kinds of individual settings per object instance, but a quick test showed both cars matching. How do I drive different values into a shader's properties, per instance?

    Edit: Okay, I found what I was looking for. More complicated than I thought but doable. This isn't a particularly ASE thing but it's supported/enabled with the ASE interface on the shader part itself.

    On each parameter you would like to have tweaked independently, you will need to select the parameter in ASE, look in the "Attributes" for that parameter, and turn on the "Per Renderer Data" attribute. (In the shader language, [PerRendererData] is written before the parameter's property declaration.)

    Every object using a material with such parameters will now allocate its own little hidden structure to pass those tweaks. On each object you want to individually control that object's variation of the material, such as paint color or denting level, your script can fetch the renderer's MaterialPropertyBlock (renderer.GetPropertyBlock()), use SetColor() or other setters, and then shove the property block back into the renderer.

    I need to experiment with how often I need to assert that block back to the renderer, and I think it's required every Update() once two objects have different values.

    Sorry if that was obvious to everyone... but I thought I'd note it here just in case. Folks can google the rest from here.
     
    Last edited: Sep 1, 2018
    hopeful likes this.
  26. AdultLink

    AdultLink

    Joined:
    May 20, 2017
    Posts:
    4
    Hey everyone,

    I've been using ASE for a while now and I'm in love with it. I personally love providing shaders with a lot of cuztomization options, and as the amount of toggles, values and effects increase, I have a feeling I'm not doing things the optimum way in regards to performance.

    This is a small portion of a shader I'm working on:



    As you can see, towards the right end I'm using a few toggles to allow the user to activate/deactivate a "scanline" effect on all three axes separately, and additionally to that, there are three more toggles before those. The result of all this will be multiplied with a texture afterwards.

    On the left side you can also see I'm using sine and time nodes to generate those scanlines, plus a a few float nodes to tweak the wave. All these nodes are properties that I'm

    My question is, are all these calculations still performed even when the final toggle is off? (I'm guessing the answer is yes). And if so, what can I do to avoid that? Is there any other way of structuring a graph like this performance-wise, some kind of conditional compilation?

    Here are a couple more examples that I feel are not that performant :(





    And here's how the inspector looks:



    If you'd like to check the shader by yourself, you can find it here (unitypackage udner releases): https://github.com/AdultLink/TexturePanner

    Thank you for your time! :)
     
    Last edited: Sep 1, 2018
  27. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,407
    Indeed, with PreRendererData properties can be queried from the renderer's MaterialPropertyBlock, instead of from the material.

    Have you had the chance to check the Simple GPU Instancing sample? Could be a viable alternative, script sample included.


    Hey there, thanks for using ASE!

    You are on the right track, the Toggle node is comparable a Lerp node you should definitely go with the Static Switch. Be sure to check out the Unity's multiple shader variants reference, which provides further information regarding this subject.

    Thanks for sharing!
     
  28. AdultLink

    AdultLink

    Joined:
    May 20, 2017
    Posts:
    4
    Thank you!

    So does the static switch help with performance stuff? As in, does it prevent stuff from being calculated if unnecessary?
     
  29. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    270
    I'm using a shader on a sprite that snaps it's position by rounding the world position and adding to the local vertex offset, however it looks weird and doesn't snap properly when the sprite is flipped (negative scale), why is this happening and is there a workaround?

    Snap.gif

    Edit: I thought about using the Object Scale node to multiply my result with the scale but it seems to always output a positive value

    The Face node seemed useful but unfortunately it doesn't work with the Local Vertex Offset port, I get a warning in the console

    If I turn batching on and there is more than one of the same sprite, it snaps properly even if the sprite is flipped, I'm not sure why this is happening.

    The World to Object node seems to work if I disable batching, but some of my shaders need to use batching.
     
    Last edited: Sep 2, 2018
  30. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,407
    In short, Toggles execute all calculation while Static Switches can execute only what you define. Be sure to check the link I shared for additional information on how Unity handles this type of behavior.

    The issue does seem to be caused by Unity's Dynamic Batching, which causes the local values of the vertex position to be altered. GPU Instancing could be a viable workaround, be sure to let us know if it works well for your particular requirements.

    Thanks!
     
  31. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Good morning, guys. So I've been tweaking my skin shader and I'm glad you guys added diffusion profiles to ease the creation of different properties.

    However, I had some more ideas and one of them was being able to create diffusion profiles in the shader (currently it's global with the included asset) to allow individual control, especially for characters. Coming from UE4, this would be awesome to have even as a shader function.

    And probably overkill, but the inclusion of a specular channel would be ideal for legacy purposes.
     
  32. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,389
    I doubt that can happened. the current setup are derived from HDRP using different setup mean they/you need to create/customized the HDRP
     
    KRGraphics likes this.
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    True. Unless I can add more profiles by editing the script... I have different diffusion profiles for different ethnicities and ages just for that fine control.
     
  34. KhenaB

    KhenaB

    Joined:
    Aug 21, 2014
    Posts:
    270
    Batching is set to disabled in the shader, I'm sending you a project
     
  35. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,407
    Greetings!

    Not sure if we can create them directly but I'll pass it on to the devs. Do note that the developer responsible for the HD implementation is going to be away for ~2 weeks, apologies for the inconvenience.

    Since we use what Unity provides, I don't think we can include a specular channel at the moment.

    Correct, users can always create their own templates.

    That's an interesting case, definitely something to keep in mind.

    Thanks, one of our developers will check it as soon as possible.
     
    Last edited: Sep 3, 2018
    Reanimate_L and KRGraphics like this.
  36. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    220
    You can create in shader static switch - and use it for skin variant. It's simply but only ASE enables max 9 keywords

     
    KRGraphics likes this.
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    I'll definitely play with this. These will be mainly for characters...
     
  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976

    It's cool. It's not completely crucial... the specular map would be for things like sweat mapping
     
  39. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,407
    Great suggestions, thanks!


    You might have to go around that limitation for now, HD might change considerably on Unity side during the next couple of months.
     
    KRGraphics likes this.
  40. sunseeker1988

    sunseeker1988

    Joined:
    Jul 10, 2014
    Posts:
    413
    Will Amplify shader work for VR (HTC vive and Oculus)? IS there anything I need to consider when working with this shader for VR that will result in a shader I create not working?
     
  41. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,407
    Yes, works great!

    Depends on the type of shader, depth based effects can be generally problematic regardless of using our editor to generate them.

    Do you have any particular type of shader in mind?
     
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    And I am cool with it :D... just glad I can finally create my SSS shader... now just waiting for hair... tried to update my hair shader and it broke :(
     
    Amplify_Ricardo likes this.
  43. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,389
    Use anisotropic surface, and if you willing to dive into hdrp you can change the anisotropic calculation with kajiya kay method for hair shading.
     
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    I already have a shader function for kajiya-kay and other hair shading models (except Marshner) but they are broken in HD
     
  45. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,389
    ASE shader function? i doubt it will work in HDRP. Might be worth to inject them inside HDRP.
    it should be inside lit.hlsl and find "MATERIALFEATUREFLAGS_LIT_ANISOTROPY" and modify that
     
  46. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    I'm also not a programmer, so I will have to wait a bit :)
     
  47. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    400
    I think I've run into a small issue with the Flipbook UV Animation mode on Xbox One.
    I have a texture with 9 cells with a number in each cell. 0 being the bottom left, and 8 being the top right. I've created an animation that sets the StartFrame to 0, and increments every second to see that the flipbook is working.

    I use this flipbook for setting eyelid textures for my character, so I'm not just playing it in sequence usually but setting the startFrame directly to change the eye to angry, etc.

    Testing on PC this works correctly, and the flipbook shows the numbers in order. [0, 1, 2, 3, 4, 5, 6, 7, 8]
    Testing on Xbox One does not. Using the same animation it shows the cells [0, 1, 2, 0, 4, 5, 3, 7, 8]

    Is this an known issue? I'll see about creating a flipbook node from scratch and see if I can figure out what's going wrong.
    Edit: Video of this to better illustrate what is happening. Left is PC, right is Xbox. They are not in sync, but you can see the order the flipbook shows the frames are different between platforms.


    Edit#2: This appears to work on both PC and Xbox One. Note the comment box in the bottom left. The error above doesn't happen after adding that. Guess it's a precision issue or something? Fudging the value up 0.25 was the first value I tried, not sure where the threshold is that will make it fail, but will try out a few builds and see what I find.
     
    Last edited: Sep 6, 2018
  48. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    220
    @Amplitfy
    How to use slot Pattern in Dither node (when choose Patern: Noise Texture) ?
    Is is possible to use greater than 8x8 pattern ? Is it possibe to modify this node to create smaller dithering ?
     
  49. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,023
    What is the "Additional Use Passes" option and how do we use it? Not finding anything in docs.
     
  50. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,407
    It's not a known issue regarding Flipbook use. It does sound like it could be precision related, we'll have to run a few tests on our side.

    What Shader Model did you use?

    Unfortunately, you'll have to pick one of them. You cannot use a pattern greater than 8x8 but you can use a custom pattern.

    You can create your own Dither node, feel free to use the included DitheringNode.cs node as a starting point.

    It's specific to Unity's own UsePass. What kind of shader do you intend to build?

    Thanks!