Search Unity

  1. Unity 2019.2 is now released.
    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. danimarti

    danimarti

    Joined:
    Oct 22, 2016
    Posts:
    15
    Hi everyone! I'm very new using Amplify Shaders and I'm struggling with something I think it's very basic. I tried to look in the documentation and for tutorials but I still haven't figured it out.
    I want to create a circle mask that works in screen space, the circle is in the middle of the screen and only shows the content in that area. My issue is by creating the mask and placing it in the middle of the screen... do you know any tutorial or resources I can look at to achieve this effect? Thanks so much!
     
  2. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Ah good, than it's more of a conversion issue here. I'll have to check it out, I don't think it's something you can convert just by changing the shader type but I will check with the developer that created it.

    That's odd, seems to be working on my end using our sample. Just to be absolutely sure, you're using a default shader with just the color, correct?

    The ASE developer is aware of the reported issue and will run additional tests as soon as possible.

    We appreciate your patience, thanks!

    I'll have to pass that on the developer, it's not something I have tackled before.

    Thanks!
     
    Last edited: Jul 23, 2019
  3. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Greetings,

    It's really going to depend on how you intend to use this mask. Is it for something like a vignette or another type of effect?
     
  4. Pancar

    Pancar

    Joined:
    Mar 11, 2013
    Posts:
    22

    Thank's Ricardo, i'm waiting to your good news.
     
  5. danimarti

    danimarti

    Joined:
    Oct 22, 2016
    Posts:
    15
    Hi! Thanks for your quick reply. I build a dissolve shader that dissolves an object based on the distance between the camera and the object, but I want to limit that to only objects that are in the middle of the screen and at certain radius from the center. I'm trying to replicate something like this.
     

    Attached Files:

  6. danimarti

    danimarti

    Joined:
    Oct 22, 2016
    Posts:
    15
    I managed to get here but I'm sure there is a better way to do it, or maybe more performant:
     

    Attached Files:

  7. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    201

    hey man that's amazing! I get it is very simple to separate rendering in a per-eye basis with that node that returns 0-1 depending on which eye is being rendered. I wonder if you can give me some insight on the other part of the challenge, which is taking depth from a texture (for example taking the a channel of the mainTexture or maybe a separated grayscale texture) and replacing the depth buffer with this depth so we can do something "similar" to what Amplify Impostor does and have a full 3D depth representation of the original rendered scene.

    I guess that will come with some limitations suchs as not being able to show transparent materials in the 360 render (since these don't write to depth) but I can imagine lots of uses for this, one is what you already told, having the 3D cursor "raycasting" to the real scene depth, other uses for my are blending the 360 image with realtime meshes moving and animating on screen, even simulating DOF effects since the post effects will see the gbuffer with full depth.

    thanks a lot!
     
    Amplify_Ricardo likes this.
  8. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    341
    Any idea what I should be doing relative to this happening on first importing Amplify Shader Editor into my project (HDRP):


    Shader properties can't be added to this global property sheet. Trying to add _GrabTexture_HDR (type 1 count 1)
    UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object, Object[], String)

    (52 times)
     
  9. cyuxi

    cyuxi

    Joined:
    Apr 21, 2014
    Posts:
    33
    hi, I think the dynamic feelling of carving the hole should be based on the distance between camera and pixel world position. I have only done the part of making a hole, the rest of features should be easy to add on after this.
    2019725-星期四-151203.jpg 2019725-星期四-151210.jpg
     
  10. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    I hope to have some news soon, I'm a bit overloaded at the moment but I will look into it as soon as possible.

    The SphereMask Shader Function would be ideal for that type of effect.

    upload_2019-7-25_12-17-4.png


    Sounds like it could be related to the Legacy samples, that is expected; we include specific HD and LW basic samples in individual packages.

    I noticed a similar post on our Discord, is it yours by any chance? If so, has the problem been resolved?

    Thanks for helping out.
     
  11. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    125
    The editor view (top) does what I want : Local scale of a cube.
    The game view (bottom seems to do it on a global scale.

    Not sure how I can correct that.

    Can be seen here: https://i.imgur.com/14TWV42.mp4


    This is the shader:
     
  12. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    414
    To be honest, we only use 3d for very simple things that are more gui related for this project, so I havent even thought about using the depth texture and writing it to the depth buffer. All Im doing is creating another mesh thats the same size as my panorama sphere, adding a mesh collider, and raycasting to get the UV. I translate that into the uv of whatever depth texture Im over (I have layers of images that can be turned off and on, so i bounding box then pixel test to find the front most layer that tests positive) and then get the linear grayscale value. Each panorama has a min and max unit range, so i map the 0-1 grayscale value to that range and just move the vr pointer to that distance along the controllers forward vector. Very simple but works pretty well.

    Using the depth buffer is something I never thought of, but im very intrigued and suspect ill try that on the next vr project if we have enough reason to!
     
    Cleverlie likes this.
  13. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Have you tried changing the Vertex Output type?
     
  14. danimarti

    danimarti

    Joined:
    Oct 22, 2016
    Posts:
    15
    Hi Ricardo, thanks! I see this solution works on 3D and needs a position in the World. I have been trying to make it work but I'm failing. Is there a way I can put the mask in the middle of the screen?
    By the other hand, do you have any suggestion about recreating the metaball effect? Thanks so much!
     
  15. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    You can double click that shader function to see how it works. You can also grab the screen position, it might be a good place to start. However, you could define the location of the SphereMask based on your actual camera position, this will of course depend on the intended use.

    There's a couple of ways to achieve a "metaball" effect, what do you have in mind?

    Thanks!
     
  16. danimarti

    danimarti

    Joined:
    Oct 22, 2016
    Posts:
    15
    Thanks so much Ricardo!

    Something like the attached example will work... I could use a texture but I think it will be nice to be able to create it procedurally :)
     

    Attached Files:

  17. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Ah, that one ;) It seems to simply be a panning of sorts using a noise texture. I would be happy to assist but I need to know more about how you're using it on your side; are you using the sphere mask?

    Thanks!
     
  18. chrischris

    chrischris

    Joined:
    Oct 18, 2005
    Posts:
    19
    Hi @Amplify_Ricardo,

    I'm setting up a VR scene using Unity 2019.1 + LWRP 5.7.2 + ASE v1.6.9. I've created a particles shader based on the Lightweight Unlit shader type in ASE and so far it's working nicely. My goal is to render the particles at infinite distance so they appear as part of the sky. Is this possible to do within the shader using some projection matrix magic? Something like forcing the projection to alway be the right or left eye. I'm currently just placing the particles at a large distance to minimize the stereoscopic effect, but I'd like to try true monoscopic rendering if possilble.

    Thanks!
     
  19. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    92
    Hello,

    When using "Draw Instanced" for the terrain, and using the Amplify Terrain Shader (for example "TerrainSnowCoverageFirstPass" from the examples), it behaves differently than Standard shader when pixel error is set to above 0.

    TerrainInstanced.png

    In the image above, both terrains are set to Draw Instanced and Pixel Error is 5. The terrain to the right uses a Built-in Standard shader and the one to the left has the Amplify TerrainSnowCoverageFirstPass shader and it really suffers from pixel error blurring.

    Is there an option to make it work as the standard shader?

    Thanks!

    PS
    Unity version 2019.1.12f1, Built-in rendering pipeline.

    PPS
    A friendly feedback: I think you shouldn't have abandoned your dedicated forums. Here in Unity forum it's an unorganized mess all forced into one thread and is very hard to search for specific solutions and follow relevant replies. Your forum was finely organized into threads as it should be. Try to put yourself into the shoes of a customer trying to find an answer to a specific problem in both forums and you'll easily see the difference.
     
  20. cyuxi

    cyuxi

    Joined:
    Apr 21, 2014
    Posts:
    33
    Hi Ricardo,
    It seems the HDR will cause black artifacts on terrain's AddPass... Is it likely to be a bug on ASE?? or did I do anything wrong? but the Unity's default terrain shader is just working fine.

    I have uploaded the sample project.
    You may open it with Unity 2018.3.14 or 4.0, these are the versions I already tested with.
    To reproduce the issue, please switch on and off the HDR feature on LWRP Profile or camera.

    2019731-星期三-164400.jpg
     

    Attached Files:

  21. hatayama

    hatayama

    Joined:
    Oct 16, 2014
    Posts:
    1
    Hi @Amplify_Ricardo, It is a bug report.

    [environment]
    macOS Mojava 10.14.5
    amplify shader editor v1.6.9 rev00
    Unity 2019.1.2f1

    I made a cutout shader with the amplify shader editor.
    But the light map did not bake correctly.

    [cutout texture]
    TX_leaf_00_rgb_a.png

    [result]
    Unity_2019_1_2f1_-_SampleScene_unity_-_amplify_bug_report_-_iOS__Metal_.png

    [shader node]
    スクリーンショット 2019-08-01 13.42.15.png
     

    Attached Files:

  22. Adrien_Nascaa

    Adrien_Nascaa

    Joined:
    Aug 1, 2019
    Posts:
    2
    Hi everyone.
    I am working on a 2D side scrolling game and I have to make a death zone like we can see in a lot of battle royal games. I use the depth fade node to do it and it works well with meshes but the real problem is : Is there a way to make those highlighted border but in a 2D game using both 2D sprites for environnement and meshes for characters ?

    This is what I have for now and I want the same effect on my 2D environment.


    Thank you !
     
  23. Clow_Lead

    Clow_Lead

    Joined:
    Dec 4, 2017
    Posts:
    1
    Hello,

    I want to use curved world and outline together.

    ScreenshotASE.png

    I tried this with Ouput Outline.

    error.png

    But the result was this.

    Is it impossible to use offset and outline together?
     
  24. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Apologies for the delayed reply, I've been down with a flu.

    Interesting question, it's not something I've personally done before so I will have to pass it along to the ASE developers to see if they can help.

    Change the Texture name to MainTex so Unity knows to take that into account. You'll likely also need to enable Double Sided Global Illumination as not doing so usually results in baking artifacts.

    upload_2019-8-1_19-1-14.png


    That might be a bit more tricky. Just to be sure, you want to show intersecting 2D sprites with a sort of fade effect?

    Not sure on this one but you could try to manipulate the Outline, instead of enabling it in the Output Node parameters, using the Outline Node. (check our more advanced custom lighting examples for additional details)
     
  25. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Hey there, sorry for the delayed reply.

    Is this reproducible using our own sample shader? We will definitely run a few tests on our side.

    We appreciate your feedback; ideally we wouldn't have closed those forums but we simply do not have the resources to maintain them along with our other points of contact.(Discord, Unity Forums, and Email Support) It might not be too perceivable on your side but Discord has really helped us better manage the number of requests we receive and how quick we can reply to more simpler stuff directly.

    Thank you for the sample, we will have to try it out in order to identify the problem.

    Thank you for your patience!
     
  26. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    717
    EDIT: DM Answered my question on discord.

    Which is: https://pastebin.com/k6jZpxpE

    Thanks DMeville.

    -----------------------------------------------------

    Hello, Would it be possible to output a node to an image which could be retrieved via C#

    The reason is I am developing both a planetary volumetric cloud system and a planetary ocean system, with both I will need to do some texture sampling via c#.

    Here is an example, with the volumetric cloud system, I want to inject some custom lighting effects into the volume, but in order to that I need to sample the combined noise image from which the clouds are generated which is created within the shader, unless there is a way to pixel sample an image within the shader, which I don't believe there is?

    How would I go about outputing shader values to an image which can be retrieved via material.GetTexture().

    Or is this not possible and if so any suggestions for work arounds? It would seem pretty limiting if you cannot access generated image data within the shader externally via C#.


     
    Last edited: Aug 2, 2019
  27. pez

    pez

    Joined:
    Jul 6, 2013
    Posts:
    16
    Hello, I have a request that you please make a tutorial video or some example scenes of the multi pass support that has been added.

    I'm completely lost as to how it works & the only example templates I could find are both unlit and without any pre-made examples.

    My shader setup is custom lighting so I don't know where to begin with it. Could I get an example of how you use 2 passes for different vertex offset functions, or maybe one that shows how to adjust the shadow caster path for custom shadows?

    Thanks
     
  28. Adrien_Nascaa

    Adrien_Nascaa

    Joined:
    Aug 1, 2019
    Posts:
    2
    Hi Ricardo !
    Thx for your answer.
    Yes this is what I want.
    I Want something like the reinhardt Shield in Overwatch but working on 2D Sprites

     
  29. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Cool use, it's a bit beyond the scope of our editor but I hope it works well.

    We can't create a tutorial at the moment but we would be happy to elaborate/guide you. Let me pass it on to one of our devs and see if we can assist in this specific case.


    That depends, is this a fixed sprite shape? A specific example would be great.

    Thanks!
     
  30. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Apologies, I misinterpreted your last post. We don't support Unity beta versions, can you replicate the issue on a stable release? I'm not getting the same results on my side.

    I noticed that you made a few changes to our Splats shader function, please make sure that you're clamping those values when needed.
     
  31. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    That's odd, I made a quick test and they both seem to be at the same resolution. Can you provide a simple example with the issue present?

    Thank you for the heads up, we really appreciate it.
     
  32. Tracecat

    Tracecat

    Joined:
    Mar 20, 2014
    Posts:
    15
    Hi!

    I asked some weeks ago about a StackLit HDRP template for Amplify and got this answer.

    As the Unity Shader Graph is really buggy in Versions 2019.1 and 2019.2 I would like to ask if there is any timeframe for this feature in Amplify. After reopening Unity Shader graph editor far to many times, because it is constantly freezing and becoming unresponsive, I am ready for a change ;-).
     
  33. wlad_s

    wlad_s

    Joined:
    Feb 18, 2011
    Posts:
    92

    Hi Ricardo, thank you for taking time to investigate the issue.

    I have made some tests now and you're right, both terrains are of the same resolution. The only difference is that the Unity_Standard shader displays a normal map. It seems that there is some internal Unity process that generates the normal map out of the height map information. Amplify terrain looks great as well when the coverage normal map is used.

    Sorry for a false alarm. Maybe some users would like to use that internal normal map that Unity generates so you might want to investigate it. I don't actually need that functionality because I will generate my normal-maps with external software.

    Here are the both terrains resolutions, pretty much the same
    ter-res.png

    Here's what it looks like when normal map is not used in amplify material (seems like Unity automatically makes its own normal map out of the heightmap information and applies it to the material)
    terr-normal_off.png

    And here's what it looks like when the coverage normal map is used in amplify terrain material. It would surely look as good as the Unity one if it were of larger resolution (the provided one is 512px only)
    terr-normal_on.png


    Cheers!
     
  34. cyuxi

    cyuxi

    Joined:
    Apr 21, 2014
    Posts:
    33
    201983-星期六-上午-11224.jpg
    Thank you Ricardo! I find out it is a minor mistake made by myself. :pI should always have the Height Weight clamped after channel blend calculation. By adding Saturate node for height weight blend results of Albedo and Metallic the black pixels are already gone for good! 8 splats with height and smoothness are just working like a charm and the HDR feature is free to use as always! I am saved.

    By the way , there must be some information mismatched because I have never used beta version, the current versions of Unity I am using are 2018.3.14f1 and 2018.4.0f1. It's regret to hear that you didn't see the error on your side (i.e. switching on the HDR to see the black artifacts) ,but for now it's no big deal.:D

    I have attached the project in case anyone might be also in the middle of looking for a case study of 8 splats on LWRP Terrain. (Project last opened with 2018.4.0f1. )

    (p.s. I am still wondering if there is a former ASE solution for applying Height Weight calculation between FirstPass and AddPass, otherwise It's only control map blending effect on the border of two passes so far. This is of cause in a manner of asking for something extra, so please feel free to skip if things are busy. )
     

    Attached Files:

  35. artanist

    artanist

    Joined:
    Oct 28, 2014
    Posts:
    7
    Hello Ricardo, I have a relatively simple question for you. I want to convert some of the shader i've done with amplify to LWRP and I upgraded my version of Unity from 2018.4 to 2019.2. (huge leap, but It all work out for my project :))

    In the documentation about using LWRP with amplify (http://wiki.amplify.pt/index.php?ti...y_Shader_Editor/Scriptable_Rendering_Pipeline), you specify that it can only be use with the 5.13 version of the LWRP in the 2019.1. I didn't try to unpack the SRP because of that specification.

    So my question is, can I use the SRP with 2019.2 and the version 6.9.1 of the LWRP or I have to wait for an update on your part ? If so, when do you think it will be available ?

    I thank you in advance for your answer :)
     
  36. joedanimation

    joedanimation

    Joined:
    Dec 30, 2017
    Posts:
    1
    Hello, can anyone provide more information about using the "Shade Vertex Lights" node? The documentation refers to using it with template vertex/frag shaders, but I can't find them included. Is this a deprecated node?

    I'm attempting to build a very cheap shader for a project meant to run on the Oculus Quest, and with my lights set to Not Important, I haven't found a good way to pipe that vertex lighting into my Custom Lighting shader in Amplify.
    Any help would be much appreciated!
     
  37. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Our apologies, we don't have an ETA for it but we will tackle it as soon as possible.

    Thank you for the additional details. I'm getting the same quality results when comparing the simple terrain ASE sample with the Unity Nature Terrain default shader; this is without using any textures. Our terrain sample should provide the same defaults as you would expect, if not we could use a sample, or exact replication steps, for further testing on our side.

    Glad to know clamping helped!

    Apologies, you're not using a beta version, I misread it as 2019.3 ;)

    Regarding the height blending, your question is on our support queue but we've not been able to tackle it yet.

    We've recently updated HD support to 6.x but LWRP templates remain the same between v5 and v6. It should work as expected but be sure to let us know if that's not the case.


    For you to make use of this node you'll need to use it on a Shader Template, such as the "Default Unlit", that we provide within our package. The shader LightMode must also be set to Vertex on the shader tags.

    Let me know if you run into any issues, we would be happy to assist.
     
  38. matthewhxq

    matthewhxq

    Joined:
    Jul 6, 2015
    Posts:
    8
    Hey, when can we expect LWRP SRP Batcher compatibility? Recent change log mention that it is removed completely, so I am little bit worried as my whole project is based on ase lw shaders.

    For now I just added Cbuffers commands manually to lw shader templates (its working most of the time :D).

    Also, do you plan to add SimpleLit/SimplePBR (LW) as shader template in the near future?
     
  39. Juliken

    Juliken

    Joined:
    Jan 30, 2017
    Posts:
    17
    Hello, I'm currently working on Amplify Shader to make a custom shader for my game. My goal is to change shadow on meshes to apply a scribble texture on it.

    To do that I used a dot product with "World Space Light Dir" node and "World Normal" node.

    Thanks to that I can know if a face is more or less directed towards the light and I use the result in a lerp to apply my texture.

    My main problem is that I can't know if a face is in the shadows because of other objects (projected shadows).

    Is there a way to get the light information of a face ? (if it's more or less enlightened)
     
  40. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    93
    Hi need help.

    Lighweight Unlit Amplify.

    Previously, when creating a parameter and including the "Installed Property" flag, the editor made a wrapper in:
    CBUFFER_START(UnityPerMaterial)

    After the latest updates, now does the old in:
    UNITY_INSTANCING_BUFFER_START(Lightweight....)

    How to get it back? What would automatic parameters entered in the block CBUFFER for LWRP Shaders.
     
  41. luellasfpg

    luellasfpg

    Joined:
    Jan 23, 2019
    Posts:
    16
    Hi everyone, I'm trying to create a ASE function that takes a 2D texture array as an input, but I'm not too sure how to do that, does anyone have any suggestions?
     
  42. AlejUb

    AlejUb

    Joined:
    Mar 11, 2019
    Posts:
    8
    Hello!
    I'm having a massive lag connecting nodes towards the end of the graph, the final output node being the worst offender
    It is a "huge" graph and it degrades the more nodes I add.
    Are there tricks to lower it? maybe I should group things on function assets? would that help?
    Currently it takes minutes to update a connected wire.
    Disconnecting a wire it is instant.

    Any help on this front, greatly appreciated.
     
  43. oceanquigley

    oceanquigley

    Joined:
    Apr 20, 2018
    Posts:
    6
    Hello,
    Has anybody used Amplify to make a replacement for the default Unity grass shader? If so, are there any tutorials or guides? Particularly about how you swap out the custom one for the default, and what kinds of inputs/settings it's expecting?

    Thanks for your advice!
     
  44. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    86
    I have an Alpha Cut out Material, however I can't seem to get baked shadows to work correctly.

    The same material using the Standard Shader : Rendering Mode --> Cutout works fine.

    A similar one, no matter what I try, will not cast shadows at all.

    Any Ideas?

    upload_2019-8-12_18-37-30.png
     
    Last edited: Aug 12, 2019
  45. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,321
    Apologies for the delay folks - I have risen from my +1 week flu ordeal, good times!

    Interesting detail, SRP was actually not working correctly; we found a couple of problems after digging deeper; the ASE developers are going to look into it quite soon. We're always looking for additional templates so we'll tackle it when possible; currently trying to catch up to core features.

    You do have a couple of light nodes that might help but it really depends on how you want to control it; have you experimented with it using Custom Lighting, and if so, any specific issues/barriers?


    This seems to be a bit problematic, and not currently possible, as different platforms have specific requirements; we use only what Unity provides. We would have to add support for it on our side, we've opened a ticket which we hope to tackle soon. In any case, feel free to elaborate as there might be an alternative way to achieve what you require.


    Creating shader functions can definitely help but performance issues of that type are very unusual. Can you send us a sample to support@amplify.pt for further examination? Be sure to also include the Unity and ASE version used and OS.

    We do include a sample in the Simple Terrain example with Terrain Wind but perhaps someone on our Discord has done something more advanced with it before.

    Not even dynamic shadows? We would be happy to examine a small sample.

    Thanks!
     
  46. luellasfpg

    luellasfpg

    Joined:
    Jan 23, 2019
    Posts:
    16
    Hmm that makes sense, thanks for looking into it. It would still be a nice feature to have in the future. I've attached a thumbnail of what we ended up doing, it does the job for now. Thanks! :)
     

    Attached Files:

  47. luellasfpg

    luellasfpg

    Joined:
    Jan 23, 2019
    Posts:
    16
    Also, another question, is it possible to use static switches to skip computations? For example, right now I have code that looks like this:

    float4 output = originalColor;

    [COLOR=#ff0000]*** a ton of code and computation here (that runs even when the output isn't used) ***[/COLOR]
    float4 newOutput = computedColor;

    #ifdef KEYWORD_ON
    float4 staticSwitch = originalColor;
    #else
    float4 staticSwitch = computedColor;


    The problem with the code above is that the "computedColor" is generated every time even when I only need the "originalColor". I would like it to look more like the code below, so the code to compute a color is called only when necessary.


    float4 output = originalColor;
    #ifdef KEYWORD_ON
    float4 staticSwitch = originalColor;
    #else
    [COLOR=#00ff00] *** a ton of code and computation here (that only runs while necessary) ***[/COLOR]
    float4 newOutput = computedColor;
    float4 staticSwitch = computedColor;


    Is this possible from rewiring the way I use the static switch? I'll attach what my node graph looks like currently, which is currently generating code like in my first example. Thanks in advance :)

    Annotation 2019-08-12 143111.png
     
    cyuxi likes this.
  48. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    86
    Here ya go!

    Steps:
    1) Open ShadowTest.scene
    2) Bake Lighting

    Observe Structures :

    Left : Standard Shader with opacity working as expected.
    Center Left : Default Standard Shader working as expected.
    Center Right : Complex Amplify Shader not working.
    Right : Simple Amplify Shader not working.

    What am I doing wrong??!
     

    Attached Files:

  49. DarKhar

    DarKhar

    Joined:
    Jun 8, 2017
    Posts:
    2
    Hello! I am having a lot of trouble trying to reconstruct normals after I've applied vertex offset. I tried looking at the example and recreating it but it doesn't give the expected result. I'm sure I'm doing something wrong but I really can't figure out what is it.
    I'll post a screenshot and the shader file below:
     

    Attached Files:

  50. C4ro

    C4ro

    Joined:
    Oct 5, 2014
    Posts:
    4
    Hi all! i'm having this weird console error with the newest Unity and ASE and the Additional Directives Helper

    Assets\AmplifyShaderEditor\Plugins\Editor\Templates\TemplateAdditionalDirectivesHelper.cs(372,35): error CS0117: 'Path' does not contain a definition for 'GetExtension'

    Can anyone help me?