Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Shader Forge - A visual, node-based shader editor

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

  1. douglasg14b

    douglasg14b

    Joined:
    Oct 2, 2014
    Posts:
    34
    Out of curiosity, can shader forge do stencil buffer type things?
     
  2. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    597
    What I don't understand is why you have included two sheen texture samplers - one for the "pattern" and one "sheen" texture.
    The pattern should be enough to get your desired effect. The "sheen" texture is a waste of memory.

    I suggest you remove that sheen texture and just use the pattern mask to drive your glow. So everything that happens on the upper part of the graph can be deleted.
     
    Last edited: Apr 10, 2015
  3. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    Just wondering if anyone has ever created a Skyrim-like flowing water shader.

    This is the kind of thing I am looking for, if someone can provide a Shader Forge example like this (preferably with refraction & textures) I will be more than happy to add them to the credits for our next tech demo.
     
  4. Deleted User

    Deleted User

    Guest

  5. dblincoeii

    dblincoeii

    Joined:
    Mar 4, 2015
    Posts:
    19
    Hi guys. Just got ShaderForge a couple of weeks ago and WOW! This is exactly what I needed. Get back to being an artist instead of a programmer. There is one thing I cannot figure out. Is there a way to reduce or increase the intensity of a normal map with shader forge instead of re-creating a new normal map in another app? Thanks in advance for any pointers and thank you for the amazing tool!
     
  6. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    558
  7. RodzGames

    RodzGames

    Joined:
    Dec 9, 2014
    Posts:
    24
    Hi! I have an error in my shader. It says I have an undeclared identifier called "indirectSpecular". This error happen when I checked "Lightmap & light probes" in the lighting setting of shaderforge.

    I have the latest version by the way. Am I doing something wrong?
     
  8. Deleted User

    Deleted User

    Guest

    Cactus_on_fire; Yes, the norm dir node is used to a create a mask based from the normals. the y projection is what makes it more complicated than just plugging in some height-maps.

    dblincoeii you can multiply your normal map by a vector 3, changing the 3rd value of the vector 3 will change the normal-map strength.
     
  9. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    597
    @worldcrafter I posted an example for you in your original thread. Maybe I'm not getting your point but the perturbed Normal Dir node will return the final normal after all your modifications have been done.
    So to clearly separate the base normal affecting the moss' normal you have to do your own calculations and not rely on the Normal Dir node.
     
    Deleted User likes this.
  10. Deleted User

    Deleted User

    Guest

    Marco Sperling! you are absolutely correct, that is just what i required.
     
  11. Deleted User

    Deleted User

    Guest

    Another my creation made with SF

    A simply approximate fluid simulation

     
    Baldinoboy and DMeville like this.
  12. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,280
    @H92
    Do you only used SF for this?
    Also it can be looking more natural it is looking great and i would like to know how you have done this.
    Maybe you can share your way?
     
  13. Deleted User

    Deleted User

    Guest

    Last edited by a moderator: Apr 22, 2015
    FreakForFreedom and DeadNinja like this.
  14. Deleted User

    Deleted User

    Guest

    hmmmmmm...........................
    I still need proper version of this shader............I would like to create effects like in this example:
    http://help.chaosgroup.com/vray/help/150SP1/images/examples/displacement/vector_displ_shape.png
    I understand that this version of "alpha height" shader is more optimized, but I have got power-end computer. I don't know how connect nodes to create RBG Vector displacement shader... I should erase "Normal Dir" ?

    Texture:
     
  15. Deleted User

    Deleted User

    Guest

    a simple question for those familiar with shaderforge: how can i change the scale and position of a texture (UV) from local to world. I have tried using "transform" but it will not plug into uv's
     
  16. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
  17. Deleted User

    Deleted User

    Guest

    @DaDarkDragon I don't want planar mapping/projection, I want the texture to operate within its uv's, but with world space tiling and position; if i scale the model the texture will not scale, If i move the model the texture will not move.

    This is how to do it with scale

    my problem is position​
     
    Last edited by a moderator: Apr 10, 2015
  18. Deleted User

    Deleted User

    Guest

  19. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
  20. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    Flowmaps seem to be very "trippy".
    When using a basic map, and the shader provided in the link, I get it jumping or resetting back to the beginning without completing a cycle.
     
  21. Deleted User

    Deleted User

    Guest

    How can i sharpen A mask? I want to make it less soft around the edges but not to hard.
     
  22. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,042
    Hi guys, I need some shaders like skin or metal or ... for shader forge! Is there any?
     
  23. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    Does anyone know how to modify Verts in Shader Forge dynamically via a vertex painter? I am looking to add (when painting the blue channel) to alter the height of specific verts.
     
  24. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Use the vertex color node to read the blue channel, and then multiply that by the normal vector, and a constant (that controls the max length), and plug it into vertex offset
     
  25. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,042
    Hi. did you ever work on a metal shader? I yes can you please share one of them! I'm new in shader forge and need to learn how can I build a good meta shader
     
  26. Deleted User

    Deleted User

    Guest

    Can you post an example of metal shader that you want make?
     
    ksam2 likes this.
  27. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    Anyone got a realistic-ish "glass" shader in Shader Forge? When I got my new PC I must have lost it, can't find it anywhere.
     
  28. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,042
    Something looks quite similar to the iron. something like this gun or its bullets

     
  29. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    This is something you can do without Shader Forge, just use the Unity 5 Standard shader, bump up the smoothness and use a reflection probe. You may need to mess with the levels to get it how you like it, but for something this basic in color, I would not use a separate shader.
     
    ksam2 and Deleted User like this.
  30. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,246
    Enable PBR, turn on reflective transparency, connect 0.05 or so into Opacity, and add refraction if you want. Set metallic to 0 and albedo to whatever seems to fit best
     
  31. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,042

    I've test Unity 5 Standard shader for days and I'm not happy with the result! It's too simple
     
  32. Deleted User

    Deleted User

    Guest

    i think if you get familiar with reflection probes and the real-time GI, you will get very satisfactory results with the standard shader (regarding metal surfaces) providing you have decent normal maps/models/textures.



    Still don't know how to sharpen a mask, anyone?
     
    ksam2 likes this.
  33. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,042
    Is there any good tutorial for shader forge?
     
  34. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    403
    @ksam2

    Basic Shader
    Custom Blinn-phong
    Vertex colours

    The shaderforge wiki is filled with interesting and helpful stuff too: http://acegikmo.com/shaderforge/wiki/index.php?title=Shader_Forge_Wiki

    Aside from those I recommend just spending some time in shaderforge exploring. Find out what certain nodes do, and try and think through the effects and how they might be composed. You can then always right click a node and select "What does this do" to bring up the node reference. http://acegikmo.com/shaderforge/nodes/
    UE uses a similar node-graph for shaders too, so tutorials from there might be applicable as well. Not to mention this thread is a goldmine for learning, you just have to take the time and read some of the old posts :)

    Regarding your PBL metallic shader, I agree with the others; The standard shader is very versatile, so with the right lighting, reflection probes, and properly authored maps I'm certain you can get some very pretty looking models. You say "too simple" but that's not a very descriptive way to explain what you're looking for :)

    @Labyrith Studios: I'm pretty sure the effect from Skyrim is just UV Scrolling, (Just popped into Whiterun, 99% sure) that's how water like that is usually done, anyways. Probably using a few layered maps panning at different speeds to get some interesting looking highlights. http://acegikmo.com/shaderforge/wiki/index.php?title=UV_Rotation_&_Panning
     
    Acegikmo and ksam2 like this.
  35. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    None free, I'm afraid, it's very "trial and error" with these things.
    Most of the UDK ones work, the nodes systems are very similar.
    You may also be interested in this:
    http://acegikmo.com/shaderforge/wiki/index.php?title=Shader_Forge_Wiki
    And this:
    http://acegikmo.com/shaderforge/tutorials/

    And possibly this:

    http://www.gametutor.com/live/tutorials/unity-shader-forge/getting-cozy-with-shader-forge/
    http://www.gametutor.com/live/tutorials/unity-shader-forge/shader-forge-volume-2/

    If you find any good resources, please let me know, I'm always looking to further my Shader Forge (and shaders in general) knowledge.
     
    DMeville likes this.
  36. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,441
    Hey just wondering how Shader Forge fits in with Unity 5.

    For example, I'd can make vertex colour shader easily with Shader Forge, but could I make that shader work with reflection probes or baked lighting?

    (Also it feels wrong asking this here because there are a million other questions, is there another place I should be posting this?)

    Thanks,
    Pete
     
  37. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    @Labyrith Studios hmm... It's probably outdated for U5 then.
     
  38. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Do you know of paid ones?
     
  39. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    OnePxl likes this.
  40. plasmabazooka

    plasmabazooka

    Joined:
    Mar 8, 2015
    Posts:
    70
    I've searched a lot but could not find an answer.

    What about performance for Android?
    I'm interested especially in vertex colors, splatmaps and outlines.

    And the second question: is it possible to create a shader like x-ray vision to see objects behind walls?
     
  41. lost_lee

    lost_lee

    Joined:
    May 28, 2014
    Posts:
    2
    hi Acegikmo and all
    I need a Xray effect like the picture,I tried so many ways with SF, but...
    Please give me some hints..
    thx
    xray.jpg
     
  42. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    597
    There should be an example inside this thread. Basically it involves rendering the mesh twice.
    Since Shader Forge does not support rendering in multiple passes you have to do it using two materials.
    Or you could build two shaders - one for correctly lighting the object in question. And one for the x-ray effect. In the last step you would merge the code manually into a 2-pass-shader.
     
  43. lost_lee

    lost_lee

    Joined:
    May 28, 2014
    Posts:
    2
  44. kr3d

    kr3d

    Joined:
    Apr 13, 2015
    Posts:
    6
    Hello,

    I have problem with shader what i made in shader forge.

    I create that shader:
    1.png

    so tilling of texture = scale of my object and in 90% of cases this work and look like this:

    2.png

    so i have object with scale 7 by 9 and my tilling = 7 by 9,
    But... In case of position of that object and position of camera, sometimes tilling going back to 1 by 1 like in this case ( i only rotate camera)
    3.png

    Another example (Only moving camera back)
    4.png

    And in game mode this change tilling too
    What i do wrong?
     
    Last edited: Apr 13, 2015
  45. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    This looks like you are using ProBuilder, if so, it may not be a shader problem but the UV mapping not updating correctly, if you are using ProBuilder (or Prototype) check the UV to make sure it is scaling properly, then we can rule that out and focus on the shader.
     
  46. kr3d

    kr3d

    Joined:
    Apr 13, 2015
    Posts:
    6
    Yes i have probuilder in project, but not using it in this case. I create simple plane mesh and manually scale it (Second example was on default unity box).
    Removing probuilder from project not fixing this problem too :(
     
    Last edited: Apr 13, 2015
  47. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    Ok, so we have ruled out ProBuilder then.
    At first glance your shader does not appear to be doing anything out of the ordinary, but I am attempting to replicate this effect now.
    Can you tell me anything about what is actually triggering this to happen, do you do anything specific for this to happen?
     
  48. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,320
    P.S. How do you make a Shader Forge shader look like the Standard Shader (with the tiny boxes)? I have access to the Standard Shader code but I haven't found anything specific in it to change the display settings.
     
  49. kr3d

    kr3d

    Joined:
    Apr 13, 2015
    Posts:
    6
    I normally "create new shader" from shader forge window and start creating shader :)
    Next i attach it to plane:
    5.png

    I attach this shader too

    I think you can just move object and rotate camera around it and that's all what i do :)


    EDIT:
    Hmmm this is weird because in new scene I can't replicate this problem :(

    EDIT 2:
    I replicate it - I duplicate my object and shader broke :)
     

    Attached Files:

    Last edited: Apr 13, 2015
  50. kr3d

    kr3d

    Joined:
    Apr 13, 2015
    Posts:
    6
    So how i replicate this

    - I create new scene,
    - create plane (GameObject/3d Object/Plane)
    - Set material on this plane
    - Change scale of object to (5,1, 5)

    6.png

    - all is okey
    - i duplicate object and shader broke

    7.png
     
unityunity