Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    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. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    17
    Perfect! Thank you.
    It didn't work till now because thought I had to select Fetch mode on the duplicated switches. So they need to stay on Create mode and just have the same name.
     
  2. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    434
    !! Going to give that a try right now. Thank you so much ... I really thought I was asking something impossible!
     
  3. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    17
    I have another question:

    I get this error because I use too many Texture Samplers in my shader.
    maximum ps_5_0 sampler register index (16) exceeded

    Here bgolus suggests to use a node called Sampler State Node as a substitute if when we use Unity's Shader Graph:
    https://forum.unity.com/threads/maximum-ps_5_0-sampler-register-index.562867/#post-4576522

    Do you have an equivalent node or another solution to this limitation in ASE (except creating Texture Arrays) ?
    I don't need more than 24 Textures, and I don't really want to create specific assets for this shader.
     
  4. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    85
    I receive this in an android build. Unity 2018.3.8f1. Current Shader error in 'ASESampleShaders/Community/TFHC/Hologram Simple': Duplicate system value semantic definition: input semantic 'SV_POSITION' and input semantic 'VPOS' at line 166 (on gles)
    My android build is at a halt.
    I have received 4 other errors like this. I happened in the update of unity3d.

    I recompiled the identified shaders and all is good now.
     
    Last edited: May 26, 2019
  5. ZaZy

    ZaZy

    Joined:
    Jan 14, 2015
    Posts:
    20
    Hey Amplify Team,

    Quick feature request: Can we please get a precision graph property for shader functions, preferably under the 'General' section of the graph properties when editing the shader function.

    The behaviour of shader functions at the moment (v1.6.7) is that they are always float precision but half precision can be critical for performance of expensive functions on mobile.

    Thanks, I appreciate that you added this option to custom expressions already so keep up the great work !
     
  6. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    434
    Another question since the first one took me so far!

    Is it possible to take a 512x512 texture and map it to a sphere at x/y position as if it were at that position in a larger 4096x4096 image?

    Our setup is a background image, and then images overlayed on top of that which can be turned on and off. The background image is 4096x4096, and currently we're using 4096x4096 overlays where most of it is 0 alpha except for the bit (ie: 512x512) that we want to change, such as adding books to a bookshelf in a specific area. Rather than bringing in a 4k image with mostly 0 alpha, I would rather just crop the image down to the bit that is actually changing, and position it at the exact spot in the sphere it would have appeared at if it were in a 4k image at x/y location.

    This is a background panorama.
    workshop_A_empty.jpg
    This is an overlay 4k image, all we want to change is adding hanging tools the to tool area on the right. This matches up perfectly if applied to a 2nd sphere, but its a LOT of dead alpha texture space, and a waste of file size.
    A_workshop_tools.png

    I want to trim it down to an image that only contains the two needed parts (left and right eye), ie: 512x1024.
    Where this would be the left eye, and Id have the right eye directly under it in the image. I just need to position this exactly where it appears in the 4k image.
    test.png
     
    Last edited: May 26, 2019
  7. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    We do have plans on adding support for sampler states in the near future so, for now, the only two ways around this limitation is to either reduce the amount of textures by packing some of them together or by creating a texture atlas.

    You can pack a bunch of them together as a texture array, which will let you use just one texture asset, the caveat being that all texture import settings between the textures that compose that array must be the same. For instance, if you are packing all 16 textures in there they all must be of the same size, or if one of them is a normal map in linear space they all must be normal maps in linear space.

    We also offer a simple tool to allow you to create your own texture arrays. You can find it at Window>Amplify Shader Editor>Texture Array Creator.


    Hey there, thank you for your feedback and kind words!

    This should be possible to accomplish, I'll register it for the developer to consider in a future update.


    It should be possible to use smaller images to overlay specific areas of your base image, but you'll likely have to manually adjust the position and / or scale through the Texture Coordinates node. Haven't had the opportunity to try this in a VR context myself though.
     
  8. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    434
    I got it working. I couldn't figure out how to manipulate the UVs to only show 1 image instead of repeating, but then I realized its a setting on the texture itself ... it has to be set to clamp instead of repeat. At that point it was trivial to get that going. I thought it had to be done all in the shader which is what tripped me up.

    I played a lot with ASE for personal projects, but this is the first time I was able to use it for work. Very pleased ... I hope you guys keep this going for a long time even with Unity's built in shader graph.
     
  9. sliding

    sliding

    Joined:
    Aug 16, 2017
    Posts:
    3
    Hello.I missed the last sale. When will be next sale?
     
  10. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Thank you for letting us know you've managed to sort it out!

    We can assure you that it's in our plans to continue supporting ASE for the foreseeable future, since we believe that there will always be a demand for unique products with distinguishing features and that we can coexist with Unity's shader graph. ;)



    Hey there, unfortunately we don't have access to this sort of information as the Asset Store sale events are handled by Unity, we simply opt-in when such times come, if given the opportunity.
     
  11. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    Hi.

    I have been using your asset for a long time.

    Why so few new features? Update comes out every 1-2 weeks and fixed bugs.

    You will not continue to develop asset?
     
  12. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, thank you for your feedback!

    Please allow me to clarify that our main focus with ASE is to provide a performant, stable and bug free experience for our users, but we've never disregarded adding additional features, templates or samples, many of them were even suggested by the community.
    In fact, not too long ago we've added support for creating post-processing effects for the stack, offering a specific tool for this while also including a sample.

    As it currently stands, ASE is a very flexible and optimized tool, allowing the creation of standard surface, HD, LW and custom shaders, offering texture array and post-processing tools, several custom nodes, shader functions, ready to use shader templates, over 70 shader effect samples and responsive support, all of this at a very competitive and affordable price.

    We often release a couple of updates per week through our website, just not on the asset store as it takes a while for new builds to be approved, so we usually submit once a week to it, after thorough testing on our end.

    Ever since launch, we've been open to suggestions regarding new features, samples and templates to further increase the value of our asset, but we'll always prioritize bug reports and issues since our tool is already being used by thousands of developers, like you, to whom we want to provide the best and smoothest experience in shader development, rather than a bloated editor riddled with problems.

    If there's any particular feature you feel that's missing or that you'd like to see, please share it with us in a constructive manner and we'll definitely consider it for future updates!
     
  13. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    663
    We bought Amplify Shader Editor and we cannot start using it cause it gives us errors after importing to new HDRP project.

    Unity 2019.1.3f1
    HDRP 5.13.0

    ampl.jpg

    All materials are pink.
     
  14. Amplify_Borba

    Amplify_Borba

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

    Did you extract the correct HDRP template package as per our instructions in the wiki manual or readme.txt file located within the Assets\AmplifyShaderEditor\Plugins\EditorResources\Templates\SRP folder?
     
  15. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    663
    Yes I did imported HDRP package. Shader editor works fine but all example shader are pink (without any errors)
     
  16. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    That's expected as they are Standard Surface Shaders and, as such, are not compatible with neither the LW or HD pipelines. You'd have to manually convert them by switching to the HD template and tweaking their node / parameters setup, but keep in mind that not all of them will be fully compatible with either SRP, and some might require more extensive tweaking while others will just require the reconnecting of the ports.

    We do provide samples that are specific for the HD pipeline, which you may find in the Assets\AmplifyShaderEditor\Examples folder as the HD SRP Samples.unitypackage.
     
  17. JordyJS

    JordyJS

    Joined:
    Jun 8, 2014
    Posts:
    13
    Any way you guys could expose Blend RGB as a parameter? I know we can set Src and Dst but it'd be great to be able to set the blend mode directly for efficient particle shaders. I assume the only other way to do this is through a custom material inspector?

    upload_2019-5-29_14-20-31.png
     
  18. unity_Vx1Sba1dy6s4rg

    unity_Vx1Sba1dy6s4rg

    Joined:
    Feb 5, 2019
    Posts:
    3
    Hey, are you guys planning on supporting the Multi-pass Surface Shader anytime soon? (I've seen in this forum link that you guys plan to support it in the future). Correct me if I'm wrong, but I think it would be trivial to make a multi-pass support of that since you guys clearly have the Surface Shader template working (just duplicate that and it should works right?)

    Here's some of the things I've tried and none works well:
    • Fragment/Vertex Shader template: Make it supports all the default Unity lighting/GI/Light mapping/Shadow (Basically dive into the Surface Shader generated code and try to imitate that), which doesn't work that well since we your template doesn't handle all the conditional preprocessor (#ifdef, #ifndef) that well (when there are potential variants of the v2f struct, "ase_vdata" and "ase_interp" expect a staticly known struct)
    • Try to make the template works with surface shader (clearly doesn't works since it didn't meant to support the surface shader)

    Thank you, and keep up the good work!
     
  19. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    663
    I also imported HD samples but there are more errors after clicking on their material (some previews are black, some pink)

    ampl2.jpg

    Oh man I was hoping it will be nice alternative to shader graph but those errors make me mad for buying it
     
  20. bigbenmatt

    bigbenmatt

    Joined:
    May 30, 2019
    Posts:
    10
    Hi there! I'm encountering a bug when using the light attenuation node in a custom lighting shader. I've seen that multiplying the Attenaution Node at the end of the graph seems to fix this. Here's the thread http://amplify.pt/forum/viewtopic.php?f=23&t=1101.

    BUT i want to add ambient lighting and an uplift contribution after the shadows so the artifact is still there. Is this a known issue/bug or am i just doing it wrong :?

    upload_2019-5-30_10-50-3.png

    upload_2019-5-30_10-47-34.png
     

    Attached Files:

  21. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    38
    Hey, so "Object to View Pos" transforms a point from object space to view space. How do i transform back from view space to object space? I don't see a node that looks like it does that.
     
  22. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Hello, tags can't be altered in the inspector, which is why we can't expose them as parameters.

    You might be able to do so through a custom inspector but, unfortunately, that's out of the scope of ASE.


    Hello, thank you for the kind words and support!

    I can confirm that our template system does not support surface shaders, only vertex / frag, and I'm afraid it won't be a trivial matter to support it. Although it's remains in our plans to look into adding this feature sometime down the road, we can't offer any ETA for it at the moment, apologies for the inconvenience.


    We understand that it might be a bit confusing to deal with the SRP at first, but we can assure you that everything is either working or has a viable workaround.

    Although we know that this is not ideal, we warn users regarding the possibility of errors occuring when importing the templates and samples for the SRP in the 'README SRP Samples.txt' and in our wiki manual, and we do recommend users to read the documentation, as it often prevents the frustration of dealing with these sort of issues.

    The errors that come up in the samples are due to their shaders having been compiled with an older template version, so you'll need to open and compile each material for the shaders to use the current and most up-to-date template and clear the errors. We hope to find a way to somehow automate this procedure but, for now, whenever a shader's template is modified, the shaders will have to be manually compiled.


    Hey there! Could you please send us a simple sample with the issue present to support@amplify.pt so that we can verify if that behavior is expected?


    Hey! You can use the Transform Direction for this, as it transforms a given direction vector between different spaces.
     
    bigbenmatt likes this.
  23. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    38
    Hey, thanks! So if Transform Direction can transform between all spaces, doesn't that include the functionality of Object to View Pos or is there something that Object to View Pos does differently/better?

    Edit: I tried it. It's somehow different. I guess i should use Transform Direction both times.
     
    Last edited: May 30, 2019
  24. StrongCube

    StrongCube

    Joined:
    Nov 22, 2016
    Posts:
    45
    Hello!
    Thank you for your answers on the forum. You're doing great!

    I have a question.

    Mobile Shader. LWRP.

    For which the option "Available Passes - DepthOnly" ?
    I understand what "Passes Available - ShadowCaster" to turn on / off shadows.

    But why "Available Passes - DepthOnly" ?
    Do I need to enable normal Diffuse ?
    Does it make sense to disable it for optimization?
     
  25. bigbenmatt

    bigbenmatt

    Joined:
    May 30, 2019
    Posts:
    10
    Perfect thanks so much for your help!
     
    Amplify_Borba likes this.
  26. Amplify_Borba

    Amplify_Borba

    Joined:
    Jul 24, 2017
    Posts:
    538
    Apologies for my mistake, I suggested the Transform Direction node but instead you should be using the Transform Position for working with the position values!


    Hey, thanks! Apologies but could you please provide additional details regarding your concern and what you're trying to do, as I don't think I fully understood your question?
     
  27. TimothyGrant

    TimothyGrant

    Joined:
    Dec 9, 2013
    Posts:
    31
    I just wanted to say I too am having this problem, fresh install of Amplify but on 2019.1.4f1.

    I've uninstalled and re-installed twice, and continue to get the error.

    The code is clean with no warnings or errors prior to install.
     
  28. Menriet

    Menriet

    Joined:
    Jul 19, 2013
    Posts:
    2
    Hey there ASE people! Fantastic tool you've made here. I'm running into an issue with depth nodes and I'm wondering if you can help?

    I'm trying to make a stylized water shader similar to Wind Wakers water aesthetic. I really like the edges of their water foam effect and I'm trying to replicate it with the Depth Fade node. However, there are some issues that I'm running into. The foam on the edge where water meets ground is only visible when there is geo behind it in view of the camera, so around some corners the foam gets cut off (circled in red). Ideally, it would look like it continues around the corner.
    help.jpg
    I think this is happening because (and correct me if I'm wrong) the Depth Fade node grabs the information from the depth buffer of the camera you are using. I'm wondering if there is a way to create an alternate depth buffer for this particular shader from some sort of orthographic top-down camera and feed that depth into the node to get some of that foam to reach around the corners? Let me know if this is feasible or if you guys have any better ideas!
     
  29. Gollunk

    Gollunk

    Joined:
    Oct 19, 2014
    Posts:
    41
    Hi,

    I just bought Amplify Shader and i have somes questions :

    1) I saw that a sample pack was available. Where can i find it ? Is there a sample pack for HDRP somewhere ?

    2) Also for some reason i deleted the Amplify Shader Asset and reimported it, moreover i reused the HDSRPTemplates asset to get the HDRP templates but i can't see the "HDSRPLit" (and others) shader templates anymore when i want to create a new shader.
     
  30. JordyJS

    JordyJS

    Joined:
    Jun 8, 2014
    Posts:
    13
    I'm not sure if this has been posted yet but there appears to be a bug as of late where when you open a shader in ASE for the first time the default selected field is the shader's name, which results in a lot of accidental renaming when trying to bring up the node menu.
     
  31. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    465
    This might be happening because if a class name conflict over your project.
    Please check if you don't have any class named Asset on your project which might not be inside a proper namespace.

    Thank you for such kind words. Yes, the Depth Fade node uses both the depth value written over the depth buffer and the fragment's current depth to calculate a fade value.
    You can create your own depth buffer and feed it into ASE via a 'Texture Sample' node. You may also need to feed some kind of transform matrix so you'll be able to create a proper uv value to fetch the correct values from that buffer.

    1) All ASE samples are inside the AmplifyShaderEditor > Examples folder. Over that folder you'll find the HD SRP Samples.unitypackage, which contains our current HDRP samples.

    2)For you to be able to use our HDRP templates you'll need to unpack the AmplifyShaderEditor > Plugins > EditorResources > Templates > SRP > HDSRPTemplates.unitypackage. Please notice that you should unpack this package before unpacking the samples I mentioned earlier.

    This is quite annoying indeed. We'll try to replicate the issue on our end and fix it.
     
  32. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    9
    Hi, I think I've discovered a bug with the Blend Operations > Overlay Type. When using this node and passing a 128 value grey into it - it will darken the output. This can be done with an empty texture sample set to Grey, or a 128,128,128 bitmap. I would expect this to output no visible change. It seems like the mid value is at about 180,180,180.

    I'm using 2019.1.2f1 with a project set to Linear color space. Checking 'Gamma' in the texture sample attributes makes no difference.

    Is this expected, am I doing something wrong?
    Help would be appreciated thanks.
     
  33. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,385
    Hello there!

    Can you send us your shader so that we test the same conditions on our side?

    Thanks!
     
  34. Gollunk

    Gollunk

    Joined:
    Oct 19, 2014
    Posts:
    41
    2) Thank you for the reply but this point seems to be misunderstanded : as i said, for some reason i deleted the Amplify Shader Asset in my project and reimported it (before that i did import the amplify shader asset for the first time and did the unpacking that you are talking about). Since i have done that, and after unpacking the AmplifyShaderEditor > Plugins > EditorResources > Templates > SRP > HDSRPTemplates.unitypackage i can't see anymore the shader templates when i do Create > Amplify Shader (i see only Surface, Unlit and Legacy). I tried on a new project and the same issue occure.

    Thank you.
     
  35. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,385
    Hey there, allow me to step in for a quick question. Do you see it in the actual editor when changing the Shader Type?
     
  36. Gollunk

    Gollunk

    Joined:
    Oct 19, 2014
    Posts:
    41
    Yes ! I did not notice this option in the actual editor. Thanks a bunch ! If i can change the shader type like that it's not a problem anymore.
     
  37. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,385
    Ah, good to know! This might just be a UI related issue, our developers will check it our as soon as possible.
     
  38. Gollunk

    Gollunk

    Joined:
    Oct 19, 2014
    Posts:
    41
    Problems remains : no SRP HD templates work correctly with the kind of error message below. I also noticed that every pack make Unity crash when i unpack them.

    Shader error in 'ASESampleShaders/SRP HD Material Types/Specular': 'InitBuiltinData': cannot convert from 'float' to 'struct PositionInputs' at line 263 (on d3d11)

    Compiling Fragment program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
     
  39. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    9
    Hi, have sent the shader via email to support
     
  40. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,385
    No problem, but this is another problem.

    -Are you using the latest ASE?
    -What's your current Unity and SRP version?
    -Which one of our HDRP packages did you import?

    Thanks, we'll have a look as soon as possible.
     
  41. Gollunk

    Gollunk

    Joined:
    Oct 19, 2014
    Posts:
    41
    I must to thank you for the fast replies.

    - Yes it is the latest ASE
    - Unity 2019.1.3f1 and HDRP 5.16.1 (i just switched from 5.13 to 5.16)
    - I imported the HD SRP Samples package

    [Edit] : I just installed the Core RP library 5.16.1 but it doesn't make it better.
     
    Last edited: Jun 3, 2019
  42. themdubs

    themdubs

    Joined:
    Jan 12, 2014
    Posts:
    22
    It seems that Grab Pass lacks support for single pass instanced rendering. I needed to add/change the following lines to get it working. I'm not certain if all of these are necessary as I didn't test it too much, but once these were added it was properly rendering.
    Code (CSharp):
    1. ...
    2. UNITY_DECLARE_SCREENSPACE_TEXTURE(_GrabTexture); // ---- new line
    3. //uniform sampler2D _GrabTexture; --- old line
    4. ...
    5. v2f vert ( appdata v )
    6. {
    7.     v2f o;
    8.     UNITY_SETUP_INSTANCE_ID(v);
    9.     UNITY_INITIALIZE_OUTPUT(v2f, o); // ---- new line
    10.     ....
    11. }
    12.  
    13. fixed4 frag ( v2f i ) : SV_Target
    14. {
    15.     UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); // ---- new line
    16.     ...
    17.     float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
    18.     float2 ase_grabScreenPosUV = UnityStereoTransformScreenSpaceTex( ase_grabScreenPosUV.xy ); // ---- new line
    19.     fixed4 screenColor2  = UNITY_SAMPLE_SCREENSPACE_TEXTURE( _GrabTexture, ase_grabScreenPosUV ); // ---- new line
    20.     //float4 screenColor2 = tex2D( _GrabTexture, ase_grabScreenPosNorm.xy ); ---- old line
    21. ...
     
  43. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    Hi.

    Mobile shaders. LWRP.

    I use your Unlit LWRP template.

    That SRP batching would work, parameters should be in such wrapper:

          CBUFFER_START(UnityPerMaterial)
    half _Power;
    half4 _Color;
    CBUFFER_END


    but your asset ignores this and does so:
          half _Power;
    half4 _Color;


    Although most documentation Unity clearly stated that it worked SRP batching, you need the parameters to include in the block CBUFFER.

    I have after each compilation of the shader, go hands to fix.
     
  44. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    465
    Unfortunately our shaders don't automatically adapt to which HDRP version you have currently installed. The sample on which the error is occurring was created on a previous version thus is throwing that message.
    You just need to open those shader files on ASE with our correct template installed and recompile them. The errors should then go away.
    We'll update these samples on a future build so no errors are thrown.

    Thank you for pointing that out. Rest assured that we'll have it fixed on a future build.

    Set the respective property nodes Type to Instanced Property and they will be created inside the UnityPerMaterial CBuffer.
     
  45. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    195
    Hello,

    Many post effects rely on motion vectors and when custom vertex animation is used in a shader, that animation is not written in the motion vector buffer. Would it be possible to add a Motion Vector Pass (with an option to enable/disable it) for surface shaders when custom vertex animation is used?

    Thanks!
     
  46. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    465
    Hey @BOXOPHOBIC, that's a really neat idea. You can add a motion vector pass into a surface, we need to only figure out how to let the user specify the correct value to be written on the buffer.
    We'll register your request and tackle it as soon as we can.
     
  47. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    146
    I use the Blend node a lot and I'm concerned about performance, especially for mobile. Is there a performance difference between the different blend operations? Does it matter if I use Hard Light instead of Multiply?
     
  48. JamesHorn

    JamesHorn

    Joined:
    Jan 10, 2019
    Posts:
    2
    Hi,

    I'm working on a water shader and having issues with Depth Fade not working on Nintendo switch builds compared to PC. Looks like the Convert to linear option is whats stopping it working. Not sure if I've done this the wrong way or its an issue.
     

    Attached Files:

  49. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    465
    Each Blend Mode vary a bit on its performance cost, but overall it should be safe to use under a mobile environment.
    Regarding both blend modes you mentioned, Multiply is more performant than Hard Light since it only does a multiplication between the channels as the other has more math operations involved. But again both of them should not have a big impact when used on mobile.

    The Depth buffer is written in different stages when working with either consoles or PC.
    On PC this buffer is written after all opaques are drawn as this doesn't happen on consoles ( not sure what which stage though).

    What this means is that nodes like Depth Fade won't work under a normal context as when the fragment is being rendered it is also written on the depth buffer ( even when on the Transparent Queue ).
    The solution comes by separating the shader into two, and adding both into the mesh renderer material queue.

    The first one must have ZWrite Off and its Render Queue must be under the Geometry range of values.
    This shader will be the main one where you use depth fade, apply refraction, etc.

    The second one only needs to write on the ZBuffer ( ZWrite On ) thus its color mask should by set to all channels so no color is written (ColorMask 0). Place its render queue at the very end of the Alpha Cutout (AlphaTest+49) range so it renders after all the objects it needs to.

    Something like this:

    Code (CSharp):
    1. Shader "DepthOnly"
    2. {
    3.     SubShader
    4.     {
    5.         Tags{ "RenderType" = "Opaque"  "Queue" = "AlphaTest+49" "IgnoreProjector" = "True" "ForceNoShadowCasting" = "True" "DisableBatching" = "True" }
    6.         Cull Back
    7.         Pass
    8.         {
    9.             ColorMask 0
    10.             ZWrite On
    11.         }
    12.     }
    13. }
    This is not a perfect solution by any means, as it has its flaws, but it may fix your problem.
     
    JamesHorn likes this.
  50. Gollunk

    Gollunk

    Joined:
    Oct 19, 2014
    Posts:
    41
    Hello,

    I'm trying to convert the "SimplePotionLiquid" sample to HDRP but this one need the opacity channel and i can't find a equivalent channel with the HD Lit shader type. Is it even possible ?

    I tried with the alpha channel (i think that it's the equivalent channel) but it doesn't do the job.

    Edit 1 : The transparent surface type does'nt seems to work.
    Edit 2 : The transparent surface work with the Standard material type
     
    Last edited: Jun 6, 2019