Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Best Tool Asset Store Award] Amplify Shader Editor - Node-based Shader Creation Tool

Discussion in 'Assets and Asset Store' started by Amplify_Ricardo, Sep 13, 2016.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    3,603
    Alright so I guess the float 0 should be 1

    is this correct?
    upload_2020-6-30_19-16-1.png
    I'm getting no fade.
    http://paste.amplify.pt/view/raw/bedf4099

    oh wait, attaching it to the static switch then noodling with the settings i'm getting the same effect as before which is that it's doing a per pixel depth testing instead of a per object so I still see the inside of the object upload_2020-6-30_19-20-32.png
     
    Last edited: Jul 1, 2020
  2. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    3,603
    bug: if you move the group box over other nodes, it'll capture the nodes.
    proper behavior should be move the node within the group box, the group box highlights denoting interaction and when dropped in the highlighted group box it now belongs to it
     
  3. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    So you're referring to the actual darkness of the shadow, not the artifacts, got it. If you're using our default shader, there's a good chance that it's caused by something in your Lighting/Project settings, or scene configuration.

    I'll need a sample to examine the problem as I cannot debug it from our side.


    Don't know what else to recommend in this case, you can get the distance between the World Position and World Space Camera Position and use that to drive the Mask/Dither effect; it's not depth, it's actual distance, you have to adjust the properties depending on your objects or tweak the node network for what you actually want. Try Remapping the values.


    Does seem to be something happening there, I'll pass it on to our devs.

    Thanks!
     
    laurentlavigne likes this.
  4. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    After examining the sample, it seems that the problem is related to the use of a light cookie. Light cookies work with Custom Lighting, we're not entirely sure what could this causing this issue. Notice that it's only areas in shadow that go full black when the cookie is set.

    One of our developers is going to debug it as soon as possible, thank you for the sample.
     
  5. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    751
    Thank you. Sorry that the cookie didn't come to my mind immediately as a potential edge case and the cause of that issue.
     
  6. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    No problem, it's an odd issue, our devs should be able to make sense of it.
     
  7. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    751
    upload_2020-7-1_16-37-57.png

    I see that sharp shadows will still be an issue. The shadows on the custom lit B and C don't seem to mix with the object's lighting. On B the edge between self-cast shadow border and the dark side of the cube is very visible. So I tried to make the cube lighting gradient darker on C, but it doesn't help, it only makes the whole shadow way too dark, because, again it doesn't blend, it "adds" the cast shadow on top.

    Is it even possible to make the shadows to blend with custom shading?

    Best I could do is no bias:

    upload_2020-7-1_16-58-16.png

    But this adds more artifacts in the light area due to normal bias. And looks pretty bad still on the sphere.

    upload_2020-7-1_16-59-51.png

    I just want them to look like this:

    upload_2020-7-1_16-56-1.png

    (Received shadows disabled)
     
  8. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    As I mentioned in one of my previous posts, the shadow quality is controlled in your project settings, or any of the shadow bias parameter; it's not specific to the shader. I would refer to the original post: https://forum.unity.com/threads/bes...er-creation-tool.430959/page-116#post-6038612

    However, Custom Lighing shaders will render those shadows differently, they are not using the the same technique as a regular PBR shader; use the Standard Surface Light node if you want to replicate that.
     
  9. Blanka

    Blanka

    Joined:
    Apr 15, 2013
    Posts:
    3
    Is there a way to do this in Amplify Shader?


    it's basically getting the distance to any other object. Sort of like a reverse Depth Fade Node.
     
  10. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Sure, there's even a Depth Fade node and Shield sample that does something along those lines.
     
  11. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    297
    Hey all!

    New combined build uploaded to both our site ( http://amplify.pt/download/ ) and Unity Asset Store ( http://u3d.as/y3X )(should be up soon)
    Release Notes v1.8.2 rev 00 (since v1.8.1 rev 00)
    • New HDRP Template
      • Decal
    • New Shader Functions:
      • And
      • Or
      • Projection
      • Rejection
    • Improvements:
      • Added new port to 'Voronoi' node that outputs the UVs of the current voronoi cells
      • Added support for MRT for ColorMask, Blend and BlendOp in templates and template Options
      • AlphaToMask is now it's own separate module that can be activated independently and supports inline properties
      • Changed UV creation to support pre-calculated UVs in templates (ie: decals)
      • Improved URP and HDRP templates in order to minimize their CBUFFER contents
      • Updated libraries for SRP 7.3.1 and 7.4.1
      • Added more description text to custom expression node
      • Live update doesn't kick in when editing a field
      • Shader Functions options label size resize according to the panel width
      • Added AssemblyDefinition file and made it so nodes can be found in the main editor assembly besides ASE assembly
      • If you which to extend ASE with your own node and you already use your own assembly file you need to add ASE as a dependency
    • Fixes:
      • Fixed Texture Array Creator tool in order to properly allow signed and higher bit texture formats
      • Voronoi now properly creates UVs in all situations and preview was updated accordingly
      • Fixed issue with instance ID node not working correctly in URP due to templates not properly detecting the existing ones
      • Fixed issue with unused tessellation properties showing up in the shader inspector
      • Fixed issue with 'Reconstruct World Position From Depth' node that was preventing from compiling when used with 'Depth Fade' node
      • Fixed issue with 'Reconstruct World Position From Depth' node that wasn't working correctly in SRP 7.4.X and up
      • Fixed 'Texture Sample' node and 'Texel Size' node previews so that they update when it's referenced texture changes
      • Fixed issue with sampler states option not working if reference node was not compiled
      • Fixed issue with function nodes not saving their GUID correctly to the metadata
      • Fixed issue with function switch nodes not saving correctly when inputs were left unconnected
      • Fixed issue with reading options due to system cultural differences
      • Fixed issue where clipboard copy/pasting was not respecting system cultural differences
     
  12. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,067
    Hello, Amplify team

    I've been seeing the following editor console error when I open my project and occasionally other times (if I recall, entering and exiting play mode). The shader I'm working on has a custom template which may be causing the problem, but if you have any suggestions on where to look, I'd appreciate it. The key error alone doesn't tell me much because I don't know what key is failing.

    Code (csharp):
    1. KeyNotFoundException: The given key was not present in the dictionary.
    2. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <fb001e01371b4adca20013e0ac763896>:0)
    3. AmplifyShaderEditor.TemplateHelperFunctions.CreateVertexDataList (System.String vertexData, System.String parametersBody) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateHelperFunctions.cs:1845)
    4. AmplifyShaderEditor.TemplatePass.FetchVertexAndInterpData (AmplifyShaderEditor.TemplateMultiPass template, AmplifyShaderEditor.TemplateModulesData subShaderModule, System.Int32 offsetIdx, System.String body) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplatePass.cs:407)
    5. UnityEngine.Debug:LogException(Exception)
    6. AmplifyShaderEditor.TemplatePass:FetchVertexAndInterpData(TemplateMultiPass, TemplateModulesData, Int32, String) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplatePass.cs:413)
    7. AmplifyShaderEditor.TemplatePass:.ctor(TemplateMultiPass, TemplateSubShader, Int32, Int32, TemplateIdManager, String, Int32, TemplatePassInfo, Dictionary`2&) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplatePass.cs:134)
    8. AmplifyShaderEditor.TemplateSubShader:.ctor(TemplateMultiPass, Int32, TemplateIdManager, String, TemplateSubShaderInfo, Dictionary`2&) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateSubShader.cs:90)
    9. AmplifyShaderEditor.TemplateMultiPass:LoadTemplateBody(String) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPass.cs:260)
    10. AmplifyShaderEditor.TemplateMultiPass:Init(String, String, Boolean) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplateMultiPass.cs:90)
    11. AmplifyShaderEditor.TemplatesManager:CheckAndLoadTemplate(String) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplatesManager.cs:855)
    12. AmplifyShaderEditor.TemplatesManager:Init() (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplatesManager.cs:639)
    13. AmplifyShaderEditor.TemplatesManager:OnEnable() (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplatesManager.cs:871)
    14. UnityEngine.ScriptableObject:CreateInstance()
    15. AmplifyShaderEditor.TemplatePostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/AmplifyShaderEditor/Plugins/Editor/Templates/TemplatePostProcessor.cs:35)
    16. UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
    My shader recompiles and works just fine. I get two repeats of this error plus another that's essentially the same thing except for the hexadecimal hash string in the exception log.

    Any suggestions what to look at, before I start inserting debug traces into ASE to see what key's being sought at that time?
     
  13. Blanka

    Blanka

    Joined:
    Apr 15, 2013
    Posts:
    3
    sure, but Depth Fade only works on the inside. I can't for example make an opaque sphere that does the same. It's almost like an Ambient Occlusion, or like how soft particles change transparency when near solid objects.
     
  14. Zak_Ipatov

    Zak_Ipatov

    Joined:
    Jul 21, 2014
    Posts:
    1
    Possible bug found
    Version 1.8.1

    This issue also described here: https://issuetracker.unity3d.com/is...rown-when-opening-a-shader-with-shader-editor

    When I try to open shader with ASE the exception is thrown:
    The error occurs in AmplifyShaderEditor\Plugins\Editor\Utils\InlineProperty.cs:257 :
    Code (CSharp):
    1. public void ReadFromSingle( string singleLine )
    2. {
    3.     string[] data = singleLine.Split( IOUtils.VECTOR_SEPARATOR );
    4.     m_value = Convert.ToSingle( data[ 0 ] );
    5.     m_active = Convert.ToBoolean( data[ 1 ] );
    6.     m_nodeId = Convert.ToInt32( data[ 2 ] );
    7. }
    So, it looks like this problem depends on regional representation of float values. I managed to solve this error by adding CultureInfo to parsing method parameters:
    Code (CSharp):
    1. using System.Globalization;
    2.  
    3. ...
    4.  
    5. public void ReadFromSingle( string singleLine )
    6. {
    7.     string[] data = singleLine.Split( IOUtils.VECTOR_SEPARATOR );
    8.     m_value = Convert.ToSingle( data[ 0 ], CultureInfo.InvariantCulture );
    9.     m_active = Convert.ToBoolean( data[ 1 ] );
    10.     m_nodeId = Convert.ToInt32( data[ 2 ] );
    11. }
     
  15. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    35
    Hi. I am facing a strange issue with object space, triplanar normal mapping since I converted my project from built-in RP to Universal RP.
    I use a custom shader I did with ASE a while ago and which was working well, but after installing URP and making an URP version of the Amplify shader, the normal maps messed up on my models, they are lit incorrectly. See the difference:

    Unity 2019.1.12f1 - ASE 1.6.7 :)


    Unity 2019.4.1f1 - URP 7.3.1 - ASE 1.8.2 :(

    You can clealy see the strange normal invert between top/bottom and right/left parts of the planet face. My guess is that maybe normal map lighting computations are done differently either with SRPs (I reproduced the problem in a HDRP copy of my project) or newer versions of Amplify.

    Here is the URP version (copy-paste) of my shader. I temporary replaced my custom triplanar with ASE Triplanar Sample to check for any difference but I get the same result. But maybe there is a way to temporarily fix it by changing something in that graph..?
    upload_2020-7-5_15-31-3.png


    Any clue? thank you in advance.
     
  16. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    556
    Here's a little showcase of the infinite terrain shader made with ASE :) Trees also come from the shader.
     
  17. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Thanks for reporting it, best to have one of our developers examine this directly. Please forward us the template to support@amplify.pt.


    Interesting, there's definitely something happening there but I can't be sure without actually testing the shader.


    That looks amazing, great job!

    Is it part of a new project or just for fun?
     
  18. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    I don't quite understand what you mean, please elaborate.


    That's very odd, we've recently fixed something related to CultureInfo. I recommend updating to the latest ASE version and checking if the problem persists, we'd be happy to test a sample if that's the case.

    Amplify Shader Editor v1.8.2.000 - http://amplify.pt/download/
     
  19. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    35
    I can actually reproduce it with the most simple shader (URP template):
    upload_2020-7-6_13-38-19.png

    Here is the result on a Unity sphere:
    upload_2020-7-6_13-41-32.png
     
  20. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    That's good, we should be able to replicate the issue on our side.
     
  21. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Seems that we can't replicate the issue on our side, can you send us a small complete sample ready to test?

    URP


    Standard





    Thanks!
     
  22. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    35
    To be sure I did this from a new Unity project. Here is the .unitypackage.

    I made SampleScene skybox black for more clarity. If you rotate the sphere object you will notice the normal maps will look inverted half of the time, and get this cross pattern:
    upload_2020-7-6_20-31-37.png
     
    Last edited: Jul 6, 2020
  23. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    556
    Thanks. It's for personal portfolio. I've been experimenting with the infitine shader idea for a long time with other shader editors so I decided to have it a go with ASE too :)
    Here is the terrain under different lighting conditions.

     
  24. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Very cool, thanks for sharing!
     
  25. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Ok, I think I got it on my side now, I will pass this on to our devs for further examination.
     
  26. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    256
    @Cactus_on_Fire the sky looks great and of course the terrain shader also. ;)
     
    Cactus_on_Fire likes this.
  27. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,842
    @Amplify_Ricardo ,

    For 2DRenderer Lit shader, I would like to be able to control the usage of vertex color a bit more.

    For example, I want to use vertex color information for my custom effect only and I don't actually want it to be multiplied to the color channel. So we need to ability to link not just offset, normal, tangent but color as well.

    Will this be possible?

    I would also like to be able to read texture from vertex shader to tweak my vertex offset, but in doing so , it gives me error saying uv0 is not found
     
    Last edited: Jul 7, 2020
  28. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    35
    Thanks!

    I love this, nice work!
     
    Cactus_on_Fire likes this.
  29. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    556
    Thanks!
     
    Amplify_Ricardo likes this.
  30. TonyBeretta

    TonyBeretta

    Joined:
    Aug 6, 2012
    Posts:
    15
    Thanks for reply and sorry if it's not clear but English isn't my first language and I have to use Google translate often.
    I can't use anymore the parallax node because if you get very close to the object the texture is deformed, a kind of lens effect.


    This below is exactly the effect I want from the shader.
    But there is still a problem that I can't solve.
    If you can create this shader and apply it to a cube you can see it.

    The problem is that if you turn around the cube, halfway is all right but at some point the texture stops and begins to slide in reverse.
    While it should always slide in the same direction.

    I have tried all the nodes and combinations but I can't find the solution that probably requires knowledge that I don't have.
     
  31. peachpieproductions

    peachpieproductions

    Joined:
    Sep 2, 2017
    Posts:
    16
    Hey there!

    My team is using amplify for a specific purpose, and we cant seem to solve it, even though its a very simple problem. We dont have the shader knowledge to figure it out.

    We are making an AR app and want to render a model (the blimp) behind an occlusion model (the building)

    We have it working as intended, the only issue is that we cannot figure out how to blur the occlusion mask (see below - red arrow)

    (example)
    Image 1 - AR camera feed
    Image 2 - Object to occlude
    Image 3 - Occlusion Mask
    Image 4 - Blurred Occlusion Mask (This is where we are stuck!!!)
    Image 5 - Final image as it should be, occluding with blurred edges
    compiled.jpg

    We cannot figure out how to blur a mask texture in amplify

    Any help would be greatly appreciated, thank you :)

    Ben
     

    Attached Files:

  32. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    424
    Hi Guys. Newbie alert!

    1) So is this plugin like Unity's own Shader Graph, but basically a fancier, 3rd party version?

    2) Can I create shaders, based on a physical real world scale? Meaning, if I have a jpg, can I tell Unity that I want that jpg to be 4.2meter X 3.75meter? I'm asking because if I swop out materials on different AEC designs, I just want to swop the materials using the model's existing UVs. I'm not yet fully understanding how I am suppose to get things at a specific scale if all you have is tiling and offset.
     
  33. fedorval

    fedorval

    Joined:
    Nov 15, 2019
    Posts:
    13
    Hello!

    I've been trying to add a custom variable in one of my shaders. Basically I want to add a StructuredBuffer and then use it through Unity's #ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED with a custom expression node that you guys already have and works just fine.

    I can't find where or how to add a custom global variable though. All I can put is all the different floats and other nodes that are currently available without being able to mark them as a StructuredBuffer. Is it possible? Is there a node for it or a place in the Output Node's settings?
     
  34. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    389
    I own the Amplify Shader but still got to start using it.
    But since I'm not sure if I will be staying with built in pipeline or move to SRP before I invest my time into creating shaders I would like to know how easy it is to move graphs created for built in to migrate into HDRP.
     
  35. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    3,603
    Kinda, Amplify is noticeably slower to compile a shader and also much easier to use because when you connect nodes it does auto conversion.
     
  36. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Thanks, let's try to figure it out. I need you to explain what exactly you want to do so that I can request some assistance from our devs. We provide 2 ways of doing parallax, I don't understand what you want to achieve with your shader example.

    Do you have a reference that I can share with our team? Perhaps a screenshot or video of your problem could help.

    Blurring textures in shaders is not as straightforward as it may seem but, depending on how you're doing it, there might be an easy solution. How are you using that mask in the shader, is it via a Texture Sample node? If so, you can use the Mip Level to fake the blur effect; just make sure that the texture is generating Mips.

    upload_2020-7-9_9-38-28.png


    1. I would say a more open and flexible editor; ASE is built from the ground up as a future-proof solution, meaning that we've made sure that you have the right features to adapt it to future rendering requirements. We do this by providing a Custom Template shader system that allows users to create their own shader types, even allowing us to support SRP, a Custom Node API for custom node development, and Shader Functions for reusable shader networks.

    It's not all about the cool extra features of course, we put a lot of work in making sure that ASE runs smoothly; UX is very important to us, I think the difference is immediately apparent as soon as you try both editor.

    Along with over 70 shader samples, ASE is also community driven. Be sure to join us if you wish to discuss it directly with the ASE Discord community: https://discord.gg/zVdqVSp

    2. You can create shaders based on whatever value you need. However, just to be sure what you mean, perhaps you should elaborate. The UV's define scale and position, the shader simply takes that information and uses it to properly render your textures; if you wish to do so, you can manipulate the existing Offset and Tiling based on the original UV data of your mesh but how its done is entirely up to you.

    Here's an example where we multiply the UV by the Object Scale to get the same amount of tiling across all objects; assuming the mesh UV has the same scale across the meshes.
    upload_2020-7-9_10-13-36.png


    Without editing the actual template right? You might be able to do it using a Custom Additional Directive; the code is not going to look pretty but it should work, just be sure to input the code there without "newlines", each line is a new entry.

    We're assuming you're using SRP, this will not work with the built-in renderer.





    That is extremely odd, but was it dependent on any shaders or our own ASE scripts? Do you see any warnings or errors in your console? We're very interested in getting to the cause of this issue as ASE should have no effect on this type of thing.

    Please reach out to us via support with your invoice number. (support@amplify.pt)


    In most cases, it's this easy:


    Do you have a specific condition in mind where ASE is slower to compile? Honest question, I have not tested this in a while but SRP can be notoriously slow, even with hand coded shaders.
     
    Last edited: Jul 9, 2020
    koirat likes this.
  37. fedorval

    fedorval

    Joined:
    Nov 15, 2019
    Posts:
    13
    Sadly we're too far into the project to switch from built-in to an SRP. Would there be any way of making it work with the built-in renderer?
     
  38. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,220
    Hi,

    I am trying to write a URP Render Feature shader with amplify. I made it work manually, but I can't figure out what nodes to use in amplify. Consider I know almost nothing about amplify shader editor.

    What I cannot figure out at the moment is how to sample the _CameraColorTexture from a URP template
     
  39. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    You can probably do it manually by declaring it via a Texture Sample node, setting its Name to _CameraDepthTexture and Type to Global.(be sure to change the actual variable name, you have to press the lock icon under the name)
     
  40. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Hey, I deleted my previous reply in order to avoid any confusion.

    I should have said that it was unlikely to work, instead of not working; our developer was not sure. It works with templates(vert/frag) but not with Surface Shaders. You're going to need some additional work in order to get it working with Surface Shaders as they won't generate the code correctly without it.

    As an example:


    Can be replicated with:

    ("//sa" just in case of duplicates)

    Hope it helps!
     
  41. fedorval

    fedorval

    Joined:
    Nov 15, 2019
    Posts:
    13
    That's a very neat trick and exactly what I wanted! It does mix the code a little bit but since I rarely poke into it and I'm aware of the trick then it's fine.

    It seems to be working, I'm not sure since I have to setup a whole other bunch of stuff now but there's no compile error and that's usually a good sign.

    Thanks a bunch!
     
  42. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Awesome, really happy that it works because the alternatives would involve much more work with Templates.(vert/frag)
     
  43. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,067
    Will do, but first I want to be sure it's not just an error in my template. I don't want to ask your devs to fix my code bug. :)

    The reason I say this is that after posting the error, as I worked on my shader further I found that I still got the error but it changed in how many appeared and when, so what I think is happening is that my template is the root cause, but your code is not handling it gracefully.

    I'll probably add a try/catch block around that key lookup that reports the missing key to the console before re-throwing the exception.

    Limiting the amount of validation logic for runtime code is often necessary for performance. In this situation, I may -- depending on my testing outcome -- be suggesting that you add some defensive/diagnostic code at this point since the code is only active at edit time, and as far as I can tell is only invoked in response to some user action (either editing the node graph, or the initial opening of the file in the shader editor). The tradeoff of performance for diagnostic precision may be justified. Again, though, let me push this a little further on my own and I'll report back in.

    The main reason I posted the error to the forum early in my debugging was to rule out the possibility that it was a known bug the devs were already addressing in an upcoming patch. I should have been clear about that in the question, that I wasn't necessarily expecting a solution but simply a check of whether it had an assignable cause already. I apologize for that ambiguity.
     
  44. Ruisch

    Ruisch

    Joined:
    Jan 25, 2014
    Posts:
    1
    Hi everyone

    I'm fairly new to Amplify and been trying to wrap my head around this here for way too long now;

    I've created a slowly scrolling noise that is being displayed using world UVs. I'm now trying to have objects sample this colour and change colour to match it. Basically I'd like these spheres to pulse between black and white, with the noise driving this behaviour.

    I've tried using the 'World to Object' node, but can't find a way to sample this noise. I can use the 'World to Object' node to sample a texture though. Is there an equivalent way to do this with data generated through nodes?

    The bottom image in the included file is what I'm trying to achieve.

    Any help would be appreciated, thanks!
     

    Attached Files:

  45. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Thanks for the additional details, we appreciate it. I don't know exactly what measures we have in place as this is a bit beyond me but I'm sure our devs would appreciate a problematic template for further examination as this could potentially help prevent future similar errors.

    If that's a possibility, we would love to hear from you at support@amplify.pt with a sample.


    Thanks for reaching out, we also have a Discord channel for direct discussion.

    Will the the floor plane noise be visible? You could use a Sin Time node to create the pulsating effect on the spheres. Shaders are not aware of each others values, you'd have to rework a few things.
     
  46. Organism-Studios

    Organism-Studios

    Joined:
    Oct 22, 2013
    Posts:
    7
    Hi everyone,

    Trying to find the solution to my problem:

    I have an object with two UV sets to facilitate a secondary normal map (detail). The second UVs are oriented differently and because the first UV set is used for the mikkspace tangent calculation, the detail normalmap turns out incorrect. Does anyone know if it is possible to fix this at shader level using the "Derive Tangent Basis" function node?

    Thanks!
     
  47. Why485

    Why485

    Joined:
    Jun 30, 2013
    Posts:
    41
    I'm looking into Amplify Shader Editor at the moment specifically because it allows the creation of custom terrain shaders. This is something that I struggled to do myself because there seems to be a lot of special considerations that need to be made for them to work at all in Unity.

    Does Amplify Shader Editor support writing a custom terrain shader for Universal Render Pipeline? Up to, and including, a completely custom lighting model? If a custom lighting model isn't possible, can an unlit shader be created for the terrain and then my own lighting calculated through that?

    My game looks like this, and I would need to be able to create a terrain shader which matches this style.
     
  48. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    583
    Hi guys!!

    I am trying to make a lens flare type Post Process shader which glows/positions a texture when you look at the location of the directional light (I know there are built in ways to achieve this but this will be part of a bigger shader). Could anyone help me out on this?

    I have something similar working, this is more of a gradient type thing, and it only works on 3D objects, If I use this in a lerp, I can create a glow when looking at the sun, however it doesn't work when applied as an overlay/post effect, everything gets out of wack. (I am blitting it as a render feature in URP). This is what works for 3D objects.

    upload_2020-7-13_23-36-21.png

    Any ideas of a better way to do this / some way to make it work similar as a post process?

    TLDR; I want to create a glow when you look at the sun in a post process shader (URP) procedural and/or having a texture that positions itself when you look a the directional light, like a sun glow.
     
  49. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    3,603
    Hello,
    Is there a complexity counter somewhere?
    How do I speed up a shader in the editor?
    What do you recommend to avoid for the Switch?
     
  50. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,822
    Not sure we understand what you intend to achieve in this case, please do elaborate.

    Awesome, love the retro look!

    Unfortunately, I don't think that's something you can do out-of-the-box at the moment; some tinkering would be required on your side and we can't guarantee that's going to work as you expect. However, one use seems to have done something along those lines, might be an interesting reference.

    https://inresin.wordpress.com/2020/04/03/terrain-and-mesh-blending-in-unity/


    More of a gradient thing? Please do elaborate, not sure what we can assist you with there, we would be happy to help.

    1. Instruction count on the Shader file info, always dependent on your operations. Use dedicated tools to analyze such as AMD's Shader Analyzer, RenderDoc and GPUOpen.
    2. What do you mean by speeding up a shader in the Editor?
    3. Large amounts of shader operations, simplify and pack whenever possible. Unrelated to shader creation, one of the biggest problems on the Switch, much like mobile devices, are draw calls.(we aimed ad 300-400 on our own game, Decay of Logos, and that was not enough in some cases) Physics can also be problematic, keep its accuracy as low as possible; object activation introduces stutters, avoid activating too many at once.
     
    laurentlavigne and Why485 like this.
unityunity