Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Feedback Wanted: Shader Graph

Discussion in 'Graphics Experimental Previews' started by Kink3d, Jan 10, 2018.

  1. Khaeops

    Khaeops

    Joined:
    Dec 28, 2014
    Posts:
    17
    I'm a bit hesitant to play around with those settings, because I do run a lot of applications that are reliant on those settings, but have different results on their respective scales (why, I have no idea). Since I switch between them and Unity often, it will be more than a pain to keep switching the DPI settings. Right now I have a balance that fits all of them.

    What would be nicer would be if we could have custom UI scales per application.
    (Or at least, for Unity! :D)
     
  2. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    1,900
    Aha. Well indeed you can! Just right click on the Unity icon go to compatibility. Look for the "Override high DPI scaling behaviour" checkbox. Check it and choose "Application" from the dropdown.
    This will open Unity in 96DPI mode. So everything will be sharper for Unity although it does mean the menus will be really small on a massive screen.
    I think that's the best fix until they fix the DPI awareness.

    I think even the Steam Client is finally becoming DPI aware in the next release. About time!
     
    Last edited: Feb 5, 2018
    Khaeops likes this.
  3. Khaeops

    Khaeops

    Joined:
    Dec 28, 2014
    Posts:
    17
    Interesting. Is there a way to then set the DPI to something other than 96 for an application?
     
  4. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    1,900
    I don't think so. If it's not DPI aware, the application will just assume the monitor is 96DPI. Windows can try to force it to show at the correct DPI but this involves stretching the graphics which is why it appears blurred.

    I expect the people at Unity won't notice this because I would guess they would use massive desktop screens with 96DPI. But if you happen to be working on a laptop with a high DPI screen then the menus can look very small or blurred.

    What they want to do is buy a laptop with HD display to test Unity on.
     
    Last edited: Feb 5, 2018
  5. Khaeops

    Khaeops

    Joined:
    Dec 28, 2014
    Posts:
    17
    That's a shame.

    My problem is that on my laptop monitor the interface is too large - menus take up in total more than half the screen. I barely have any space for my viewport, which also happens to be the same location I have for my game view and Shader Graph (toggle between).

    Maybe it's my fault for using a small monitor. 15 inch, but only 1368x768 is a bit outdated :eek:
     
  6. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    301
    Sounds like you need to implement some kind of UI scaling.
     
  7. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    837
    Ive had similar issues for ages on my surface pro, I hope shadergraph will make the DPI issue finally get looked at, modern applications should scale to be readable.
     
    yoonitee likes this.
  8. Hawk_33

    Hawk_33

    Joined:
    Jan 8, 2014
    Posts:
    1
    Hey I am just starting to explore the ShaderGraph, but I have worked with other node-based visual shader programming tools before and therefore I was just wondering if it will be possible to create a Double-Sided Shader with ShaderGraph in Unity, because I think that would be quite important and useful, especially when working with foliage.

    As far as I can tell you don't have the possibility to create a double-sided shader right now, or am I missing something?

    Other than that I would also say, like others, that an Append Node , Vertex Offset, Tessellation, and a Panner Noder would be great, if possible.

    Thanks :)
     
    Lars-Steenhoff and yoonitee like this.
  9. KrasnogorskotR

    KrasnogorskotR

    Joined:
    Aug 24, 2016
    Posts:
    1
    It's possible to create custom nodes?
     
  10. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    382
    First page, first post:

    What is a Shader Graph?

    A Shader Graph enables you to build your shaders visually. Instead of hand writing code you create and connect nodes in a graph network. You can do things like:
    • Procedurally alter your surface appearance
    • Warp and animate UVs
    • Modify the look of your objects using familiar image adjustment operations
    • Change your object’s surface based on useful information about it, its world location, normals, distance from camera, etc.
    • Expose to the material inspector what you think is important to edit for your shader
    • Share node networks between multiple graphs and users by creating subgraphs
    • Create your own custom shader graph nodes through C# and HLSL

    I'm not sure if there's any documentation right now since SG is still in the beta.
     
    Last edited: Feb 5, 2018
  11. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    4,521
    The triplanar node's type mode "Normal" could use some work. At the moment it's implementing what I refer to as the "naive method". It would be nice if you are going to provide an official node for dealing with triplanar normal mapping that it actually handled triplanar normal mapping properly and didn't just treat the texture like albedo.

    https://medium.com/@bgolus/normal-mapping-for-a-triplanar-shader-10bf39dca05a

    edit: Though I do applaud the use of BiTangent in the shader code. ;)
     
  12. Epicguru

    Epicguru

    Joined:
    Feb 6, 2018
    Posts:
    1
    Hey!
    I just started using the Shader Graph in my own project (I know it's not recommended but I had to try it :)) and I am trying to add a post processing screen effect.
    I am not using the post processing stack, rather the old-school C# OnRenderImage method. I was previously using a very simple hand written shader to apply an effect to the screen. I recreated the shader in the Shader Graph.
    I then assigned this new graph created shader to the material that I was using to apply the effect. All seemed to work.
    However, the effect does not work.
    Upon further inspection, I realised that setting material properties from code does not work when using a Graph Shader.
    For example, in my code:
    Code (CSharp):
    Has no effect when using the graph created shader. When I switch over to the original hand written shader, this has exactly the intended effect (sets the property called 'Colour' to green).
    I have confirmed the same behaviour using two shader graph shaders, and Texture, Color and Boolean parameter types.
    I am using Unity 2018.1.0b4 Personal.
    I assume that this is either a bug or unimplemented beahviour? Any suggestions on how to fix or confirmation of the bug would be appreciated.
    Feel free to bash me if I have made a stupid mistake.
    Thanks!
     
  13. Khaeops

    Khaeops

    Joined:
    Dec 28, 2014
    Posts:
    17
    I believe setting things in code would have no effect, as it gets overridden in the Shader Graph. An alternative would be to have an input colour property that you could pass to intercept where you want to apply the colour on the graph.
     
  14. Kink3d

    Kink3d

    Unity Technologies

    Joined:
    Nov 16, 2015
    Posts:
    26
    Thanks for pointing this out. Will fix this!
     
    bgolus and Alverik like this.
  15. izym

    izym

    Unity Technologies

    Joined:
    Jul 27, 2013
    Posts:
    20
    Not yet. We're working on it and will post here as soon as there is something to try out.

    This happens if you are not using a compatible render pipeline. Currently only Lightweight is supported, while HDRP support is being worked on. We're going to look into putting a warning somewhere if the Master Node does not support the current render pipeline, so that it's clear what's going on :)

    Shader Graph is not supported for procedurally generating textures at the moment, although we definitely do see the point of it. The noise nodes are procedural and so they output a value per pixel in the fragment shader stage. What do you mean by "send different forms of output"?

    Agree, we need this along with snapping to the grid.

    Shader Graph will be part of the templates in the hub. Also it will be possible to use the package manager UI to install Shader Graph. But for now we need to manually modify the manifest like you did.

    DPI scaling is something that has to be fixed for all of Unity, and unfortunately not something we can implement locally for Shader Graph. Lots of people at Unity use laptops with high DPI screens and we are very aware of the issue :)

    Which menus in particular? With the latest Shader Graph update (0.1.17) the layout should be a bit more manageable, but if you're still having issues with space we're very interested in hearing details.

    This is not possible right now, but we're working on it.

    Yes, although as other posters mention there is not any documentation on it yet. We're going to write a blog post on this soon.

    This is happening because the actual property names do not match the name you input in Shader Graph. We're planning to change this such that the name you input in the blackboard will be the name used in the shader. In the meantime, you can work around this by looking at the generated shader (right click Master Node -> Copy shader to clipboard) and taking the property name from there. While the name is randomly generated, it is generated when you add the property and as such it is stable. Again, we realize this is not ideal and will be changing it soon.
     
    Epicguru, Alverik, JakubSmaga and 3 others like this.
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,601
    +1 for doulbe sided support
     
  17. Khaeops

    Khaeops

    Joined:
    Dec 28, 2014
    Posts:
    17
    The shader would produce an output texture for the object, such as a normal, height or albedo map. Like a render texture, I would imagine we could directly obtain the generated texture. By 'different forms of output', the node setup could perhaps alter the input value given to the shader, and return modified values, or generate new ones for further use. These inputs could be Color, float, int, Vector3, etc.

    With the cluttered menus, I've always had issues with all of Unity's menus - Unity restricts me from making certain menus (such as project and hierarchy, docked on the bottom) too small. With my current setup heavily based on the 'Wide' layout, my scene/game view is too small sometimes to view. Lifting this restriction or allowing for UI scaling in Unity's Preferences would help with this issue.

    The result of the small scene/game view being too small is that the Shader Graph does not fit properly when docked to the same space - the shader details on the right extend off-screen.
     
  18. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    948
  19. DominoM

    DominoM

    Joined:
    Nov 24, 2016
    Posts:
    430
    Demkeys likes this.
  20. Magne91

    Magne91

    Joined:
    Nov 18, 2017
    Posts:
    1
    Is it possible to import shaders you've made with shader graph into Unity 2017?
     
  21. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    148
    Shadergraph only supports SRP graphics modes so no, although I do recall seeing a post somewhere where someone made their shaders in shadergraph and then hand edited them to work in the standard rendering mode.
     
  22. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    1,900
    This image is a good example of how the text is too small in the nodes to read. Could the text be bigger? There's too much unnecessary padding around the text taking up screen real estate.

    Much

    like

    this.
     
  23. Jokerminator

    Jokerminator

    Joined:
    Jun 30, 2006
    Posts:
    245
    ( Surprise, surprise.. I wonder why this feature isn't on the roadmap..... --guess that's why I "gave up on" developing editor extensions.. hahahaha. )

    Hey.. this is a great addition! I used Shader Forge in the past but I am very happy to see Shader Graph as a native part of Unity. :D

    Looking forward to the vertex animation feature.
    Can't wait to test the post-processing feature anytime soon(er or later)! :p

    Keep up the excellent work!

    Would be cool to get an own Unity Connect channel.
     
    Last edited: Feb 12, 2018
  24. watercat

    watercat

    Joined:
    Dec 14, 2016
    Posts:
    7
    for my Project is not working the Shader Graph i have the versios 2018.1.0b6 i don have the options to create Shader Graph and all materials that they created by Shader Graph is ping
     
    Last edited by a moderator: Feb 13, 2018
  25. SoloChristian

    SoloChristian

    Joined:
    Oct 9, 2012
    Posts:
    500
    One of the things I have noticed on this is how the Highlights are not Antialiased. It's fairly obvious in VR and takes away from the realism.
     
  26. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    4,521
    It would be nice if Unity added support for specular AA.
     
  27. hwaet

    hwaet

    Joined:
    Mar 21, 2015
    Posts:
    14
    Apologies if this was asked already, but are there plans to add a disable/passthrough toggle for these nodes? In other node-based apps there is often a disable or bypass option on each, which makes it easy to inspect the impact of a node (or a branch of nodes) at a quick glance. It's usually bound to a hotkey as well, for really fast iteration. It'd be more of a quality of life feature than a must-have, but a nice feature nonetheless!
     
  28. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    948
    The text is small because I zoomed out the graph. :)
     
  29. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,244
    How about a fancy water shader? I'm sure a lot of people will be wanting various water shaders. They have the same common problems like figuring out depth colour, fixing distortion problems with geo in front and behind - and so on, so I imagine it would be useful + stress the API.

    Made a few in amplify and in code over time and notice that it can generally help find weak spots for shader editors.
     
    Alverik likes this.
  30. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    948
    When a Vertex Offset is possible, I will attempt to make a water shader. :)
     
    hippocoder likes this.
  31. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    22,244
    Flat ones are fine for LW also ;)
     
    Alverik likes this.
  32. hwaet

    hwaet

    Joined:
    Mar 21, 2015
    Posts:
    14
    Another question for water shaders, can we sample color and depth behind the object as well? I saw the screen depth post earlier, but depth from behind the surface of the object is key for awesome looking water effects. I couldn't find a node to get this info, but I might be looking in the wrong places.

    The folks at monomi park posted a really helpful tutorial on tricks for doing this sort of effect, and it seems to entirely hinge on being able to sample this kind of data. Everything else is regular math and blending tricks.



    http://blog.monomipark.com/post/139862950537/hello-im-ian-and-ive-taken-the-task-of-leading
     
    Alverik, Narv and hippocoder like this.
  33. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    1,900
    Well, yes. But if you zoom in then you can only see a couple of nodes on the screen at the same time. Simple solution, make the text bigger, or decrease the padding. Then you get best of both worlds. Clear text and lots of nodes on the screen. Look at this paragraph. There's not a lot of spacing between the lines. Now compare that with the text on the nodes. You can fit a whole extra line of text between them. Waste of space if you ask me. I found an example on the internet where there is less padding so you can fit more nodes on, and the text is much clearer:

    You could even reduce the padding by a couple more pixels.
    A bad example is unreal nodes where there is so much padding that you can hardly get any nodes on the screen at one time:

    You could easily decrease the line spacing here and fit a few more nodes on screen.

    It's just my opinion but the top one is better. And if you can't decide which is better, just have an option to increase the font size or set the line spacing.

    Yes, the bottom one may look "cooler". But in the end do you want something that looks cool or is actually useful?
     
    Last edited: Feb 14, 2018
    Alverik, Prodigga and Roni92pl like this.
  34. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    156
    Why not both? ;)
     
    hippocoder likes this.
  35. mohada

    mohada

    Joined:
    Mar 21, 2016
    Posts:
    1
    hi
    I have a problem.
    when I create a new shader graph I got a error : "Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)".
    My GPU is NVIDIA GTX960.
    Shader Error.JPG
     
  36. SoloChristian

    SoloChristian

    Joined:
    Oct 9, 2012
    Posts:
    500
    Ok we have a new beta out. When are we getting the shader editor for the HD Pipe???
     
    antey3064 likes this.
  37. SoloChristian

    SoloChristian

    Joined:
    Oct 9, 2012
    Posts:
    500
    I think after 8 years of waiting it is about time this engine looks better then Unreal. Give me Decent Highlights. Give me Decent Shadows. Give me a Fully PBR PIPE that can use Substance Materials even on the Terrains. After almost a Decade of hearing , "But the Unreal Engine makes Prettier Pictures and is Faster" it's time. If I ever hear that sentence again I feel I am going to Projectile Vomit. ;)
    It's time for some Awesome Graphics out of Unity. And not jut in the HD Pipe. In all the Pipes.
     
  38. inLawsGaming

    inLawsGaming

    Joined:
    Feb 4, 2017
    Posts:
    3
    Hi, I'm trying to build shaders using the new Shader Graph beta. I can't seem to manage to get the result I want.
    I'm able to create 'transparent' shaders, and of course solid colored ones or with effects. What I actually want is to layer a transparent texture over a solid color. Being able to manage the colors of the transparent layer and solid layer separately.

    I've seen that I can blend a color with the transparent layer to get the wished effect for that layer. But then again.. missing the background.

    Hope someone can understand my reasoning. Thanks
     
  39. CriDos

    CriDos

    Joined:
    Apr 19, 2017
    Posts:
    12
    Hi, in the beta 7 Shader Graph is not supported texture arrays?
     
    Last edited: Feb 15, 2018
  40. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    65
    Make it easier to add nodes. Some docked window witch categories and search like in Substance Designer. And pop up windows with search when you hit space. It would make working with this graph much easier.
     
  41. KacperYZ

    KacperYZ

    Joined:
    Feb 15, 2018
    Posts:
    2
    Hey,
    I have a problems with your package, something gone wrong and i cant create a Shader Graph :/
    the second issue is that there are 2 critical errors. Pls help SHU_pXoRPz.png SHU_99Vw4e.png
     

    Attached Files:

  42. myxsys

    myxsys

    Joined:
    Apr 1, 2016
    Posts:
    2
    Is it possible to have a node for inverting colors or a color ramp node similar to blender?
     
  43. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    196
    The One Minus node will invert your colors

    upload_2018-2-15_19-56-57.png
     
  44. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    196

    If you are using the first available beta for the Shader Graph you can't do this but if you are up to date you can press space you get to pop up window to search. Hitting it twice will show all your nodes and Sub Graphs.
     
  45. Khaeops

    Khaeops

    Joined:
    Dec 28, 2014
    Posts:
    17
    I think 'Invert' would be a more intuitive and obvious title both for understanding and workflow ease.
     
  46. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    386
    There could be confusion between one-minus, invert and negate. Oneminus seems to be common enough elsewhere and nicely explains what's going on.
     
  47. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    4,521
    The definition of "invert" changes with the value ranges you're working with.

    When inverting a non-HDR color value what you want is 1 - color.

    If you're inverting a normal vector you want -normal.

    Inverting an HDR color is somewhat undefined, and either option above could be valid. But there are other ways to handle inverting an HDR color value.

    So I disagree with using invert being more clear as the node will have to pick one of at least two of not more possible definitions of invert.
     
    andrzej_cadp and hippocoder like this.
  48. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    527
    What are the available options for custom lighting support?

    I know this question has been answered (in part), but I'd like more clarity about support for the following potential scenarios:

    For example:

    Are various "toon" shaders possible? How about multiple UV/normals to help define lighting and outlines separately from one another? -- For example, consider the following crazy-but-not-so-crazy scenario:

    I want toon lighting for an anime character that reacts to a separate light in the scene than the normal global light (with a stylized outline based on normal directions that are defined separately to the model's typical normals) where I might also want to have their eyes appear over their (often long) hair hanging down their face. I would also want to chance the color ramp colors to entirely separate hues/sats/lums in the Editor so that they would match the character I'm shading. It also would be great if they were instanced too.​


    Is this example something that can be done fairly easily with the current pipeline -- or are there some crazy workarounds needed to support this?
     
    Last edited: Feb 16, 2018
  49. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    527
    To be clear -- everybody likes realism, but I also want to be able to do a LOT wilder things with shaders than just emulate natural lighting / PBR scenarios... I just want to be confident this is possible.

    I really want the above example to be relatively easy/straightforward to produce -- but more importantly, I also want it to be possible too -- without a lot of edge cases that will break it because Unity doesn't support features x/y/z internally (i.e. like toon-shading alongside PBR without modifying Unity's internal settings and breaking lighting completely for everything else!)

    Check out the Guilty Gear Xrd thread --

    Lots of people pushing the limits with Unity (using shaders that are NOT naturalistic/PBR-based) -- among these people, Disney themselves are included.

    I think it should be a priority to make stuff like what you see in that thread more easily-accessible to (non-technical) artists if you are indeed providing a new tool integrated into the engine. After all -- "Democratize Game Development," right? -- Seems like a good opportunity to me.
     
    DominoM and recursive like this.
  50. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    1,900
    Rounded corners:
    I notice that the corners of the nodes are rounded off at the bottom. When displaying a preview of the shader this might become annoying if you specifically wanted to see what the shader looked like on the bottom-left and bottom-right corners. I would suggest an improvement is to simply add a little bit of extra padding below the shader preview so that the corners of the preview are all visible. Or just not round off the corners at the bottom when showing a preview.
    For example you could put a small "close preview" button "^" below the shader which would solve the problem.