Search Unity

Shader Forge - A visual, node-based shader editor

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

  1. ViktorKom

    ViktorKom

    Joined:
    Feb 24, 2015
    Posts:
    29
    It is great tools.
    Pleas update node help, such does not have DDX and DDY
     
    RockSPb likes this.
  2. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    @ViktorKom yes it does, just serch dd, however it does not have object scale(still don't know what reciprocal on it means) and a lot of others as well when i took a quick look
     
  3. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Agreed, node help is not complete currently. Missing smoothstep for example.
     
  4. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,422
    By maxing out the height on the Standard Shader, I found out that the Unity method for "Height" is 2 layered ontop of each other.
    It looks like 2 versions of the same material layered.

    If anyone has any idea how to do this, or a better way of using a heightmap, please let me know.
     
  5. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Added node documentation:
    • Smoothstep
    • Inverse Lerp
    • Object Scale
    • Face Sign
    • DDXY
    • Hue
    • RGB to HSV
    • HSV to RGB
    • UV Tile
    • Matrix 4x4
    • Matrix 4x4 Property
    • Multiply Matrix
    • Transpose
    • Reciprocal
    • Fog Color
    • Switch
    • Toggle

    ping @DaDarkDragon, @stationx
     
    ViktorKom and Marco-Sperling like this.
  6. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    I figure you're already aware, but it's a bit of a pain that you can't really dock the window (when you go back to the menu, it will close the window and create another one that is floating instead of docked)

    edit: Unity 5.2.1p2, OSX Yosemite, Shader Forge v1.21 - getting this error with some examples:

     
    Last edited: Oct 11, 2015
  7. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Yeah, it's something that I can't solve anymore really. It has partially to do with how Unity's docking system behaves when you have maximize on play on. When maximizing, it doesn't just hide the editor windows, it destroys them. And SF isn't set up at all to be able to reload its previous state.

    Odd, I'll have to look into it.
     
  8. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Hi,
    I have some issues trying to create a shader that renders geometry in the background.
    In deferred mode, this doesn't seems to work. (also the default sky shader doesnt render in the background)
    When I switch to forward, it works, but I get a tons of other erros related to other post effects and overal switching to forward is not an option.
    How can I fix this?
    Regards!
     
  9. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    What node(s) should I use if I wanted to blend two different colors with a grayscale map?
     
  10. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,152
    This is a job for the lerp node
     
  11. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    Perfect, thanks!
     
  12. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    Is it possible to use gray scale images for Metallic and Gloss?
     
  13. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Yes, just plug in a Texture2D node channel, such as R, into the metallic or gloss slot
     
  14. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,209
    Thanks
     
  15. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    again..how to fix background rendering shading in deferred mode?
     
  16. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    You are welcome to post a graph with your current shader and a screenshot showing the background artifacts you are speaking of. I for one have some trouble understanding your issue without such attachments. :)
    Also you may have noticed that there is now a dedicated SF forum: http://neatcorporation.com/forums/index.php
    Topics started over there profit from a better search function. This thread is getting rather long now.
     
  17. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    you are right, let me show an example...
    This is the most basic setup. I applied the default sky shader from the shader forge start menu to the sphere.
    On forward mode, this is correct. The sphere is rendered behind the terrain, in deferred is it not and you can see clearly the sphere inside the terrain as a usual object. The terrain shader is nothing fancy either.
    @Acegikmo any ideas? Looking forward for solution.
     
    Last edited: Oct 14, 2015
  18. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    ACCESS BACKFACES

    I´ve done a nice cross-section shader with Shaderforge that allows me to move and rotate the sectionplane in realtime.
    It has backfaceculling off so that inner faces are visible.

    What I now want is to draw these inner faces in a simple unlit color like here in red:



    I found an article (last part) about how this can be done but don´t know how to apply it to my generated code as I am not familiar with writing shaders.

    Any help would be cool, my favourite solution would be to do it directly in Shaderforge (e.g. with the Code-node?).
     
    Last edited: Oct 13, 2015
  19. Ducahl

    Ducahl

    Joined:
    Dec 9, 2014
    Posts:
    20
    I am trying to make a shader that has a panning cutout(alpha clipped) texture that also uses transparent vertex color to make the panning texture taper off at the ends of my mesh.

    I am getting it mostly working, but I can't seem to get the alpha blending correct. Either I get the line but not vertex alpha or I get it all working together but it is darkened.

    Would anyone like to take a shot at it?

     
  20. petkovas

    petkovas

    Joined:
    Oct 12, 2013
    Posts:
    28
    Hello!

    I am new to the shaders world. Thus, my probably naive question.

    Is it possible (how?) in Shader Forge to be reproduced the Custom/BrightTexture shader from Unity (4.6)?

    Edit:
    Would the Multiply Node, connected to the Diffuse channel help?
     
    Last edited: Oct 13, 2015
  21. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    I'm not sure how you'd go about it exactly, but I am curious if you find a solution!
    I wonder if @H92 example has something in there that might help you out.
    http://forum.unity3d.com/threads/sh...sed-shader-editor.222049/page-86#post-2260918
     
    Deleted User likes this.
  22. LennardF

    LennardF

    Joined:
    Apr 26, 2014
    Posts:
    19
    When making a custom lighting shader, how would one go about factoring a diffuse into that? If you look at UDK for example, when you make a Custom Lighting shader, you'll get a Custom Lighting Diffuse.
     
    Last edited: Oct 15, 2015
  23. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Start SF, click new shader, select the custom lighting preset, and you'll see where diffuse goes :)
     
  24. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    Can you use Shader Forge to create image effect shaders? Any docs / tutorials on it?
     
  25. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    there is a preset for it. its called post-effect or post process. then you'll need to make a script to use it like the others
     
  26. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    J_P_ likes this.
  27. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Last edited: Oct 18, 2015
  28. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51

    That's the right decision? It looks like works.
     
  29. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Oh, sorry, yeah, it wasn't screen :)
     
    Vladnes likes this.
  30. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    let me try this again...
    i have posted this question on several forums now, seems like a very hard bug while nobody seems to have a solution. So much looking for a solution:
    Why does the blue sphere not render in background in deferred mode, while in forward mode it does and it should?


     
  31. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    I've seen you post about it, but I'm actually not sure why it would behave like that, hence the lack of response!
     
  32. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi.
    Just getting started with SF but 2 things driving me crazy.

    1 Why are all the node inputs and outputs flopped horizontally when compared with any of the online tutorials?

    2 Why is it necessary to REASSIGN textures in the Unity editor the moment you make any changes within shaderforge? Shouldn't these update by default? At the very least shouldn't this be left up to the user to decide?
     
  33. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Alphas and betas of Shader Forge had the nodes go from right-to-left, during which time many of the tutorials were created. However, when 1.0 came out, I changed the node direction to left-to-right, since it's generally more intuitive.

    I'm not entirely sure what you mean. Textures lose a reference if you rename your variables. Other than that you shouldn't have to reassign anything, unless you've found a bug.
     
  34. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    I was wondering, what would be the best way to tesselate based on distance to the camera but only what is in the frustrum...

    Or is tesseleation actually only working on visible parts of a mesh anyway?

    Thanks for any hints!
     
  35. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    how can I tile a texture inside an atlas?

    oh never mind...found the solution a couple of posts back...
     
    Last edited: Oct 20, 2015
  36. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    ok, unfortunate. hopefully it will get fixed soon. Anyways; I appreciate any response, even if it is 'i have no idea', at least, I know the post has been seen :)
     
  37. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,422
    Does anyone know of a way to create a mesh thickness-based translucency effect?

    I have been working on the candle wax shader for my game for a few hours now, but can't get it to transmit light through the thinner areas of the mesh, as wax or ice would.

    The Uber shader asset does this quite well, btu I prefer to keep everything in shader forge, that way I can edit it if I need to.

    https://www.assetstore.unity3d.com/en/#!/content/39959
     
  38. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,422
    Got another problem.
    I have white specs appearing on objects using custom shaders made with Shader Forge.
    After switching them to the default standard shader, they no longer appear.

    Has anyone else had this problem or know how to fix it?
     
  39. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,422
    Sorry to post again, but does anyone know if there is a Shader Forge alternative to BumpOffset from UE4?
     
  40. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    parallax node
     
  41. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Does anyone have experience with DDX, DDY nodes ? I have no idea what they do
     
  42. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    They're basically:

    "How much does this vector change, with respect to the X (DDX) / Y (DDY) axis of the screen?"

    For example, if you want to know the curvature in screen space, you can do this:

    sf_newshader_10232015.png
     
  43. Sinaz20

    Sinaz20

    Joined:
    Nov 16, 2009
    Posts:
    53
    @Acegikmo I have a curious one here... I have a few shaders that ignore sorting to force them to render on top of everything regardless.

    In a scene where I have two different sort ignoring shaders, I am trying to figure out how to get them to sort against each other. I thought the Order parameter would dictate that given they ignore z-depth... but no matter what I set Order to, these two shaders render in an unexpected order.

    Basically, I set one non-sorting shader to 4000, and the other to 4001 expecting the second shader to always render on top.

    Maybe I'm just not understanding how the shaders sort and you have a better technique for having two z-depth ignoring shaders manually sort against each other based on draw order?
     
  44. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Sounds like what I would try as well. Not sure why that doesn't work, but maybe the Unity docs can help with this, given that it's not really a SF related issue in this case?
     
    Sinaz20 likes this.
  45. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    this also sounds like the issue I am facing. Not really sure if this really Unity related. I have a few other assets that do render in correct orders.
     
  46. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Strange. Any idea what differs between them?
     
  47. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    nope. tried to copy the exact same order code part from the other assets and put it manuelly in the SF shader code. Didn't seem to help. My knowledge of shader code also ends at that point :-s
     
  48. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    1.22 is now out - with real-time node rendering! \ o/

    sf_realtime_2.gif

    Changes:
    • Node preview rendering is now a bazillion times faster:
    - You can now render nodes in real-time
    - Dragging sliders and changing values will no longer cause framedrops
    - Note: Some nodes are missing a GPU renderer, most notably, the Cubemap node and matrix operations
    • Optimized several parts of the interface, making it more performant
    • Fixed a bug where the RGB to HSV node didn't properly load
    • Fixed a bug where some lightmapped/reflection probed shaders didn't compile
    • The Shader Forge inspectors are no longer part of the .dll
     
  49. Sinaz20

    Sinaz20

    Joined:
    Nov 16, 2009
    Posts:
    53
    Further investigating this, there doesn't seem to be a selection in the Depth Test for the "Disabled" CompareFunction. How can I use the "Disabled" comparison?
     
  50. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    "now a bazillion times faster"

    I'm all for that!