Search Unity

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

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

  1. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    Daaamn, totally forgot about it.
    Thanks!

    I just checked the "info" section. Got it :)
    I checked the wiki before asking when I saw the image about the visual debug mode, as there wasn't more info provided there.
     
  2. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    What exactly are you having problems with? When you add the fresnel node the the initial values result in the Schlick fresnel, which is almost standard if not mistaken. You can then adjust the values to your liking but if Alloy is using some special kinda of fresnel or approximation it'll be difficult to mimic. Aside from that it uses whatever unity uses, which is also Schlick.
     
  3. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Apologies for that. This info about the new helper window should be already at our wiki, we'll add it as soon as possible.
     
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I'm probably being foolish and not thinking clearly, but just trying to connect it to what channel in the graph... And Alloy is using Schlick Fresnel as far as I know...
     
  5. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Looks nice... just needs that deep scatter with the blurred normals, and specular. Also, your eyes feel a little flat atm... do you have a normal map on it?
     
  6. ViktorKom

    ViktorKom

    Joined:
    Feb 24, 2015
    Posts:
    29
    Hi, I created our soft partials with ASE same as standard soft particle



    Take it.
     

    Attached Files:

  7. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @Amplify_RnD_Rick
    is reversed z buffer auto check for unity 5.5+ already added in ASE?
    also can i request SubShader and Pass Tags for ASE, or is it exist already?
     
  8. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    I always find it hard to match the color of my original sprites with my shader results. As I attach the color output to the emission channel of the shader, it usually ends up being a bit... different from Sprites-Default, as you can see here.

    I know several opacity factors might affect it, but.. how would you go to recreate Sprites-Default?
    Checking the shader, the main difference seems to be redirectioning the output color to the emission channel instead to o.color...

    Difference.png
     
  9. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    To the first question, yes, it's already handled simply because it uses unity's internal function which already do the inversion for you, I did a quick test to confirm and it behaves the same way in 5.4.4 and 5.5.2.
    To your second question, the editor generates some tags accordingly to your shader settings, for example, adding the rendertype and queue tags. Is there any tag you think is missing? Or you just want to be able to add your own tags for other things?

    Unity's default sprites final formula is: (textureColor * vertexColor * materialColor) so if you do this it should be the same. There's one small detail tho. Looking at the built in shaders the "textureColor" part has a fixed4 value added to it that I don't know what it is. It's called "_TextureSampleAdd" and it seems to be a global variable but I can't find any reference to it nor information online, maybe that's what causing the small difference? If I find anything else I'll let you know.

    [edit] I just did a quick experiment and I managed to make them exactly the same, indeed, at first my sprite was a bit brighter but as soon as I added a float with the value 0 into occlusion it got exactly the same. Basically unity's default for occlusion is 1 which makes GI show up in certain occasions, by putting to 0 you "turn it off" and it behaves the same way. This might be or not what you want to do with your sprites, in short, if you want them to react to the global illumination leave it on, else, put it to zero.
     
    Last edited: Mar 13, 2017
    arnoob and hopeful like this.
  10. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Yep, custom tag.
     
  11. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    That's it! Turning off the occlusion makes them exactly the same. Thanks a lot!
     
    kebrus and hopeful like this.
  12. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    By the way, any guidance on how to use Blending Operations?

    For Source, I set my base texture, set the blending mode that I want... but I'm now sure what the Destiny should be.
    What I've tried so far hasn't turned out to be what I wanted.

    Let's say for example, I simply want to get an image with in "overlay" mode. What should that Destiny be?
     
  13. Amplify_RnD_Rick

    Amplify_RnD_Rick

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

    As you all may have noticed our site is currently down for maintenance, but rest assured we are doing our best for it to be online as soon as possible.

    We'll let you know as soon as everything is back to normal.

    Apologies for any inconvenience this may be causing.
     
    KRGraphics likes this.
  14. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Our site is finally back online.

    Again we apologize for any inconvenience this may have caused.

    We will be also releasing a new build soon.
     
  15. MattyWS

    MattyWS

    Joined:
    Jan 24, 2013
    Posts:
    70
    I know this is a requested feature but I'm curious (and because your road map is being rescheduled forever) how long it would be (if at all) that we'd be able to make a decent terrain shader?

    I have a large project at the moment and one of the biggest things I need is my own shader for height blended textures and decent roughness values per texture, parallaxing and even having one big normal map (via world machines normal map output) to give the terrain less blobby looks. I could make a shader that would do all of this but it would be on a standard mesh and not unity terrain, which is quite annoying. Obviously there are things like RTP but unfortunately that would no longer be my own creation so I can't use it.

    If you think terrain shaders are very far off (more than a few months) on the road map I will just use a mesh, if it's something coming soon then I'll gladly wait. :)
     
  16. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    So sorry for not answering sooner.
    Concerning the Blend Op nodes, Destiny is your target, more specifically your base layer, while Source is your Blend or Top Layer.
    You can check the math behind these blend operations in here.

    About fully supporting Unity Terrain shaders, I know it is quite annoying the fact we cannot give a straight answer to you guys, but at the moment it's really hard to us to give now a proper estimate on when we will be able to work on it.
    Since this is in high-demand we'll analyze our internal roadmap and try to figure out how soon can we can start, but there are some core features that we really need to finish before moving into it.
    We can at least say that we most likely won't be able to tackle this on this next month.

    Also we just uploaded a new version into our website.

    Here are the release notes

    Amplify Shader Editor v0.5.1 dev 011:
    • New Features:
      • Added Mask buttons on Previews
      • Added new Billboard option into Master Node
      • Added 'Desaturate' node
    • Improvements:
      • Improved overall Editor performance
      • Control key can be also used to append nodes to selection
    • Fixes:
      • Fixed small visual issue with Color Mask UI
      • Fixed cast issues on object picker with 'Texture Sample' and 'Texture Object' nodes
      • Fixed issue with not updating material inspector in real time ( because out of focus ) when changing properties on canvas
    Happy shader creations!
     
    laurentlavigne likes this.
  17. SebastianDusterwald

    SebastianDusterwald

    Joined:
    Sep 15, 2016
    Posts:
    2
    Any chance you could add the ability to get float3/float4 value out of the VertexData Tex Coord node? I'm using Texture Arrays and am encoding the array slice in a Vector3 for UV data. I managed to modify the Surface Standard Inputs -> Texture Coordinates node to make it work (by default if you select Coord Size -> float3 on it the W value is zeroed out, I changed it so that it passes on the Z value from the vertex data to the pixel shader).

    I did have a go at converting the Vertex Data TexCoord node to support float3 instead of float2 but I could't get it to work properly. However, it seems like it should be trivial to add for someone who actually knows what they are doing.

    Thanks for creating this wonderful tool and I hope you guys keep on making it even better.
     
  18. barikinil

    barikinil

    Joined:
    Apr 15, 2015
    Posts:
    11
    Hello,
    Could you suggest something to make sun explosion like below.
    Regards.
     

    Attached Files:

  19. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    So, correct if I'm wrong, what you want is to pass both z and w with the texture coordinate node and do something similar for vertex texcoord right?

    Seems to be simple to add, just not sure if they compile correctly due to the transform_tex define, but at the very least it should be possible to change the vertex texcoord to output size as well and have it connect to the "vertex to fragment" node to get the raw values.
    I would first try with sprite animations, unless you really want to get a close look at them they should be enough, if not I would then try something with particles. Probably the middle ground would be a geometry shaped like those arcs and have a texture panning animation going in the U coordinate and have the geometry expand and collapse as needed to create the illusion of a sudden arc, the problem with this last approach is that you still need to do something for those little "debris" (maybe particles).
     
  20. SebastianDusterwald

    SebastianDusterwald

    Joined:
    Sep 15, 2016
    Posts:
    2
    Let me rephrase what I'm doing. So I have a mesh that has 3 float texture coordinates (so UVW), and in the pixel shader I want to use the UV values as per usual and the W value to specify the TextureArray2D slice. There's no way to do this without editing the node source (yet), right?

    After you mentioned "vertex to fragment" I actually tried that with the modified vertex data texcoord node that I made and that worked. Looks like this: nodes.jpg
     
  21. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    That's right, there's still no way to do that without some editing, but you are on the right track, and you don't even need the top "vertex to frag" node since the uv output already generates proper uvs.

    If that works for you for now cool but the editor needs to update both textcoord nodes because what you said earlier is still true, the editor is zeroing out both z and w and vertex texcoord doesn't provide the size.

    Out of curiosity, did you have a hard time changing the node? did you check the wiki for the API?
     
  22. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    77
    Then I believe I was using it as supposed...
    On Source I was plugging my texture, and on Destiny I was doing a Screen Color Grab. Isn't that supposed to be like that? Or should I use another thing as "base"?

    Edit:
    Nevermind... I just tested it against photoshop and seems to do as supposed. I guess my artist was simply giving me bad information and didn't like the results but it was ultimately due to the environment around the assets and such.
     
    Last edited: Mar 17, 2017
  23. pro-bchevalier

    pro-bchevalier

    Joined:
    May 30, 2013
    Posts:
    46
    Hey there, I though I should share this here.
    I don't think the shader is very well optimized or tuned, but it could be a base for some people to play with it.
    It's supposed to be a stylised 2 texture layers blended material, modulated by a splat map and trying to get "hard edge" blending using the smallest possible splat map. I am using alpha from texture 2 in order to modulate the blending, but you could use a separate texture or any other existing channels.
    I guess, it could be easily extended with normal mapping support, additional texture layers, but I didn't need that.
    Amplify> thanks for this nice shader editor.

    shitarseshader.gif
     

    Attached Files:

    UnityLighting likes this.
  24. pro-bchevalier

    pro-bchevalier

    Joined:
    May 30, 2013
    Posts:
    46
    Some additional test using a pretty small splat(32x32)

    Btw, @Amplify_RnD_Rick , it'd be very awesome to see terrain shaders being supported by Amplify Shader, I know it's been asked for before, so just saying :)
    The shader I just put together is, in fact, a way for me to get clean and readable code from Amplify compiled shader and port it into a custom terrain shader(with the support of my engineer friends).
    Anyways, again: amazing tool!

    upload_2017-3-18_16-55-50.png

    Some more improvements darkening the edges of the transition. The goal is getting a bunch of stylised variations using just a few textures.

    upload_2017-3-18_17-6-48.png
     
    Last edited: Mar 18, 2017
    Farelle, AdamGoodrich and hopeful like this.
  25. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Ok... well I used to have a post here but I figured it out so. Its gone!
     
    Last edited: Mar 21, 2017
  26. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Here are some more pertinent questions:

    1 - How can I generate a random value within a min and max range?
    2 - How can I randomly multiply a value by 1 or -1 ?

    The idea with question #1 is to randomly affect the intensity of an effect and #2 is to change the direction of my vertex offset.

    Bonus question: Does anyone have any good tutorial or examples (AS related or not) on gpu instancing? I am trying to make some 2D animated grass and would like the grass to cover the whole surface I assign this shader to.

    Thanks.
     
    Last edited: Mar 21, 2017
  27. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    hi
    i have a problem with POM shader example. its flikering like a hell.
    tried to solve this problem by seting render path to deferred from forward. less flokering but still.

    my shader simply blending 4 textures (rbga) from mask. same i do with normal and POM. its something like 4 textured POM shader for terrain (very heavy).

    i found that switching outline option in shader do fix for shader. but i dont understand why it fixing it.

    wathc video i made
    you can repeat it in clean project

     
  28. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    The random effect you want is driven by what exactly? You want it to change with time? Just when you hit play? Do remember that it's not exactly possible to generate random singular numbers in shaders, all randomness in shader are generated with sinusoidal functions that have an input into account and usually generate noise texture (which you already can generate with the noise node). It's indeed possible to generate a whole texture with just one pseudo random value (although it's a bit of a waste) but you have to tie it down to some information, for instance, time or location. So you can generate a value through time or through the object position. But if you want a random value to be generated every time you hit play your best bet is to create a script that generates a random number and assigns it to a shader variable.

    In ASE the only thing you have to do to create instanced shaders is to change all your public variables to "instanced".

    That really is weird, it does seem to be related to the shadow caster. Could you share your shader? I'll look into it

    PS: your video external playback is off
     
  29. Zac-Yeates

    Zac-Yeates

    Joined:
    Jan 23, 2015
    Posts:
    20
    I haven't read through the full thread so I apologize if this question has already been answered, but is this able to create a shader that renders two seperate BRDF's (such as base coat and then top coat) and then add them together using masks such as fresnel
     
  30. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    what do you mean?


    btw. created tesselated shader instead POM. work faster. ofc there some limitation (like poly count in mesh to tesselate and common wire), but in general i got what i need.

    will add some spec/rough/AO later
     

    Attached Files:

    Last edited: Mar 22, 2017
  31. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Hi kebrus,

    Thanks for the info. I am trying to make grass sprites turn more or less yellow "randomly" for each copy of the sprite. I tried to use a yellow color node and blend it with the main texture using a weight based on worldpos.x+worldpos.y > sin but that isn't working as I expected. I'm obviously doing it wrong but I got a nice wave pattern out of it haha.

    Btw, In shaderlab there is an Object Position node that gives the world coordinates of the object's pivot point. Is there anyway to get this coordinate with AS? That would help me for a lot of things.

    And one last question If I may, what would be the best way to cover the whole ground with the grass sprite? Do I just spawn prefabs at random positions? Should I instead create GPU Instances via a c# script? Or is there a way to instance this within the shader and have it cover the entire object the shader is active on?

    The DX11 grass shader on the asset store appears to do it in shader but after checking all the code I'm still not sure how it's done.

    Thank you for your help!
     
    Last edited: Mar 22, 2017
  32. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    Speedup your development with some of the most reliable packages available at the Unity Asset Store. Along with a FREE uFPS and Playmaker license, you can start using the Amplify Shader Editor today.

    Moving to a Plus Subscription can be a big decision, the Unity Accelerator Pack makes sure that you hit the ground running by offering you 3 top-selling productivity assets. Save up to $190 when you subscribe!

    Learn more - Unity Accelerator Pack

    What does Firewatch, p.a.m.e.l.a., Manifold Garden, Rust, The Forest, Night In The Woods, Broforce, Ghost of a tale and Star Wars Journeys Ep 1 – to name a few – have in common? Check out our full suite of Amplify Unity Products and find out what they can do for your project.
     
    Last edited: Mar 30, 2017
  33. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Hi, does anyone know how I can scale a sprite on the Y axis without offsetting its position in game? I have found a vertex position node but I'm not sure were to connect its output. There is a vertex pos to fragment node but it doesnt seem to do anything and appears to need to be connected somewere.
     
  34. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    Hi guys,

    Apologies for the delay on answering your questions here at the forum.

    Will try answer them as soon as possible.

    Thank you so much to all of you guys who already are helping our fellow community members.

    We just uploaded a new build into our site.
    Here are the release notes.
    Release Notes v0.6.0 dev 01:
    • Improvements:
      • Added Texture Coordinate Coord Size parameter for 'Vertex TexCoord' node
    • * Fixes:
      • Fixed issue when doing custom shadow caster with translucency on deferred mode
      • Fix for texture coordinates zeroing out Z and W
      • Fixed issue with input port internal name not being set correctly
      • Fixed issue with custom shader inspector on unity 5.6
      • Fixed shadows issue on Matcap example
      • Fixed 'Virtual Texture Object' sampling the correct UVs when not connected
    Happy shader creations.
     
  35. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,210
    How do you create a double-sided shader?
     
  36. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    You mean render the back side of your geometry? If so, in the main properties of the shader set culling mode to off.
     
    DigitalAdam likes this.
  37. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    I understand that time is a rare commodity but it would really help us self troubleshoot if each nodes were documented in details on the wiki including info about each input and outputs, data types etc....
     
    Last edited: Mar 23, 2017
    cygnusprojects likes this.
  38. Gray_Master

    Gray_Master

    Joined:
    Jun 20, 2010
    Posts:
    152
    Default Info about nodes may be seen this (may be not complete, but this is basic info).
     
  39. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    I haven't been lucky here, I can't seem to be able to reproduce the problem, could it be related to your camera somehow? I did notice some other problems with both your graph and the editor but they didn't seemed to matter for this. There are pros and cons about tesselation and POM for sure, it's a case by case scenario, if you are happy with tessellation go for it. I'll still try to find the bug. What version of unity are you using?

    What do you mean by "renders two separate"? like rendering two different materials? Usually those kinds of effects only render one materials with the masks affecting each output. And yes you can create that with the editor. But if you want to create two different materials (lets say, one uses metallic and the other specular) and you want to combine them using a mask the only way I know of doing it is using materials layers in which you assign multiple materials to the same object and the materials themselves have some sort of logic to handle the blending with either transparency or clipping.

    You are doing it correctly, you should indeed using the world position x and y to handle the way you change the colors. most probably you just need to multiple the sin wave by large numbers to make the pattern less noticeable.

    Covering grass should be done by script, those grass shaders usually use some sort of shader logic to create shapes that resemble grass blades instead of geometry and then they can use a mask to populate the terrain as they want. It's heavy and the blades usually end up looking all the same, good for a soccer field for example but not that great for a forest. Unity's grass for instance uses geometry with grass textures and tint it with vertex color.

    Are you sure about that object position variable? As far as I'm aware there are only variables that give you the position of each vertex or each fragment, not the object origin. Can you link it to me?

    You can affect the geometry of sprite by using the Vertex Offset output. You can use the vertex position node and scale up only the Y axis. One of the samples does a wave effect on the geometry, that should get you started.
     
  40. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    using unity 5.5.1
    and i cant reproduce it now to... bug just gone. i restarted computer and tried to repeat it... no luck.
    seems my computer wanted some love =)
     
  41. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Hi friends! I just bought Amplify, and am interested in customizing the provided water to simulate a number of different fluids. In Unity 5.5, the official water example doesn't appear to be doing proper depth sampling in Deferred rendering mode (see attached screenshot).

    Has anyone run into this, and should I expect everything to work as expected in Deferred mode? I found a reference to "refraction shader sample also broken in deferred" posted in this thread on Sept 30th of last year, but no other indications that things shouldn't work as expected out of the box.

    2017_03_23-amplify-water-deferred.png
     
  42. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Mmm... what if I want the yellow tint to stay the same within an object?

    Search for the node called "Object Position" on this page: http://acegikmo.com/shaderforge/nodes/

    This would help fix my grass color problem.

    Got that part working allready thank you. Im just having color issues and then I want to try using GPU instances from a script instead of simply spawning prefabs. If I can't fix the color issue within the shader I guess I'll just make it a property and set it in C#. Mmm... does SF generate scripts in addition to shaders? It could be a great feature to add new types of nodes.
     
  43. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    How do we do shader LOD?
     
  44. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    has same flikering with POM shader in package
     
  45. Amplify_RnD_Rick

    Amplify_RnD_Rick

    Joined:
    Feb 15, 2016
    Posts:
    528
    I'm glad you stumbled into this. We couldn't replicate your issue specificaly but there's another one with this sample, it was made before our new Blend Mode options and it didn't imported correctly into it.Its Blend Mode should be set to Translucent and not Opaque.
    Also, we found an issue with the Terrain shader on that same sample. This issue affects some other samples, including the one reported by @zelmund.
    All of this will be fixed on our next build.


    This node you linked is similar to us having a Vector4 with (0,0,0,1) connected to our 'Object To World' node.
    In order to facilitate its usage we will enable Internal Data to be active our 'Object To World' so you can specify (0,0,0,1) directly on it and use without any additional node.
    This will be available on our next build.


    Currently there is no way to specify shader lod but you raised a good point. This is fairly quick to implement, so expect it on a near future build along side with a field where you can specify a callback shader.
     
    Last edited: Mar 24, 2017
    laurentlavigne likes this.
  46. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I was wondering if this tool has support for any custom geometry shader? It seems like the tool has some "builtin" support that uses geometry shader, but I was wondering if there is way for me to create geometry shader of my own by using node based connection just like the other vertex and pixel shader parts. If so any docs or reference to that feature?

    And I guess compute shader is not covered by this tool right?
     
  47. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Thanks Amplify! Deferred water is now working as expected after adjusting the Blend Mode.

    2017_03_24-volcano.png
     
  48. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    AWwwww makes total sense, thank you very much!
     
  49. Nosaru

    Nosaru

    Joined:
    Feb 26, 2017
    Posts:
    13
    Trying to replicate tree/leaf shader from games like "TheWitness" in ASE
    Basically a Leaf texture with cutout alpha mask and the ability to hide face based on its angle to the camera

    Thanks to Ricardo who helped me with Transparency to Camera position.

    So we have the fade to camera angle, but since I am using Transparent render type its kinda messing up the whole texture a bit. Any ideas how to keep the texture solid but also have the option of transparent fade on camera angle?

    Any help much appreciated
     
  50. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    Fantastic, will it allow to switch off main node parameters such as outline and POM?