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. Deleted User

    Deleted User

    Guest

    Actually I do not think there are many things I would like to see added, but between this there are:

    -A better editor rendering, without the sluggishness that affecting the current one.
    -A system of node sharing (also if I know that will be not simple to do).
    -Native SSS instead Light Wrapping approximation.
    -#include from third parts assets.
    -Custom tags.
    -More tutorials and controls on bugs.
     
    Last edited by a moderator: Aug 19, 2015
  2. Vicnent

    Vicnent

    Joined:
    Mar 21, 2013
    Posts:
    4
  3. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    There's not really a roadmap at the moment, for various reasons!
    The problem is that the roadmap of SF depends on the roadmap of Unity, which seems to alter itself every now and then.

    I still don't know whether or not Unity will/want to buy SF, and I still don't know when/if Unity will make their own shader editor. The future of SF depends a lot on this.
    In addition, Neat Corp is a tiny company of two, and we're currently running too many projects at once, even for our size.

    Currently, I've got to work on a talk for Unite 2015 in Boston, and we've also got a VR project with Valve's Vive that needs to be done before their release. My focus is currently on these two, so when I update SF, it tends to be smaller updates that I work on in my non-working hours, and thus there isn't much of a plan, I just try to scan the forums for bugs/features, and then add them as I find the time for it.

    So that's basically the situation!

    What about the future?

    Well, again, it depends on Unity.

    I did want to make Shader Forge 2 at one point, and even started it as well, in order to get the heavier features into it properly, but it would take time to do that - time that I'd rather not spend at the same time as Unity are making their own, just to have SF2 sales plummet when Unity's is out.

    So is Unity making a shader editor?
    If yes: Support SF until Unity's own is out
    If no: Might start working on SF2 after new years

    But if you want an approximate roadmap, here you go!

    As for specific features, from what I've seen so far, I could at least do this for 1.19:
    • Add custom #include .cginc
    • Add custom tags to your shader
    • More control over vertex positioning to make it easier to do things like billboarding and post-effects
    • Unity UI sprite support
    • Make tutorials
    Some maybe/research-features:
    • GPU node previews. This is a big feature I should have had from the start, but I'll look into it for 1.19
    • Light probe node
    • A proper transform node. The current one only transforms vectors/directions, not positions, which is confusing and misleading.
    • Improve performance when there are many nodes

    I hope that helps clarify things!
    If not, I'm here to answer any questions you might have :)
     
    Last edited: Aug 19, 2015
    IFL and Deleted User like this.
  4. Deleted User

    Deleted User

    Guest

    Is really a great roadmap if considering the fact that in previous versions there was more bugfixing that functionality.

    But however at this point I would say that you can continue to work without worrying about what it will do Unity, because :

    A)If they not buy the rights or create their editor, the various users who buy the assets will be not limited.
    B)If they purchase the rights, they will have anyway a something of more complete.
     
  5. testure

    testure

    Joined:
    Jul 3, 2011
    Posts:
    81
    My only input here would be that Unity's built-in implementations generally seem sub-par compared to third party solutions, except in those situations where Unity bought some existing technology (in the case of mecanim and uGUI, etc).

    I feel like in most situations, Unity is only really interested in checking a feature off of their todo list rather than making sure it's really the best solution out there- as people like you have done with third party solutions.

    Suffice to say, I'm super happy with Shader Forge! If it had multipass support one day I'd be even happier! :)

     
  6. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    Is there any way to create a shader supporting Parallax Occlusion Maps (POM) textures?

    I have been reading into the technology and rendering requirements/capabilities and Unity is fully supportive of the technique, but I quite like using node editors and was wondering if this technique specifically was achievable using Shader Forge, and if it is, could an example be provided.

    P.S. On another note, is there confirmation on whether Unity are bringing out a shader editor?




     
  7. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    I think of that every single time I type "multipass". Glad I'm not alone in thinking of it.

    @Labyrith Studios - I think there's one posted back somewhere in the 50s-page range. I'd find it for you, but it seems like every time you ask for help, you've already moved onto something else.
     
    testure likes this.
  8. IzzySoft

    IzzySoft

    Joined:
    Feb 11, 2013
    Posts:
    376
    hehe... i'm trying to make kissUI in beta atm, new UI for Unity, and its getting Allot of opposition. Just read the thread to see the Walloping i'm being given. :p At least its not boring. :|
     
  9. GNDDCD

    GNDDCD

    Joined:
    Aug 20, 2015
    Posts:
    5
    I wanted to know if anyone had some ideas on how I could have a matcap or fresnel shader that ignores interior geometry. Having either effect work on interior details of my characters and objects is creating some undesirable pixel trash on higher detail areas.

    Things like noses, eyebrows, etc, get all this highlighting data and I only really want it at the outline edges of the model. I can't simply use the outline function because I have smoothing groups on these models.
     
  10. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    You could approximate it by masking it based on distance to its centerpoint, though this will only work well for spherical objects. Otherwise, I'm afraid there's no easy solution to it.
     
  11. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Is it possible to create a simple fluid physics? To the fluid level is aligned with the horizon? Or does anyone know solutions to Unity? Scripts?
     
  12. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    You'll need a C# script to push data into the shader. I recommend pushing in a point and the direction of a plane into the shader, and then clip based on that. The plane is then driven by a C# script, that reacts to forces and so on
     
  13. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    94
    @Unity -> A single developer in half a year developed it, it's so hard to develop an shader editor version? we are @ version 5.x and still no in-house shader editor...
     
  14. Neogene

    Neogene

    Joined:
    Dec 29, 2010
    Posts:
    94
    ps. good work for the shader editor guy!
     
  15. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    Water physics are less viable in 3D games as the computation requirements (if it moves semi-randomly) put a lot of stress on the processor.
    Water is a notoriously hard thing to get right in games, and even those praised for having realistic water are not accurate representations of water.

    But @Acegikmo is correct, you will at the very least require a script to pass data to the shader, but something like this would not be easy.

    Are you looking for your water to move (wave)?
     
  16. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    It would be as in the example
     
  17. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    That one is actually just a skinned mesh, for better or for worse.
    In that case it's fully animated by the physics engine and the fact that it's skinned, with no shader specifics. The problem with that solution above is that it looks worse and worse as it's approaching 90 degrees, because, if you look carefully, you can see that the water surface is just rotating, not actually clipping on the edges of the tube.

    It might be fine depending on your situation, but I'd recommend a proper shader-based version :)
     
  18. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Thanks for the answers, but I'm afraid I do not have enough experience to make the script:)
     
  19. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Since you asked for tutorials, a three-part series on gradients is now up!
    Hope you find it useful :)



     
  20. GNDDCD

    GNDDCD

    Joined:
    Aug 20, 2015
    Posts:
    5
    I've not got a strong point of reference on how to start that... could you possibly show a tree, or just talk about the nodes I would use?

    I was thinking that I might try a solution that masks based upon how close a surface is to the camera, with the nearest point as 0 and the furtherest points as 1, and a step from .5 to 1 and .49 to 0. Never seemed to work, but I am a newbie with it.
     
  21. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Thank you. How to run the example? Scene in your package is empty.
     
  22. Deleted User

    Deleted User

    Guest

    Strange, maybe your Unity version is old, try with latest 5.1.2f1
     
    Vladnes likes this.
  23. Sinaz20

    Sinaz20

    Joined:
    Nov 16, 2009
    Posts:
    53
    Any ideas on how to treat the sky as depth = 0 when using depth blend? I know this seems a little counter intuitive, but we are using an isometric eye-in-the-sky, so our "sky" is really non-level-grout.
     
  24. dblincoeii

    dblincoeii

    Joined:
    Mar 4, 2015
    Posts:
    19
    Haven't seen any documentation or examples for the "Face Sign" node. What are some uses for it? I've been behind for a few releases and these new nodes are stacking up. I'm behind. Thanks!
     
  25. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    If you have a double-sided shader, you can use face sign to make the backside look different from the front, for instance :)
    It's basically just to detect whether or not the current face is a frontface or a backface
     
  26. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Multiply the fresnel by the distance between World Position and Object Position
     
  27. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    @Acegikmo: Firstly, thank you for your amazing asset! I've already progressed further with creating my shaders using your asset for an hour than I did working with shader code over a few weeks.

    With that said, I have one inquiry and believe I have discovered a glitch as well.

    Inquiry: How can I get the physical size of an object, rather than its scale? I wish to create a shader that outlines each normal with a fixed-width line, and am having difficulty keeping it the same width when the model itself is larger.

    Glitch: Adding a code node causes the entire Unity editor to lock up and ruins the shader that is currently being worked on. This is in Unity v5.2.0f2 on Windows 10 x64.

    Thank you so much in advance! Be well.
    - S.
     
  28. neroziros

    neroziros

    Joined:
    Aug 25, 2012
    Posts:
    129
    Good day everyone!

    I was wondering if it's possible to use world space UV mapping while ignoring the object orientation. Right now I'm trying to do it but with little success.

    Here you can see my current shader and its result:
    sf_puddlescreenspace_8222015.png
    Continuity break.jpg

    And here you can see the same shader with the normal space set to world. As you can see it works but the appareance is seriously affected:
    World space normals.jpg


    Any help is appreciated,
    Cheers.
     
  29. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    151
    Hey Ace, I've noticed an issue, not sure if it's a bug or a limitation, but Light Direction and Light Attenuation doesn't work with Point Lights in the PBR pipeline. They work fine if I write a custom lighting setup.
     
  30. Eric-Chadwick

    Eric-Chadwick

    Joined:
    Mar 26, 2012
    Posts:
    20
    I bought Shader Forge, it is fantastic!

    Is there a way to adjust the display order of properties in the material? It appears to be based on node creation time.

    I would like to group similar nodes together in the material interface, but they are scattered around in the UI.

    I tried editing the compiled .shader file, rearranging the nodes in the Properties {} section, and this works temporarily. However if the shader is recompiled, the display order is reset again.

    Perhaps I need to edit the node names in the /*SF_DATA; header? I hope not, that looks like a bunch of trouble.
     
  31. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    @Eric Chadwick - left side of SF, Properties panel. Drag to order them.
     
  32. KenneyNL

    KenneyNL

    Joined:
    Jun 16, 2015
    Posts:
    8
    Any idea how to fix the seams when using a displacement map? (DX11 displacement)

     
  33. Eric-Chadwick

    Eric-Chadwick

    Joined:
    Mar 26, 2012
    Posts:
    20
    Awesome! Thank you.
     
  34. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    @KenneyNL it looks like the same problem the toon shader has with the default cube. that is, the face normals are not connected/smooth. you'll need to import a cube with smooth shading on it to have your shader edges connected. If you do that though you might have to bake a normal map to make it look flat again.
     
    DMeville likes this.
  35. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    @KenneyNL @DaDarkDragon - Or just avoid any geometry info by using world/object coordinates for everything. If you don't require using normals/UVs/tangents/etc for displacement then it's not an issue. That really only applies to noise, but I figure it's worth mentioning just to cover everything. :)
     
  36. dblincoeii

    dblincoeii

    Joined:
    Mar 4, 2015
    Posts:
    19
    Awesome...thanks. Wish I could just upload this whole thread to my brain.
     
  37. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Does someone can point me out to some example that allow to blend two textures depending on angle normals ?
    0-35 degrees = texture 1
    35-90 degrees = texture 2
     
  38. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    You'll have to define "angle normals" in that case.
    I assume you mean the angle between the up vector of the world and the normal direction, in which case you might be making a terrain shader, where you want a cliff texture to blend wherever it's steep?

    If so, plug in the Y component of the normal direction into the T value of the lerp node, and the two textures into A and B. You can then modify the T value to change how the blend should look. If you want a harsh blend, you can use the step node and step the normal Y component with a value of 0.5, then plug it into T
     
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It is the same ; for for 3d models rocks that i could rotate how i like and they still keep moss texture on their top surface.

    Thank you; i will try that.
     
  40. IzzySoft

    IzzySoft

    Joined:
    Feb 11, 2013
    Posts:
    376


    Hi all.

    I was just testing out the ArcTan2 example with the radial Wiper... UV coords.
    and I came across this issue.

    How would make it look good even when some quads have their own UVs/Seams?

    Thanks. :)
     
  41. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    I would make another UV set that covers the whole mesh with proper UVs, and then ArcTan2 using those UVs instead
     
  42. IzzySoft

    IzzySoft

    Joined:
    Feb 11, 2013
    Posts:
    376
    Ty. :)

    Just curious... whats the best way to, if possible, to clip individual Quads in a mesh?
    ex:


    I've been guessing how to approach this, and thought maybe using UV2, 3... might be the ticket??
    ex: (just U a.t.m.)


    And the haphazard nodes:


    Question:
    - I'm trying to use one material instance for a few meshes, so I was thinking UV's might be able to clip the Quad sides?
    - Is there a better approach?

    Edit: Never Mind... got it. ;)



    Thanks,
    Izzy.
     
    Last edited: Aug 25, 2015
  43. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,421
    In Shader Forge, is it possible to create an interactive global outline?

    By this I mean an outline of an object based on perspective, that only shows up when the object is hovered over?

    The uploaded screenshot shows an example of this effect in The Talos Principle, but is used in many games to outline intractable objects.
     

    Attached Files:

  44. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    how do i get the refraction to only refract down? now it refracts everything in the scene even the player who is above the water
    heres an example
    refraction1.jpg
     
  45. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
    @LabyrithStudios a quick and easy way is to put a variable to outline width and set the var by script
     
  46. Sinaz20

    Sinaz20

    Joined:
    Nov 16, 2009
    Posts:
    53
    Here's a fun one. When I connect a switch node with a particular shader, I get a pink failure.

    If I connect one input of the switch directly to the shader output, it works. If I connect the other input of the switch directly to the shader output, it works. If I connect the switch to the output, it goes pink.

    Bug? Should I report it on your site?

    The switch is pretty simple-- one input is just a channel from a texture, the second input is a channel from a texture multiplied by a slider. But like I said, each works when plugged directly into the final output, but the switch breaks it.
     
  47. Acegikmo

    Acegikmo

    Joined:
    Jun 23, 2011
    Posts:
    1,294
    Sure, report it over on UserEcho
     
  48. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,083
    You'd just need to toggle the outline based on information from a script, but yeah this is possible to do.
     
  49. Sinaz20

    Sinaz20

    Joined:
    Nov 16, 2009
    Posts:
    53
    I solved it-- I was trying to pass a single float into specular... which worked up until I passed everything through a switch. Changing the input to a vector3 fixed it.
     
  50. Travis_Foo

    Travis_Foo

    Joined:
    Jun 26, 2015
    Posts:
    7
    So this is my first time on this thread, so I'm not sure if this has already been posted already, but... has anyone managed to recreate PBR using custom lighting? If so, some examples / resources would be appreciated :)