Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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
    Does anyone know how to create terrain shaders in Shader Forge? I am looking to create a triplanar shader to prevent stretching.
     
  2. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    For a temporary fix, in the shader code, remove the line with the _Cutoff property at the top
     
    djweinbaum likes this.
  3. djweinbaum

    djweinbaum

    Joined:
    Nov 3, 2013
    Posts:
    533
    ... You've... fixed... EVERYTHING! I had a cutoff step slider property that I also had to get rid of (seemed to be messing with it as well). Now I just handle that in my alpha of the texture. I don't see any repercussions to removing that other than fixing everything. Its been a LONG time since my game looked right like this! Thank you so much!

    EDIT - I'm an idiot. It doesn't fix it at all :(. I'd just forgotten to re-enable ssao. Also it makes weird artifacts where there is supposed to be transparent geometry. If I could figure out how to do transmission in deferred then that would be a solution for me. Anyone have any ideas on how to do that? Maybe with nodes?
     

    Attached Files:

    • bad.jpg
      bad.jpg
      File size:
      444.3 KB
      Views:
      3,958
    Last edited: Jun 10, 2015
  4. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Any insights as to why the _Cutoff property causes these issues? Just curious. :)
     
  5. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Hi there Joachim,

    It has been a long time since I made you the last request.
    Can you make the tessellation node compatible with quads? (the new "keep quads" option from unity 5). Simply for better tessellation.
     
  6. awesomeliquidbear

    awesomeliquidbear

    Joined:
    Nov 14, 2013
    Posts:
    9
    Hey first time posting in this thread... but having a bit of a problem with a shader i created in shader forge. ( I am a complete noob when it comes to shaders)
    I have created a simple shader effect for a dash attack . But I am having problems with the opacity not rendering particles behind the mesh. When I change to opacity clip the whole texture goes into a dot effect. As I said I am a complete noob when it come to shaders and need a bit of help.
    Below is a picture of the shader nodes the way the effect looks cool

    but it gives this effect when particles go behind it

    changing to opacity clip gives this funky result. The particle is visible but the effect is completely ruined


    Any help would be much appreciated!
    Thanks
     
  7. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Hello there! Why Shader Forge shaders use only 2 lights in forward mode (unity 4.6.5)? Is it possable to remove this limitation?
     
  8. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Have you checked the quality settings of your project? I would suggest looking there first - you might have limited your project/editor to 2 pixel lights only.
     
  9. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    Check the blending panel. (Don't render depth with alpha-blended shaders unless you really know what you're doing (even if you're a master's son))
     
  10. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    @RockSPb go to your quality settings in unity and go to fantasic or make your own level and add more light limits
     
  11. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    It was used by replacement shaders for rendering depth in pre-Unity 5, but in Unity 5, I have no idea what kind of shenanigans it's up to. Clearly, it still affects something.
     
  12. awesomeliquidbear

    awesomeliquidbear

    Joined:
    Nov 14, 2013
    Posts:
    9
    Changed the blending options..... no effect. :(
     
  13. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    68
    Hello. First, great update!
    This is not a direct Shader Forge question but as you guys know a lot about it I would like to ask if you know how can this effect achieved? via shader? any other kind of effect? I'm talking about how the street objects that are getting closer or farther from the camera won't just pop but are rendered with an alpha gradient-like effect, Like an depth biased alpha depth mask (I don't know haha).

    Here's the video for reference:



    THANKS!
     
  14. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,083
    It looks like it'd just be distance blending but with alpha instead of colours.
     
  15. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    http://simonschreibt.de/gat/assassins-creed-3-lod-blending/

    Alphatest blending could be used as well. This removes sorting issues and allows for proper fogging. SF has a neat feature since some versions ago - it can use a dithering matrix for anything alphatested.
    I guess that you could try to get a screen-door transparency effect going:
    http://www.digitalrune.com/Support/Blog/tabid/719/EntryId/194/Screen-Door-Transparency.aspx
     
  16. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    68
    Oh thanks!!! great answers form both of you.
     
  17. PrawnJeremy

    PrawnJeremy

    Joined:
    Aug 20, 2013
    Posts:
    35
    Hello everyone. I am updating my project to Unity 5 and it broke some of my shaders. I am scouring the forum here to find something to point me in the right direction but figured I would go ahead and post about the issue as well. I am using render textures projected down onto the ground for my character shadows to avoid self shadowing. You can see an example in my avatar. That shadow is in Unity 4.6 with the following code which doesn't work in Unity 5:

    Code (CSharp):
    1. Shader "Custom/RTSProjector"
    2. {
    3.   Properties
    4.   {
    5.      _Color ("Main Color", Color) = (1,1,1,1)  
    6.      _ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
    7.      _FalloffTex ("FallOff", 2D) = "white" { TexGen ObjectLinear }
    8.   }
    9.   Subshader {
    10.      Tags
    11.      {
    12.         "RenderType"="Transparent-1"
    13.      }
    14.      Pass
    15.      {
    16.         ZWrite Off
    17.         Fog { Color (1, 1, 1) }
    18.         AlphaTest Greater 0
    19.         ColorMask RGB
    20.         Blend SrcAlpha OneMinusSrcAlpha
    21.         Offset -1, -1
    22.         Color [_Color]
    23.         SetTexture [_ShadowTex]
    24.         {
    25.             constantColor [_Color]
    26.             combine texture alpha * constant
    27.             Matrix [_Projector]
    28.         }
    29.         SetTexture [_FalloffTex]
    30.         {
    31.            constantColor (1,1,1,0)
    32.            combine previous lerp (texture) constant
    33.            Matrix [_ProjectorClip]
    34.         }
    35.      }
    36.   }
    37. }
    The Unity Wiki says things like AlphaTest are now Legacy and "It is advisable to use programmable shaders these days instead of SetTexture commands" So that along with the fact that it is broken now leads me to need to make a shader that uhhh works.

    Any help figuring this out in terms of SF nodes would be appreciated.
     
    Last edited: Jun 12, 2015
  18. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    @Acegikmo In latest update 1.16 the mouse wheel not scrolling when i call context menu and windows not scale. What happens?
    Unity 5.1
     
  19. PrawnJeremy

    PrawnJeremy

    Joined:
    Aug 20, 2013
    Posts:
    35
    I just realized the above broken in Unity5 projector script came from finding out it was not possible to do something like that in Shader Forge in Aug of last year. So I guess first thing first, is it even possible to create with Shader Forge?
     
  20. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    How to make the same effect as in the lesson?

    I follow the lesson of but problems occur when creating the mask, at 20:52
     
  21. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    What exactly are you having trouble with? Creating that voronoi like noise texture?
     
  22. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Shaderforge does not have sphereMask node, I can not replace it with something else
     
  23. AkiLap

    AkiLap

    Joined:
    Sep 14, 2014
    Posts:
    24
  24. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
  25. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Last edited: Jun 14, 2015
  26. Furax

    Furax

    Joined:
    Nov 20, 2013
    Posts:
    5
    Hi, is it possible to do Opengl Tesselation with Shader Forge 1.16 and Unity 5.1 ?
     
  27. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    how do i project a cloud texture on the sky shader that is included in the examples? for now i just add the cloud texture, but i dont have the correct UVs. the texture stretches in the center of the skybox like in this image screen1.jpg .how do i map it to fill and tile the entire skybox?
     
  28. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Can I use this asset to create my own water (and shader) as alternative to the basic one with Unity PE 5.x?
     
  29. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    I have no idea what you're really wanting, but I had fun creating something that looks similar. If this helps you, cool. If not, meh. :D
    SF_Vladnes.jpg
     
    DMeville and AkiLap like this.
  30. PrawnJeremy

    PrawnJeremy

    Joined:
    Aug 20, 2013
    Posts:
    35
    You can certainly use it to make a water shader but I don't know what shader goodies the PE may lock you out of using.
     
  31. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    the PE? Personal Edition?
     
  32. Deleted User

    Deleted User

    Guest

    I thought unity 5 personal edition (free) didn't lock you of any goodies within the editor.

    Only unity 4 and earlier versions did that
     
    DMeville likes this.
  33. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    I hope so. If I got Shader Forge I'd want to use it to the full extent and it would be nice to be able to create water shaders with it.
     
  34. topsekret

    topsekret

    Joined:
    Apr 18, 2013
    Posts:
    69
    We are using Shader Forge to create a post effect (which works pretty decently as long as you set all the settings correctly). However, we are running into an issue where rotating the camera at certain angles causes the entire screen to turn white.

    This seems to be caused by the #pragma multi_compile_fwdbase_fullshadows, since if I remove that line, the problem gets fixed. Searching around online, I haven't been able to determine what this "special" multicompile does, but our shader works better without it. Is there a way to tell ShaderForge to remove this line? Our will I have to train our fx artists to manually remove this line whenever they modify the shader?
     
  35. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,083
    I did some playing around. This is by no means perfect and I guesstimated how a lot of the textures look because the video wasn't super high res, but...



    edit: The -1 value should be 0

    edit 2: A video with some extra bits added on:

     
    Last edited: Jun 16, 2015
    DMeville likes this.
  36. Deleted User

    Deleted User

    Guest

    DMeville likes this.
  37. animate_xyz

    animate_xyz

    Joined:
    Dec 5, 2012
    Posts:
    9
    Hi All,
    I'm combing through the example shaders that come with SF to better understand how different nodes work with each other. More specifically the vertex animation shader. At the end of the tree there is a panner node connected to a Comp. Mask node and then a Frac node. I'm wondering if anyone can tell me why the Frac node is necessary when the Panner node U value is 0.25? Is there a value in the Comp. Mask node that requires the Frac? When I bypass the Frac my object disappears.
     
  38. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Very clever use of shell technique man. I like it. :)
    Maybe you can try displacement maps to create the illusion of depth.
     
  39. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,083


    Since I'm targeting low-end desktops with my game and needed this effect anyway, I decided to try this but keep the effect super simple. It's just a simple normal extrusion based on the main texture with a slider slapped on there, which keeps it pretty quick and looks alright so long as the surface has enough tessellation.
     
    DMeville likes this.
  40. jcfalcone89

    jcfalcone89

    Joined:
    Jun 17, 2015
    Posts:
    11
    I'm getting a error on Shader Forge 1.6 with Unity 5.1.0f3

     
  41. Dvonio

    Dvonio

    Joined:
    Oct 15, 2013
    Posts:
    20
  42. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Thanks!
     
  43. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Сool technique
     
  44. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    It's not using GGX at the moment, no. It's set up to match Unity's shaders
     
  45. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    470
    Apologies if this has been asked before but is there somewhere I can get version 1.06 for use with Unity 4?
     
  46. jcfalcone89

    jcfalcone89

    Joined:
    Jun 17, 2015
    Posts:
    11
    Hey @Acegikmo, Did you see my post?
     
  47. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Try reinstalling SF using this procedure: http://acegikmo.com/shaderforge/faq/?Q=erroronnewversion#erroronnewversion

    Download SF through Unity 4, and you should get the correct version
     
  48. Dvonio

    Dvonio

    Joined:
    Oct 15, 2013
    Posts:
    20
    Hey, Thanks for answering so fast, I have one more question, on the change log of 1.10 it says
    - Fixed a bug where lightmapping didn't work (Note that Directional Specular lightmaps aren't supported yet)

    Do you have any ETA or workaround to get Directional Specular Lightmaps working?

    Thank you so much.
     
  49. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    I'm trying to create an animated glimmer on an object. It's hard to describe, but basically it is like a shine effect that animates over an object to get a player's attention. I need to be able to control this programmatically also in order to turn it off and on. Anyone have any suggestion on how to make this using ShaderForge?
     
  50. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi there,

    Would be nice to see a 24 hr special on the asset store of your great product.

    Regards Peter