Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

[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. PeterTo_Auroch

    PeterTo_Auroch

    Joined:
    Nov 3, 2022
    Posts:
    1
    Hi! We are using Amplify for our project but are currently having issues where Amplify is causing failure in our automated build pipeline. Do you mind giving us a hand in resolving this? Here's a summary of the issue we're facing:

    ---

    Issue Summary

    Unity Version: 2022.3.6f1 (LTS)


    Our team is using TeamCity for our automated build pipeline. Within the build pipeline, we invoke Unity in batch mode to create a build.

    Although the build itself was completed successfully, and Unity successfully created the artifacts(i.e. the
    .exe
    file and the like) we needed,
    ASEPackageManagerHelper
    is throwing
    NullReferenceException
    after the build is completed and Unity is attempting to shut down. Relevant logs are as follows:

    Batchmode quit successfully invoked - shutting down!

    Start importing ProjectSettings/ProjectSettings.asset using Guid(00000000000000004000000000000000) Importer(-1,00000000000000000000000000000000) -> (artifact id: '6936e1e0fda63e6a0f7006fef4cf4e2d') in 0.003258 seconds

    NullReferenceException: Object reference not set to an instance of an object

    at AmplifyShaderEditor.ASEPackageManagerHelper.Update () [0x00038] in D:\BuildAgent\work\41cf0519bb6951e5\FAKE_PROJECT_NAME\Assets\AmplifyShaderEditor\Plugins\Editor\Utils\ASEPackageManagerHelper.cs:406

    at AmplifyShaderEditor.TemplatePostProcessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) [0x00006] in D:\BuildAgent\work\41cf0519bb6951e5\FAKE_PROJECT_NAME\Assets\AmplifyShaderEditor\Plugins\Editor\Templates\TemplatePostProcessor.cs:30

    at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)

    at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <eef08f56e2e042f1b3027eca477293d9>:0

    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

    at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <eef08f56e2e042f1b3027eca477293d9>:0

    at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <eef08f56e2e042f1b3027eca477293d9>:0

    at UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00033] in <347e3e2bef8c4deb82c9790c6e198135>:0

    at UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets, System.Boolean didDomainReload) [0x00116] in <347e3e2bef8c4deb82c9790c6e198135>:0

    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)

    UnityEngine.DebugLogHandler:LogException(Exception, Object)

    UnityEngine.Logger:LogException(Exception, Object)

    UnityEngine.Debug:LogException(Exception)

    UnityEditor.AssetPostprocessingInternal:postprocessAllAssets(String[], String[], String[], String[], String[], Boolean)

    After some investigation, we found that:

    1. TemplatePostProcessor.OnPostprocessAllAssets
      is triggered after the Unity Editor tries to shut down, this can be observed in the above log, where the
      NullReferenceException 
      is thrown after the following log message:
      Batchmode quit successfully invoked - shutting down!

    2. The
      NullReferenceException
      is thrown as
      m_packageListRequest.Error
      is not null - we can observe that the
      errorCode
      is
      Unknown
      and sadly there's no error message provided by Unity.
    3. Package Manager's log(
      %LOCALAPPDATA%/Unity/Editor/upm.log
      ) doesn't seem to have anything abnormal - all request ends with
      200
      and is responding within a reasonable timeframe( ~200 - 400 ms).
    4. The exception isn't always thrown and only happens approximately 9/10 times.
    We are not sure what the root of the issue is - was it the case that the package manager should have never returned an error, and the fact that it is implies we need to work on making sure it never returns the error in the first place, or this the case where we need to make sure when there's an error it needs to be handled gracefully?

    Any input/clarification on how we should fix this will be greatly appreciated! This is a major issue for us as it is blocking our automated build system from working, and is hence significantly affecting our team's productivity.
     
    Last edited: Oct 4, 2023
  2. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    Hello, thank you for the detail report.
    can you verify you're in the latest Amplify Editor?
    we fixed a number of similar issues in the latest editor revisions so checking your current version could be helpful for our team.

    edit
    please reach out to me asp thru email or discord so i can try to get this in before end of week
     
    Last edited: Oct 4, 2023
    PeterTo_Auroch likes this.
  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,913
    Fixed by switching the Render Type from "Opaque" to the "Tree Opaque" in the shader settings

    Thanks for this amazing shader editor
     
    Amplify_David likes this.
  4. XiongmaoHZH

    XiongmaoHZH

    Joined:
    Dec 21, 2021
    Posts:
    8
    Hello, would you like to ask when ASE will support the limit on the number of additional light sources under the forward+ path of URP? Now if the rendering path is selected as forward+, the shader edited by ASE will flicker and freeze, and only supports eight light sources.
     
  5. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    hello please reach out to me in discord or thru email with a bit more info
    please also verify you're in the amplify latest editor version and how to replicate.

    edit
    also, please can you download and test with the demo scene in amplify shader pack.
    this pack is free to download if you already own copy of the editor.
     
    Last edited: Oct 15, 2023
  6. Nicopol

    Nicopol

    Joined:
    May 30, 2020
    Posts:
    4
    Hi, I've a question regarding shader variants:
    I'm building a custom lighting material and I would like to be able to enable or disable some properties depending on the material.

    I'm using static switches but:
    1. I'm not sure if by disabling the property I'm actually avoiding calculating it within the material. Is it true?
    2. Also I would like the properties inside the shader function not to be displayed when the switch is off. how?
    3. The guide mentions the possibility of exposing "two sided" as a property within the inspector, how to do it?

    upload_2023-10-17_12-49-32.png
    here my setup (URP Unlit)

    Thanks in advance for your answers.
     
  7. thang_unity516

    thang_unity516

    Joined:
    Oct 29, 2021
    Posts:
    43
    Hi, I've a question about shader variant and static switch node

    As shown as the image below, I have A and B flow switched by the QUALITY_HIGH keyword and it works fine. upload_2023-10-18_11-31-20.png

    But then when I check the code generated, it only switch the result of the calculation, not all of the flow. So one of the flow still calculates for the other one though it uses one result only, right? If that the case, how can I fix it?
    upload_2023-10-18_11-32-21.png

    Thanks for your help
     
  8. KenanTheFab

    KenanTheFab

    Joined:
    Apr 29, 2018
    Posts:
    8
    Hello, I'm attempting to create a sprite shader with transparency to give it a flowing effect which has been going great except for one little hitch: it does not account for the sprite/object's size upload_2023-11-1_7-58-10.png
    I've tried incorporating the Object Scale node several points (so it is absent, however I attempted to plug it into the tiling input in the Texture Coordinates node you can find between the Append and Noise Generator nodes. but it appears to have done nothing.
    upload_2023-11-1_7-59-39.png
    Here is the current node setup for reference (apologies for the mess.)

    Edit: never mind. it did work but there was a bug that just sort of... cancelled it from working if another object used the material lmao
     
    Last edited: Nov 1, 2023
    Amplify_David likes this.
  9. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,850
    Does anyone have any idea how to stretch only the bottom vertexes of a mesh downwards? I tried vertex offset by using vertex position Y but it still stretches the top and Idk how to mask it.
     
  10. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    144
    Take this object space Y and put it through a gradient. You can say that bottom 10% are affected, the rest is not. http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Gradient
    Or just write your specific mask into vertex color of a mesh.
     
    florianalexandru05 likes this.
  11. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214
    1. I'm not sure if by disabling the property I'm actually avoiding calculating it within the material. Is it true?
    2. Also I would like the properties inside the shader function not to be displayed when the switch is off. how?
    3. The guide mentions the possibility of exposing "two sided" as a property within the inspector, how to do it?

    For a longer discussion its bets to reach out in the amplify discord for any chat.
    For item 3 i suggest have a look at the amplify shader pack examples.
    This extra pack is free to download if you already own copy of the editor.
     
  12. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    we had similar reports that the key words for Quilty levels do not work as interned in certain unity versions.
    i open a ticket to investigate this more
    Bug - Material Quality Node not working in HDRP URP · Issue #165 · AmplifyCreations/AmplifyShaderEditor-Feedback (github.com)
     
  13. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    I suggest reach out in discord for any sort of longer discission in Realtime chat.
    we would need a bit more info to know what you're looking at.
     
    florianalexandru05 likes this.
  14. cydashnine

    cydashnine

    Joined:
    Jul 15, 2022
    Posts:
    3
    I had an issue with shadow artifacts appearing when using a combination of a `Lit.shader` based shader with tessellation enabled interacting with point light shadows (along with URP deferred, in case that matters).
    I narrowed it down to the light direction being fed into the shadow bias function in the ShadowCaster pass was using the directional light path instead of the point light path for the domain shader (the vertex shader was correct). This was because the template has
    `#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW` which allowed the vertex shader to compile the point light variant but not the domain shader (which shares the `VertexFunction` containing the conditional code in question). Adding `#pragma multi_compile_domain _ _CASTING_PUNCTUAL_LIGHT_SHADOW` fixes the issue.

    Hoping this may be useful to someone else with this problem or perhaps this might be a change that could be made to the default template so others don't run into this.
     
  15. r8zbeh

    r8zbeh

    Joined:
    Dec 4, 2018
    Posts:
    41
    HI there! I wanted to create a standard lit shader that has an additional input map for baked lights. (lightmaps baked outside unity, in 3D modeling app), which obviously means I won't use unity light baking system. but I want to get Realtime lights to work (like directional lights)
    I watched developers YouTube tutorial on custom lighting like : Amplify Creations Dev Stream #3 - Custom Lighting Breakdown (SRP+Built-in) - YouTube
    I worked with custom lighting model, and did some experiment with "StandardSurfaceLight" node, but they were no help.
    Could you guide me how can I achieve that?
    thanks in advance
     
  16. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214
    Hello
    I suggest download and have a look at the samples for baked GI in the amplify shader pack.
    this pack is free if you already own copy of the editor.
    https://assetstore.unity.com/packages/vfx/shaders/amplify-shader-pack-202484#releases

    sadly, the unity asset store page is with issues today so you may need to wait for unity to fix that ;)
    if still problems feel free to ask detail questions in the discord
     
  17. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    Hello, the shadow issues with tessellation you describe sound like a common issue that can be fixed with vertex reconstruction.

    Have a look at Dev Stream #6 that will help explain.
     
    hopeful likes this.
  18. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    86
    Last edited: Nov 17, 2023
  19. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214
    No we do not support this out of box, and you would need to make and add a custom pass.
     
  20. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    218
    Hello, I got some shaders made with amplify, and - very curiously, when installing Visual Effects Graph into the project, the shader bugs out and starts producing shadow artifacts that are randomly flickering across the mesh.
    It's only that 1 specific package from Unity breaking said shaders, and those are the only amplify shaders I'm using in this specific project.

    Any ideas what might be happening here?
    Unity 2022.3.13f1 running URP.

    The second picture shows the issue where the leaves are covered in shadow - which flickers or "flies" across the leaf mesh.


     
  21. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    Hello, thank you for the report.
    after testing i have not been able to replicate the issue.
    can you reach out to me in email or discord and send me, if possible, a small repo?

    David
     
    Bwacky likes this.
  22. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,100
    I upgraded my project to Unity 2023.2 and I'm using ASE version 1.9.2.2
    My shader started to have Error:
    undeclared identifier 'multi_compile'
    And my material gives pink result.

    I was resaving it and reimporting but no positive result.
     
  23. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,100
    It's this shader that generates undeclared identifier 'multi_compile'
     

    Attached Files:

  24. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    no errors found when opened on my side.
    Unity 2023.2.1 HDRP

    looking over the above attached i do see one thing out of place in that somehow you ended up with incorrect stencil and data in GBuffer pass
    upload_2023-11-26_14-5-2.png


    in some rare case if a shader was made in a very old version and ported up this has happened to others.
    To clear this bad meta and force the compiler to look at the template inline data first please find and open (Preferences /Amplify Shader Editor) then check the box "Force Template Inline Properties" and recompile.

    After compile, please remember to uncheck turn off force inline properties.
    upload_2023-11-26_14-12-6.png
     
  25. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,100
    I did as you said, I checked "Force Template Inline Properties" re-saved the shader, reimported and it did not work.
    But I also duplicated the file, and duplicated file does not return the error.
    I'm comparing the files and they are identical except of the name (changed since I have them in same directory) and checksum.
     
  26. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,100
    So this duplicated material again started to return this error when I used it for the material.
    I'm not sure if this is ASE or Unity error anymore, I'm sending you material with a shader if you want to check it.

    What is worth mentioning is that in Inspector preview I got this material displayed not pink.
    Prefab edition shows it pink. And in game it was looking buggy but started to look properly :O !
     

    Attached Files:

    Last edited: Nov 26, 2023
  27. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    yes, sorry no errors reproduced yet.
    if it continues, please reach out to me in discord so we can chat about other settings to try to reproduce on my side.
     
  28. Saradora

    Saradora

    Joined:
    Jun 2, 2021
    Posts:
    2
    Hello, I've recently updated to 1.9.2.2 with the "Fixed" flipbook shader function and what used to be a perfectly functional shader now is completely broken :c

     
  29. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    sorry for the problem
    it looks like some old math was left in the function.
    please find attached.
    if continued problem please reach out to me in discord

    edit
    flip book function is fixed and should be in the next ase update.
     
    Last edited: Dec 2, 2023
  30. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,100
    Sorry to bother you like this, but I have made further investigation, and i discovered some more details.
    Basically the error happens when I enter edition of prefab that is using this shader and select unlit mode.
    Please take a look at this video:
    There is a long pause from about 0:35 this is the moment when i go to the Library/ShaderCache/shader search for my shader and delete cache. Than I do reimport but context menu don't show on the video. After reimporting the shader have no error again, until I again go to prefab edit mode and select Unlit Draw Mode.

    This is in:
    Unity 2023.2.1f1
    ASE 1.9.2.2



    Please respond if you were able to replicate this error.
     
  31. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    Thank you I am able to reproduce this error and also see the source.
    for your tracking I opened git item #246
    https://github.com/AmplifyCreations/AmplifyShaderEditor-Feedback/issues/246
     
    hopeful and koirat like this.
  32. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214
    fixed
    if you need it ASAP, please reach out to me in discord.
     
  33. sky_haihai

    sky_haihai

    Joined:
    Oct 24, 2016
    Posts:
    1
    Hi devs,
    We are experiencing an error in shader compiling while building addressable bundles. The shader works well in editor mode, the error only occurs when I try to compile the shader.

    Shader error in 'ToonFlipbook': undeclared identifier '_BlendMode' at /skyha/Documents/Github/ProjectTerra/PTerra_Unity/Library/PackageCache/com.unity.render-pipelines.high-definition@12.1.8/Runtime/Material/Material.hlsl(51) (on d3d11)



    unity version: 2021.3.16f1
    hdrp version 12.1.8
    ase version: 1.9.2.2

    Thanks in advance
     

    Attached Files:

  34. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    hello, thank you for the report.
    i will check this and get back to you soon.
    this _BlendMode is usually related to decals.
     
  35. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    Hello
    I was not able to replicate the error.
    Please can you send me in private (Email, Direct Message, or Discord) a copy of the shader and share all material settings used so i can try to replicate it again.


    thank you.
     
  36. androo-c

    androo-c

    Joined:
    Nov 21, 2017
    Posts:
    9
    Hi,

    I was looking for a good way to reuse sampler states but still have it be configurable without changing the shader source. I tried to put some sampler states behind a static switch and got an error to say that the output of the switch (FLOAT) was incompatible with the input of the texture sample (SAMPLERSTATE).

    ase-ss-switch.png

    I was wondering if this was a technical limitation, a bug, or something else? I can do it with a custom expression if needs be, but I'm trying to keep as much as possible in graph form.

    ASE 1.9.2.2 / 2023.2 / URP 16

    Cheers!
     
  37. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214
    For use a configurable method best to do this from the sample aka source texture
    if you wish to share the configurable to others a register node will pass that to the other inputs
    upload_2023-12-9_7-41-49.png


    Sampler State Node is useful for locking a filter or a mode into a sample
    Filter - Defines filtering mode for sampling
    --- Point
    --- Bilinear
    --- Trilinear
    Wrap - Defines wrap mode for sampling
    --- Repeat
    --- Clamp
    --- Mirror
    --- MirrorOnce
    --- Per-Axis
    * U axis
    * V axis
    upload_2023-12-9_7-43-14.png
     
  38. androo-c

    androo-c

    Joined:
    Nov 21, 2017
    Posts:
    9
    Thanks for the reply!

    Sorry I should have stated my use case. I created an "uber" shader with different modules/layers that can be toggled on and off. It works great except that for some of my more complex materials I am running out of sampler states. I previously did what you suggested and took the sampler state from eg the albedo texture, and also used it for eg the normal, maskmap and emission of a particular module/layer. This also worked great until I ran into use cases where I was just using a base colour instead of sampling from the albedo texture and therefore the wrong sampler state would be used for the other textures.

    That is why I was wondering if there was any technical limitation to using a sampler state with a static switch. If there is it's ok, I probably just use a custom expression node instead.

    Cheers
     
  39. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    sorry yes, the sample state has some limitations for nodes it can pass thru.
    i will check into it for the static switch.

    note
    in order to not break the Mip Chain with in GPU avoid sharing SS between fragment stages, in most cases 3 SS sets can be used as follows and you should be safe.

    --- SS (BaseColor)
    This is safe to share with anything not listed below such as metallic, smoothness and emission.

    --- SS (Normal)
    keeping normal maps in its own SS will have improved quality and not break mip mapping

    --- SS (Vertex Position)
    avoid sharing anything using vertex position such as height maps and or parallax with the SS used for Base Color or normal mapping.
     
  40. androo-c

    androo-c

    Joined:
    Nov 21, 2017
    Posts:
    9
    Oh that's super useful to know, thank you very much!
     
  41. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    602
    Hi there, any idea why adding the selected Blend Normals node is causing a duplicate naming issue? If I remove it or reduce the nodes it starts working again.

    Unity 2022.3.15f1 and ASE 1.9.2.2.

    upload_2023-12-18_23-57-8.png
    upload_2023-12-18_23-56-6.png
    upload_2023-12-18_23-58-44.png
     
    Last edited: Dec 19, 2023
  42. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    No Can you send me copy of the shader to reproduce.
    thank you.
     
  43. Bovine

    Bovine

    Joined:
    Oct 13, 2010
    Posts:
    195
    Hi There

    I am wanting to use lightmaps while add some custom lighting over the top. However, I understand that when lightmapping a particular pass of any shader is used to render when generating and so I am wondering if I need to create a pass that Unity can use for this purpose. Is this something that is possible? How should I go about creating such a pass and ensuring it is used for baking lightmaps only?
     
  44. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    602
    Hi! Thanks for the reply. Yes, but the current shader is massive and has multiple includes.
    I will try and get a minimum version to you in DMs.
     
    Amplify_David likes this.
  45. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    438
    Amplify Wiki site on maintenance? cant get there 2 days.
    upd: site still dont work.
    may be there is some PDF version of manual?

    upd: got back. thanks!
     
    Last edited: Dec 25, 2023
  46. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    602
    So~ I'm working on making the same massive shader graph cleaner and more modular by breaking it apart into HLSL and Amplify Functions. I haven't been able to reproduce the issue while using less blend nodes.

    upload_2023-12-25_19-37-10.png

    I've wrapped a major segment of the graph into an Amplify Function with function switches.

    upload_2023-12-25_19-50-48.png

    But obviously I want to avoid having to do this for every static switch:

    upload_2023-12-25_19-50-34.png

    And some of these variations may be expensive, I don't want to simply toggle them by stepping or boolean.

    Is there a way to route static switches into an Amplify Function's switch?

    So that it's compiled output depends on the static switch? If this is not a feature, it would be really useful to have. The above function wrapping was meant to clean things up but so many variants are prone to bugs with that many nodes.

    I can use a Fetch static switch inside the ASE Function to guarantee 'synchronization', but this would prevent reuse if I want other variants, and still isn't as clean as I'd like because I still have to manage the keyword names by pasting them in to each Fetch node.
     
    Last edited: Dec 26, 2023
  47. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    214

    you're heading in a good direction.
    yes, the function's switch is currently the only switch that will fully remove the code behind it for unselected path.
    this function switch can be selected to Reference to other function switch within the same function graph. sadly it does not have a broadcast option "yet" .
    see Register Local var in sub graph aka broadcast · Issue #86 · AmplifyCreations/AmplifyShaderEditor-Feedback (github.com)

    for my workflow i follow a similar path by making functions into 3 types
    --- core functions, the final main function that contains all subfunctions and has the main list of function switch's, this core function connects directly to the master block on templates
    --- modules, complete functions that can be added onto any of the core functions
    --- the building blocks, all other functions used for build shaders

    for a subfunction with multiple selections rather that have switches in give multiple outs for each variant then set the function switch inside the core function so it easy to select from one location.
     
    MirzaBeig likes this.
  48. MirzaBeig

    MirzaBeig

    Joined:
    Dec 27, 2014
    Posts:
    602
    Thank you :)

    I was hoping there would be a way to route into the function, but at least for now, since I don't have a pressing need to be overly modular throughout the project, I'll stick with the static Fetch method.
     
  49. RedEarth

    RedEarth

    Joined:
    Nov 4, 2016
    Posts:
    23
    Hi, sorry for the inexperienced question, but I'd like to use a noise via triplanar. Is this a good idea or a potential perf killer? Also, how would I go about setting it up using ASE? I've asked on the discord channel as well.

    The problem I'm trying to solve is to project a tiling voronoi noise around a sphere for an effect. Is there a better/faster solution that I'm not aware of? My day job is making landscapes and procedural systems, so shaders are a bit of a mystery currently so any insights would be helpful. Thanks!
     
  50. RedEarth

    RedEarth

    Joined:
    Nov 4, 2016
    Posts:
    23
    I've solved it using a triplanar shader function that uses a voronoi noise instead of a texture sample. But from a perf standpoint, is this bad practice/a bad idea?

    Thanks!