Search Unity

Shader Forge - A visual, node-based shader editor

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

  1. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    Hey @Jesus
    Sorry I haven't been able to get back to you, been extremely busy.

    Would it be possible for you to send me this shader, I would really like to have a go with this and see what I can do?
     
  2. myselfshj

    myselfshj

    Joined:
    Mar 30, 2012
    Posts:
    31
    Black Friday Discount, please.
     
  3. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    I wonder if there's a way to create the opaque-transparency shader that Speedtree uses. They mix 4x4 dithering with alpha to coverage to create opaque rendered soft edged leaves. You can see the closeup on the bottom right image.

     
  4. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Hi,

    I got reports from some Mac users that they get graphical glitches with my game. Upon inspecting one of the logs I got sent it seems all shaders made with ShaderForge somehow are at fault. I see a lot of warnings like this:

    WARNING: Shader Unsupported: 'Shader Forge/ThroughBlackFront' - Pass 'FORWARD' has no vertex shader
    WARNING: Shader Unsupported: 'Shader Forge/ThroughBlackFront' - Pass 'FORWARD_DELTA' has no vertex shader
    WARNING: Shader Unsupported: 'Shader Forge/ThroughBlackFront' - All passes removed
    Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
    WARNING: Shader Unsupported: 'Shader Forge/EyeGlowParticle' - Pass 'FORWARD' has no vertex shader
    WARNING: Shader Unsupported: 'Shader Forge/EyeGlowParticle' - All passes removed
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Shader Forge/EyeGlowParticle' - Setting to default shader.
    WARNING: Shader Unsupported: 'Shader Forge/ThroughBlackFrontLight' - Pass 'FORWARD' has no vertex shader
    WARNING: Shader Unsupported: 'Shader Forge/ThroughBlackFrontLight' - Pass 'FORWARD_DELTA' has no vertex shader
    WARNING: Shader Unsupported: 'Shader Forge/ThroughBlackFrontLight' - All passes removed
    WARNING: Shader Unsupported: 'Shader Forge/GrowingLineTree' - Pass 'FORWARD' has no vertex shader
    WARNING: Shader Unsupported: 'Shader Forge/Water' - Pass 'FORWARD' has no vertex shader
    WARNING: Shader Unsupported: 'Shader Forge/Water' - Pass 'FORWARD_DELTA' has no vertex shader
    WARNING: Shader Unsupported: 'Shader Forge/Water' - Pass 'SHADOWCASTER' has no vertex shader
    ...
    Is there a simple checkbox that would fix this?

    Interesting enough, on my old iMac from 2010 I don't get any glitches, but a guy with a MacBook from 2012 does.
     
  5. Research_3DVAL

    Research_3DVAL

    Joined:
    Jun 26, 2014
    Posts:
    15
    Looks like some of them at least are that that you might not have suitable fallback shaders set up in your shader settings.

    Some of these might also be shader compatibility settings, what are your targeted renderers set to? Things like dx won't work on mac.
     
  6. Research_3DVAL

    Research_3DVAL

    Joined:
    Jun 26, 2014
    Posts:
    15
    Hi all,

    Running into some issues with shader node previews. I'm getting results that are completely divergent from what the node previews seem to suggest. For example:



    the "smoothstep" node makes it looks like I have a reasonable mask, but when I feed it into Base Color to double check I'm getting an almost INVERTED version. I understand there might be some discrepancies with values outside the normal 0-1 range but surely this shouldn't be? Putting in an intervening [Clamp 0-1] doesn't help, and has the same preview.

    is this a known issue? It's making it really hard to get the logic of my material correct
     
  7. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    503
    Some things might be messing with you - linear/gamma rendering and sRGB option on the texture import.

    For future reference, when testing something that seems odd, plug it alone into emission and plug zeros into albedo, metal, roughness, etc and (0,0,1) into normal. That way we know it's not anything else in your shader messing with it.
     
  8. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    It just doesn't make sense that the shader wants to use the fallback shader when it works on my older Mac. And I know that Unity uses the dedicated graphics card, so it's not some integrated Intel.
     
  9. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    I removed the Metal-API from my Mac target (so only OpenGL is used when playing my game on Mac) and now it works. Is this a known issue?
     
  10. theFireman

    theFireman

    Joined:
    Nov 28, 2015
    Posts:
    4
    Hey @all,

    I am new to shaders and shaderforge and I want to make a shader for UI Text and I can't find a way to change the color of the text. This is my current aproach, it displays the text and cuts it out in the right way, but the text is allways black:

    helpmeplease.PNG

    thanks in advance for your time :8
     
  11. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Well, if you multiply 0 (black) with any number you still get 0. Did you try Add instead of Multiply?
     
    rgarrett7 and theFireman like this.
  12. theFireman

    theFireman

    Joined:
    Nov 28, 2015
    Posts:
    4
    That did the trick, thank you soo much. I'm stupid :D

    I think these nodes confuse me sometimes!
     
  13. CosmosBear

    CosmosBear

    Joined:
    Aug 2, 2012
    Posts:
    67
    HI!
    A quick question, we seem to have some issues with the shaders made with SF on our Nintendo Switch port. Is Shader Forge supported on Switch?
     
  14. yusefkerr

    yusefkerr

    Joined:
    Apr 5, 2011
    Posts:
    179
    Hello, ShaderForge doesn't seem to be working with Unity 2017.3.0b8. When I try to load it from the "window" menu, the shaderforge editor starts to open but the window is blank. The same happens if I open a shader and click "open in ShaderForge". Is this a known issue? Is there a fix?

    I've tried deleting the ShaderForge folder, restarting my computer and restarting Unity but it hasn't helped.
     
  15. rgarrett7

    rgarrett7

    Joined:
    Dec 10, 2016
    Posts:
    32
    I am using Unity 2017.2.0f3 and ShaderForge seems to work fine. I have not upgraded to 2017.3.0b8, so don't know if there is an issue caused by the beta release.
     
  16. dblincoeii

    dblincoeii

    Joined:
    Mar 4, 2015
    Posts:
    19
    Great work! Realize this is a slightly old post and I have been trying to go thru the thread but can you share the node tree? How are you pulling off subsurface scattering? Thanks!
     
  17. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Thanks :)
    It's basically a hack where it uses sharp, perturbated normals for the green and blue channels and uses brighter, smoother normals for the red. Which makes it look like the light is diffusing inside the model and gives out of a flesh-like look.

     
    FPires and Adam-Bailey like this.
  18. janvetulani3r

    janvetulani3r

    Joined:
    Feb 8, 2017
    Posts:
    12
    Hi, is it possible to have different sorting on different parts of the shader?
    I need to add an outline option to a shader forge shader, however I need the shader to be rendered above everything else, yet still covered by the object it belongs to.
     
  19. LT23Live

    LT23Live

    Joined:
    Jul 8, 2014
    Posts:
    98
    Hi, I have been using shader forge for quite some time now. I made a shader that runs off an emmissive channel but calculates shadows as well. When it does the shadows seem to be fragmented. almost stylized. Someone else has reported this issue before, and it was supposed to be fixed already but i am seeing it persistent. Unity 2017.2.0p4
     
  20. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    Guys How do i get this :
    Code (CSharp):
    1. // Fragment shader
    2. float4 frag( v2f i ) : COLOR
    3. {
    4.     float4_t diffuseMapColor = tex2D( _MainTex, i.uv );
    5.  
    6.     float_t maxChan = max( max( diffuseMapColor.r, diffuseMapColor.g ), diffuseMapColor.b );
    7.     float4_t newMapColor = diffuseMapColor;
    8.  
    9.     maxChan -= ( 1.0 / 255.0 );
    10.     float3_t lerpVals = saturate( ( newMapColor.rgb - float3( maxChan, maxChan, maxChan ) ) * 255.0 );
    11.     newMapColor.rgb = lerp( SATURATION_FACTOR * newMapColor.rgb, newMapColor.rgb, lerpVals );
    12.  
    13.     return float4( BRIGHTNESS_FACTOR * newMapColor.rgb * diffuseMapColor.rgb, diffuseMapColor.a ) * _Color * _LightColor0;
    14. }
    Into shader forge to get the effect of the outline on the Left of this image :
     
  21. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    No one knows how ??
     
  22. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
  23. WilliamEnders

    WilliamEnders

    Joined:
    Nov 10, 2015
    Posts:
    5
    Any info on shader forge's compatibility with UI in 2017.2? The sprite 2d preset with no changes displays text and images as black boxes. Am I missing something?
     
  24. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    The forum is dead and the asset support aswell!GGWP (y)
     
    WayneC and rgarrett7 like this.
  25. Avonaeon

    Avonaeon

    Joined:
    Apr 17, 2012
    Posts:
    48
    Realize it's an old post by now, but you need to weld those verticies. Had a similar problem where welding them fixed it.
     
  26. KurokawaYuuta

    KurokawaYuuta

    Joined:
    Jan 15, 2018
    Posts:
    1
    I feel Sahder Forge is very difficult.:(
     
  27. Nijiem_Arhi

    Nijiem_Arhi

    Joined:
    Oct 4, 2017
    Posts:
    17
    Hey all,

    I've been thinking of a way to pack multiple splat maps into a single RGB channel.

    My thought is that given the full range of 256 values, we can pack multiple masks into a certain value range. For example, for a 3 mask set up in 1 channel: Mask A would exist between 0 and 85, B would exist between 86 and 170, and C would exist between 171 and 255. This would allow for an RGB texture to contain more than 3 masks (1 for each channel), the only limiter being the granularity/transition between masks (ie: range allocated for each mask).

    I've done some experiments, but honestly don't know the correct way to go about implementing this. Any insights?
     
  28. Dray

    Dray

    Joined:
    Dec 11, 2013
    Posts:
    2
    There is still no support for Texture2DArray in 2018, is there any way to implement custom nodes? I can't seem to find any helpfull documentation on that
     
  29. ClavusVG

    ClavusVG

    Joined:
    Aug 1, 2017
    Posts:
    4
    I'm upgrading a project from Unity 5.4 to 2017.3.1f1, and I ran into an issue with Shader Forge on Unity 2017.



    The left cube is a blank Shader Forge shader using the Forward render path, specular mode on Specular, and with 'Per-pixel light probe sampling'checked

    The right cube is a copy of the same shader, but with the render path set to Deferred (which our game is using). It doesn't appear to take any lightprobes or environment light into account. How do I fix that?

    Edit: same things happens with Unity's own Standard (Specular setup) shader. What's going on?
     
    Last edited: Feb 16, 2018
  30. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    503
    check in the tab on the left of the SF window, under lighting, that all the correct boxes are ticked. Also make sure you have something plugged into alb/met/rough otherwise it'll give weird results.
     
  31. Kamil-Sobierajski

    Kamil-Sobierajski

    Joined:
    Dec 14, 2016
    Posts:
    44
    ratking likes this.
  32. ClavusVG

    ClavusVG

    Joined:
    Aug 1, 2017
    Posts:
    4
    Tried all those things. It simply won't account for any environment lighting in deferred.
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    It is an interesting an unique look, definitely trying to look illustrative but with a digital flair, and looking a bit stark with the high contrast despite all the detail, so it lends itself easily to horror.

    It might be a bit heavy-handed for constant viewing or dynamic scenes. You'll find out once you get further into play testing.
     
  34. env_warby

    env_warby

    Joined:
    Nov 22, 2013
    Posts:
    23
    MP-ul likes this.
  35. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    Hi, I tried to open a project including shaders made with ShaderForge in Unity 2018.b7, and Unity seems to auto-disable the ShaderForge library:

    "Unloading broken assembly Assets/ShaderForge/Editor/ShaderForge.dll, this assembly can cause crashes in the runtime"

    Before this error, I'm getting a lot of other messages like this:

    "TypeLoadException: Could not load type 'UnityEngine.ProceduralMaterial' from assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'."

    Is there any workaround for this?
     
  36. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    Shader forge is dead :D not worth investing time into it.
     
  37. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    Sad to hear that. Why? Because Unity will add a shader editor themselves?
     
  38. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    503
    you haven't heard? Unity shader editor beta in 2018.1, you can also find it in the beta/experimental section of the forum, and probably some other places. There was a Unity Connect webinar intro to it last week as well. Their goal is to make something that will work with the SRP stuff, which is slightly different to the normal forward/deferred we've currently got. Will be interesting to see how they manage with that, but it's something Unity and only Unity would bother trying; for an external develop it would be impossible and pure madness to even begin.
     
    MP-ul likes this.
  39. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Use the source code from shaderforge in your project instead of the DLL and simply edit out all the ProceduralMaterial and Substance functions from the code, there aren't many, they're all in SF_EditorNodeView, only takes a few minutes.

    But while ShaderForge is a nice part of Unity history... I believe it's just that now, history. There are better node editors out there now that produce more efficient code, and Unity's own solution is looking to be a pretty defacto standard soon.
     
    Last edited: Mar 14, 2018
    booferei likes this.
  40. MrSmileypants

    MrSmileypants

    Joined:
    Sep 27, 2015
    Posts:
    1
    Hey guys,

    As i simply lost my head trying to figure out how i would go around creating a lens flare, i came here to ask.

    The point of it is to have a quad (lens flare) fade based on rotating away from the camera - so it always will shine brightest if it facing directly towards the camera.

    Just like this posted here:
    https://rohmizuno.com/object-angle-fade/

    Hope you guys might be able to help a man in need :)
     
    Last edited: Mar 24, 2018
  41. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Also if unity integrate some sort of shaderSystem....alternatives allways welome.
     
  42. MustardBoy

    MustardBoy

    Joined:
    Jul 10, 2015
    Posts:
    7
    Hi all,

    I discovered something strange about shadows attenuation (see the picture)

    Do you have any idea to fix this?

    thank you in advance.

    shadow.jpg
     
  43. Houchunzhe

    Houchunzhe

    Joined:
    Mar 30, 2018
    Posts:
    4
  44. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Sorry I don't have those project files anymore. Although the link works, you probably got a url error.
     
  45. RealWyldhunt

    RealWyldhunt

    Joined:
    Dec 5, 2017
    Posts:
    32
    Definitely not working in Unity 2018.
    Is this project dead now?
    Anyone seen the creator around?
     
  46. Houchunzhe

    Houchunzhe

    Joined:
    Mar 30, 2018
    Posts:
    4
    I had done it,thank u for reply,but I did not thing that project as same as the picture which you had showed:(
     
  47. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,664
    He's currently busy with a side project called "Budget Cuts": https://twitter.com/JoachimHolmer/status/983485651097149440
    There's also a slight chance that "Shader Forge" might become free without receiving any further support: https://twitter.com/JoachimHolmer/status/983485655635386369
    The reason is that he can't keep up with all the support requests/emails anymore and that he's "at a point where I find it very hard to relax, even in my spare time" (src).
     
  48. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    In my opinion, "ShaderForge" is one of the best shader systems out there. Really powerfull and also pretty good performance wise. Therefore it would be great if the dev can port it to U2018. If he is willing to make it free, it would be very kind to do it after the porting.
     
  49. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Rather than simple deprecation, I like to see old plugins become open source on GitHub.

    It's not a big deal for me personally, as it was made clear years ago this project was nearing the end of support, but it just seems like good policy.
     
  50. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Ok, so what's happening with deferred rendering path with this asset? Does it support it? I understand that it can be limited, but does it support deferred path in any meaningful way?