Search Unity

Shader Forge - A visual, node-based shader editor

Discussion in 'Assets and Asset Store' started by Acegikmo, Jan 11, 2014.

  1. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Not yet! But I can prioritize to make one. In the meantime, you could make it manually
     
    Deon-Cadme and gurayg like this.
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Unforunately its not going as well for me as I'd hoped, so probably no screenshots of my attempt till Monday or Tuesday.

    Specifically I have got a shader working that resembles the U5 Standard Shader Spec-Gloss version in some key ways, but in other ways it isn't right, and I don't quite have the language/understanding to identify the problem or ask for help properly. One issue is that if I turn on light mapping, I get a lot of unwanted white around the edges of some meshes.

    One question I might be able to ask properly is in regards to emulating the behaviour of the AO slot of the standard shader. Do I attach a texture2D to the Diffuse AO input, the Specular AO input, both, or something more sophisticated? Cheers
     
  3. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Well, the Unity 5 features are still in beta, since Unity 5 itself is in beta :)
    It's constantly changing, which is why I'm not going to invest too much time into it, until things have stabilized.

    As for AO, plug it into both if you're unsure how to use it
     
  4. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    It was not a complaint :) I was only too happy to buy shader forge when you added preliminary Unity 5 support, but I quite understand the realities of the beta and its evolution. My complaint is towards myself - I am not the best person to describe any issues or get to the bottom of the cause.

    Anyway here is where I am up to so far. I'm sure there are some terrible rookie mistakes in this attempt by me, but I'll post it anyway. A fair bit of what I did was guided by various shader forge console warnings to do with light mapping and what properties it was expecting to find in the shader.

    PBLSettings.png

    sf_forgepbr_1112015.png

    When trying this shader briefly and without much care, it seems to do a good job of, for example, looking the same when applied to the balloon cat in the doll demo. But I'm sure I will find some issues when I try it with a broader range of textures etc, and I would not be at all surprised if my use of multiply to combine colours and slider values with texture values is not quite right.
     
  5. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Made a few adjustments for light transmission.

     
  6. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,141
    You need to stop. You're making us all look bad.
     
    Acegikmo, DMeville and gurayg like this.
  7. RaginBear

    RaginBear

    Joined:
    Jan 10, 2015
    Posts:
    6
    Unity 4
     
  8. Deleted User

    Deleted User

    Guest

    This texture it'a a gif or png/other format?
     
  9. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Hehe :D thx

    That was just a screenshot. Here's a gif

     
    Deon-Cadme, yezzer and ZJP like this.
  10. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I'm not kidding, i might well have a reason to offer you a lump of money for that, that is absolutely brill
     
  11. Deleted User

    Deleted User

    Guest

    I was talking of texture using for explosion, the shader animation is giving by a gif?
     
  12. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Haha. I might just make a pack of explosion VFX prefabs and put it on the assetstore when they are finalized :)

    Oh no not a gif. See I made this mesh in Max with cylinderical UVs, then vertex painted them so every smoke spike has a different color and brightness. Then I just used the vertex offset node with a gradient map to make them dissipate out like gradually growing spikes. And the feathery smokey look is done by combining fresnel with a smoke texture.


     
    Deleted User likes this.
  13. Deleted User

    Deleted User

    Guest

    Thanks for explain :)
     
  14. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    This is absolutely understandable.
    @elbows : Thanks for trying and sharing!
     
    elbows likes this.
  15. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    I've searched the forums and such but cannot seem to find an animated perlin shader that will work on mobile.
    Right now I'm faking it with UV distrotion/displacement, but it doesn't look nearly as good as what I was able to achieve with Turbulence Library. I'm trying to make animated gas-like clouds for the background of our game. The game is pretty lightweight so there's room for extra cpu/gpu usage.
    Can Shader Forge do something like this for mobile? Does anyone have a video/GIF example I can see?
    Thank you!
     
  16. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I wouldnt feel right using it in anything 'official' i made then, i'll maybe contact you for something bespoke if the time comes
     
  17. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    You should be able to do it. If not procedurally like this: http://acegikmo.com/shaderforge/wiki/index.php?title=Procedural_Noise, you could simply use noise textures and pan them around :)
     
  18. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    Acegikmo : have you a status about multipass shader ? have you planned this feature for 2.0 or before ?
     
  19. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Definitely not in 1.x, it's way too advanced
     
  20. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    369
    Ok :'( Thanks
     
  21. Eideren

    Eideren

    Joined:
    Aug 20, 2013
    Posts:
    309
    @Naphier [Self Promotion]If you need clouds, i got some nice ones, take a look at my signature ;) [/Self Promotion]
    You dont have to only use Uv's to animate them, of course you can do the standard "texture offset by time" thing but you can do some math with the texture/noise after the offset to animate it, you could take a second noise/texture and multiply the first noise by the second one, it should give you some interesting result.
     
  22. Naphier

    Naphier

    Joined:
    Aug 4, 2014
    Posts:
    114
    @Acegikmo & @Eideren
    Thanks so much! This should get me to where I need to go. Cheers!
     
  23. KaylMyers

    KaylMyers

    Joined:
    Mar 28, 2013
    Posts:
    33
    I'm trying to recreate the Standard (Spec) Material in 5b19 with SF1.04. It kind of works, but cant achieve the same look. Below is a comparison between the two. Both use the same maps. Specifically, the spec seems to be WAY blown out on mine. And I was having trouble getting the height map to behave the same way (I stripped it out on this graph). Has anyone been able to reproduce the standard shader reliably? Been struggling with this for a while, and hope I'm just not missing something stupid.

    Thanks ahead of time! sf_Materials.jpg sf_Graph.jpg
     
    Deon-Cadme likes this.
  24. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Oh yeah !!!!! :cool:
    ETA?
     
  25. Arkham

    Arkham

    Joined:
    Dec 16, 2013
    Posts:
    9
    Posting here again to see if I can get a response on this. I managed to more or less deal with the first problem I mentioned, but the realtime shadows are still an issue.

    I find it to be a rather strange problem. Unity's default materials, for all they lack, can at least handle shadows just as they should (obvious difference between hard and soft shadows, shadows can be gradually reduced by strength value, adjusting bias can fix artifacting). By contrast, a material using a ShaderForge shader can't seem to do any of these (hard and soft shadows are the same, strength value does not work except when you set it to 0 whereupon shadows disappear entirely, bias adjusting does not help artifacting problems at all).

    If I need to provide more information on what I'm doing to receive an answer on this, I'm sure I can do so. I would really appreciate any help I can get with this.

     
  26. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    That looks like the same issue I mentioned here over the last week, although I failed to provide screenshots.

    I've not got a solution yet and was advised that at this stage of the Unity 5 beta cycle, shaderforge will not necessarily be updated quickly to deal with any changes Unity keep making under the hood of 5.

    I am intending to play around with this some more today and will let you know if I find a workaround or at least a fudge to reduce the impact of the issue.

    I havent done anything with heightmaps yet so cant comment on that.
     
  27. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,141
    So I'm NOT the only one with this problem! I thought it was a factor in the default materials as well, but when I tested it, it never happened in them.
     
  28. KaylMyers

    KaylMyers

    Joined:
    Mar 28, 2013
    Posts:
    33
    Well, I've at least narrowed it down to a problem with the specular slot. If I crank the gloss intensity up, I get the spec I'm expecting as long as my specular is set to 0. ANY value in the specular slot returns those white artifacts... I'm guessing this is a bug?
     
  29. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    It's definitely a bug, which I haven't looked into just yet. I've been having a lot of hardware trouble as of late, currently waiting for my main computer to return, and just now my windows partition on my laptop died, and so on!
    On top of that, I'm not currently working full-time with Shader Forge - I'm on another project at the moment.

    That said, a lot of things are changing in the beta, so, the fix might as well wait!
     
  30. VertexFiend

    VertexFiend

    Joined:
    May 2, 2013
    Posts:
    107
    Just wanted to drop in here to say thanks to ShaderForge for providing a fantastic yet simple solution that is easily distributable for my first asset. It would have been a giant pain in the neck for this thick artist to even make something so simple yet elegant! Easily my best purchase on the asset store ever!

    My VERY basic SF PBR shader in action -

     
    Deon-Cadme and Acegikmo like this.
  31. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Looking good, nice work :)
     
  32. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I reckon Unity renaming certain things in 5 beta 20 has probably broken that side of shaderforge today (my earlier PRB shader attempts now render pink) but this isnt surprising and as per some recent posts I'm not begging for a quick fix. If I'm that desperate I can probably manually fix stuff in the shader code produced.

    Looking at the release notes for Unity 5 beta 20, there look to be a few potential causes, I'll post again if I work out which ones.
     
  33. chillichips

    chillichips

    Joined:
    Sep 14, 2013
    Posts:
    5
    Hello, got Shader Forge today and oh man do I like it. But I've also come across a problem...

    When I do something as simple as this with Strumpy it looks nice and smooth, but in Shader Forge each segment of the tyrewalls appears as concave. if I clear the "Normal" slot it looks fine again, but then it's of course missing out on a lot of detail. Any idea what's going on?
     
  34. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    @chillichips is it that you baked that detail into the normal by accident?
     
  35. chillichips

    chillichips

    Joined:
    Sep 14, 2013
    Posts:
    5
    Nah, the normal map is actually just a straight line there. And as I said it looks fine when I create a shader with Strumpy and even Unity's default if I were to guess.
     
  36. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    See if either the X or Y values being 1-minused fixes it?
     
  37. chillichips

    chillichips

    Joined:
    Sep 14, 2013
    Posts:
    5
    It only looks wrong at those extreme angles. the rest of the entire model is fine, it's just under that specific circumstance something goes wrong.
     
  38. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Try switching between normalized and interpolated normals in the shader settings
     
  39. anton1987ru

    anton1987ru

    Joined:
    Nov 16, 2012
    Posts:
    15
    i create this shader by Shader forge
     
    IFL likes this.
  40. chillichips

    chillichips

    Joined:
    Sep 14, 2013
    Posts:
    5
    I've tried that but the differences are minimal for some reason.
    I think Strumpy calculates the normals in the pixel shader (frag pass?) instead of the vertex shader, if I understood Forge's code correctly when comparing. I wonder if that has anything to do with it...
     
  41. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    How to make a change in the line width using the shader? Maybe using Vertex offset? I want to do to adjust the width of the shader Line renderer. Like this
     
    Last edited: Jan 18, 2015
  42. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Is there any way to create an anisotropic reflection with SF ? Maybe using a texture map to set the angle of the reflection ?

     
  43. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Possible to make a shader, which, depending on the lifetime of the particles will change the texture size particles?
     
  44. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    Yes. This is a good place to start, specifically turning the following method into nodes:
    Code (CSharp):
    1. inline fixed4 LightingAniso (SurfaceOutputAniso s, fixed3 lightDir, fixed3 viewDir, fixed atten) {
    2.    fixed3 h = normalize(normalize(lightDir) + normalize(viewDir));
    3.    float NdotL = saturate(dot(s.Normal, lightDir));
    4.    fixed HdotA = dot(normalize(s.Normal + s.AnisoDir.rgb), h);
    5.    float aniso = max(0, sin(radians((HdotA + _AnisoOffset) * 180)));
    6.    float spec = saturate(dot(s.Normal, h));
    7.    spec = saturate(pow(lerp(spec, aniso, s.AnisoDir.a), s.Gloss * 128) * s.Specular);
    8.    fixed4 c;
    9.    c.rgb = ((s.Albedo * _LightColor0.rgb * NdotL) + (_LightColor0.rgb * spec)) * (atten * 2);
    10.    c.a = 1;
    11.    clip(s.Alpha - _Cutoff);
    12.    return c;
    13. }
    I tried to find my SF version of the above, but it's being elusive. Depending on what you're going for, there's also DMeville's hair shader on the wiki, which is easier to customize than the traditional anisotropic functions.
     
    Acegikmo likes this.
  45. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Interesting..
    Thanks for the info, also that hair shader looks pretty neat.
     
  46. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    How to change the size of the texture along the axis y, without tiling?
     
  47. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Change your texture from repeat to clamp in the texture settings. Then when you scale it it won't tile.
     
  48. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Acegikmo:
    How can I achieve toon shadows like this?

    Screen Shot 2015-01-19 at 3.31.33 PM.png
     
  49. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    For the shadows, I'm seeing fresnel for the edges and ramp for lighting. Is that enough to set you on the right path? If not, I'll throw together an example, but only if you tell me what that frog-thing is you're holding.
     
    Acegikmo likes this.
  50. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    It looks like an alligator with its mouth taped shut.