Search Unity

  1. Curious about what's going to be in 2020.1? Have a look at the 2020.1 beta blog post.
    Dismiss Notice
  2. Want to see 2020.1b in action? Sign up for our Beta 2020.1 Overview Webinar on April 20th for a live presentation from our evangelists and a Q&A session with guests from R&D.
    Dismiss Notice
  3. Interested in giving us feedback? Join our online research interviews on a broad range of topics and share your insights with us.
    Dismiss Notice

Feedback Wanted: Shader Graph

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

Thread Status:
Not open for further replies.
  1. rubentorresexozet

    rubentorresexozet

    Joined:
    Dec 8, 2016
    Posts:
    2
    How can we use ShaderGraph with a custom SRP?
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,455
    You will write the connections for it.
     
  3. mahalis

    mahalis

    Joined:
    Mar 13, 2018
    Posts:
    1
    Small bug (apologies if it’s been brought up before, this thread is huge): in the Shader Graph editor, when editing a vector parameter, you can Tab forward through the fields, but you can’t Shift-Tab backward through them.
     
  4. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
  5. hwaet

    hwaet

    Joined:
    Mar 21, 2015
    Posts:
    23
    @Andy-Touch that is amazing! These will be super helpful for all kinds of effects, thank you!!!
     
  6. TehReason

    TehReason

    Joined:
    May 14, 2013
    Posts:
    53
    is there a way to use the shadergraph tool to make custom ui shaders ? :)
     
  7. paulindrome

    paulindrome

    Joined:
    Mar 10, 2018
    Posts:
    14
    Is it possible to reference the unity built-in shader utilities via shadergraph? (include cginc namespaces)

    My specific use-case is based on Joyce "MinionsArt"'s lightmap-based render texture painting shaders (https://pastebin.com/LxDYqWBh & https://pastebin.com/rMx1PVXi).
    These shaders include

    #include "UnityCG.cginc"
    #include "AutoLight.cginc"
    in order to use the line (49)

    o.uv1 = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;// lightmap uvs


    My current thought would be creating CustomNodes that basically "trick" the ShaderGraph shader into using the aforementioned includes. However, that seems a rather convoluted solution for trying to use built-in unity utilities. °O
     
    hwaet likes this.
  8. Dolzen

    Dolzen

    Joined:
    Mar 26, 2014
    Posts:
    90
    Why the shader graph is not working with the HD Rendering Pipeline yet?
     
  9. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Probably because the HD RP is still in a preview state and very complex.
     
  10. paulindrome

    paulindrome

    Joined:
    Mar 10, 2018
    Posts:
    14
    Did anyone have any luck changing graph shader variables via script so far?

    The usual
    Material.SetFloat(...)
    approach doesn't seem to be working for me. Additionally, checking for any property name with
    Material.HasProperty(...)
    returns true regardless of what is looked for and whether or not the shader actually HAS that property.
     
  11. AurimasBlazulionis

    AurimasBlazulionis

    Joined:
    Aug 13, 2013
    Posts:
    209
    I am not sure if it is still the case, but the first problem I noticed with the shader graph was that property names for textures etc. are not that easily determined. They show up in the inspector the way you name them, but in reality they have their own obscure names underneath, making modifications from scripts a bit harder, as well as the fact that textures are not preserved when you switch from the standard shader, for example, to your fresh shader graph.
     
  12. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,817
    I think because of the new HD RP has been used HLSL language for shader programming but all other visual shader editors has been used CG Program or surface shader
     
  13. paulindrome

    paulindrome

    Joined:
    Mar 10, 2018
    Posts:
    14
    Yepp. Just tried it using the "obscure" designation. ('Vector1_A8323E03' instead of 'loadAmount')
    This way it works, but of course, this extra abstraction step is a nuisance at best and a hindrance at worst. (Though I'm almost certain this will be changed once ShaderGraph is out of beta)
     
    Karearea likes this.
  14. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    327
    Really enjoying messing around with the shader graph, well done on a slick addition to the toolset.

    Are there any plans to extend the editor to allow for authoring v.2 Post Processing stack custom effects?
     
    hwaet likes this.
  15. paulindrome

    paulindrome

    Joined:
    Mar 10, 2018
    Posts:
    14
    Is there a way to combine the 'Flipbook' and 'Tiling and Offset' nodes to create a spritesheet animation moving along the UVs?

    edit:
    Nevermind. Found it. I had to find the correct sequence of UV nodes to basically get the flipbooked texture scrolling along.


    edit2:
    While I'm at it I might as well ask if there are any plans to provide more nodes with more output options.
    F.e. the Vector nodes would profit from both combined and "pre-split" outputs. Using the "Split" node to separate a vector's dimensions seems counter-intuitive. Especially since there is a "mental cast" from X and Y to R and G.
     
    Last edited: Mar 21, 2018
    P_Jong likes this.
  16. JamesTL

    JamesTL

    Joined:
    Feb 21, 2017
    Posts:
    3
    Any clues as to why my final master node is not rendering? (using unity 2018.1.0b11, HDR pipeline 1.1.1 and shader graph 1.1.1).
    upload_2018-3-22_14-30-34.png
     
    xNex likes this.
  17. STUDIOCRAFTapps

    STUDIOCRAFTapps

    Joined:
    Feb 4, 2015
    Posts:
    103
    I get the same problem.
     
  18. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,395
    i don't think shader graph are compatible with HDRP yet
     
  19. Dolzen

    Dolzen

    Joined:
    Mar 26, 2014
    Posts:
    90
    I'm having an issue. Shadows are not being casted over objects that are using shaders created by the Shader Graph, anyone else experiencing this issue?
     
  20. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Could you implement volumetric simulations, for example if shader graph would be plugged in volume rendering in some contained box, it would render smoke, fluids, etc
     
  21. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    327
    I noticed this if you have a texture property in the shader, that isn’t filled in the material itself.
     
  22. Dolzen

    Dolzen

    Joined:
    Mar 26, 2014
    Posts:
    90
    I created a new shader graph, created a new texture property, linked it to the texture sampler node, then linked the sampler note RGB to the albedo of the master node, I saved it and then assigned the sahder to a new material, changed the texture of the material but the shadows are still not being casted in the game object using this material.

    Im using Lightweight pipeline with Unity 2018.0b12 with SRP 208f8b5 (las commit)
     
  23. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    125
    How can I get world space light direction in the shader graph for lightweigth render pipeline? I want to do a dot product of light direction and vertex normal. Amplify has specific "Vertex Normal" and "World Space Light Dir" nodes, but I can't find the node in the shader graph?
     
  24. IllTemperedTunas

    IllTemperedTunas

    Joined:
    Aug 31, 2012
    Posts:
    124
    Is there a list of all usable nodes for this tool? I'm curious when i should consider migrating to official tools as I am using Shader Forge currently and am pushing it pretty hard to have custom blinn phone lighting for improved performance without lights.

    Will it be easy to have built in single point lighting without shadows for a 2d game with these new tools? (view reflection node, view direction node, dot product, etc.)

    Edit: Just noticed Pavelkouril has the exact same question I do! Good to see i'm not alone here. I'm sure you guys understand how having nice out of the box tools for performant out of the box directional lighting would be huge considering the massive mobile use of the Unity engine.
     
  25. hwaet

    hwaet

    Joined:
    Mar 21, 2015
    Posts:
    23
  26. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Currently, there isn't a built-in node for World Space Light Direction. You could set up a Vector 3 Property and set a specific light's direction via script to it.

    There is a 'Normal Vector' node that can be used in the dot product. :)
     
  27. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Shader Graph doesn't support HDRP yet. In development! :)
     
  28. Nebuch

    Nebuch

    Joined:
    Aug 30, 2013
    Posts:
    7
    Hi,

    Imported ShaderGraph to new 2018.1.0b12 from Package manager and when i try to make a shader its pink. Is it just me or everyone? 2018-03-27_16-26-00.png
     
    indieDoroid, xNex and Ryan-Gatts like this.
  29. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    647
    You probably don't have the Lightweight Render Pipeline installed. You can do that from the package manager as well and then setup the pipeline asset, as well as creating a new project and select the Lightweight Pipeline as a template. That will come with everything setup for you, including shader graph and Post Processing V2.
    upload_2018-3-27_11-32-54.png
     
    xNex and Ryan-Gatts like this.
  30. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
  31. Nebuch

    Nebuch

    Joined:
    Aug 30, 2013
    Posts:
    7
    Really thanks GrimReaper.
     
    Ryan-Gatts likes this.
  32. Le_Tai

    Le_Tai

    Joined:
    Jun 20, 2014
    Posts:
    353
    Seriously, the workflow for writing Custom Node for Shader Graph is a pain in the ass
     
    Elecman and interpol_kun like this.
  33. interpol_kun

    interpol_kun

    Joined:
    Jul 28, 2016
    Posts:
    131
    Agreed. Clunky and counterproductive.

    Do you really think that people will be writing complex nodes in a C# string? It will be like "I need to write HLSL code in a separate file with autocompletion and highlighting, then copy-paste it into my C#-string".

    Whoah, can't believe you come up with something like that. It's like rotten cherry on top of a good cake.
     
  34. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,420
    To quote part of a reply from Matt Dean in the comments to that blog post:

     
  35. GameDevCouple

    GameDevCouple

    Joined:
    Oct 5, 2013
    Posts:
    2,423
    This, seeing a lot of narrow mindedness in the comments to that blog post. People seem to read it as "you can only do this via strings now". Its not. Chill everyone.
     
  36. interpol_kun

    interpol_kun

    Joined:
    Jul 28, 2016
    Posts:
    131
    Put your arrogance where you got it. The File.Read isn't better in any way. Now they have 2 options: one, when you don't need to create new HLSL file, but which is bad by design, and second, which requires you to have 2 separate files for a one custom node.

    All 2 ways are bad and counterproductive. Instead of robust and flexible system we have some sort of hack. People in comments mentioned Xenko's approach to the problem.

    Anyway, even if we have an alternative, the first system was made without anything good in mind.
     
    Elecman and Le_Tai like this.
  37. GameDevCouple

    GameDevCouple

    Joined:
    Oct 5, 2013
    Posts:
    2,423
    Excuse me but did you actually read what I said? Did I say anywhere that "File.Read is better"? Did i even mention File.Read?

    Please take your irritation elsewhere, and refrain from calling members "arrogant" when they are simply mentioning that once again members are moaning before even getting proper hands on with the finished system.

    In fact, please dont lash out at other members of the community especially when something wasnt even directed at you. Its not fair, not cool, and definately not professional.
     
  38. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,041
    Let’s keep things civil. This thread is providing feedback on the feature, not arguing.
     
    GameDevCouple likes this.
  39. bakelite

    bakelite

    Joined:
    Jan 13, 2016
    Posts:
    5
    How do I navigate the graph on my MacBook? There's obviously no middle button.
     
  40. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,420
    I'm using a normal mouse on a mac so I cant completely replicate your circumstances, but holding the option key whilst left-click dragging works for me.
     
    bakelite likes this.
  41. graylen

    graylen

    Joined:
    Mar 28, 2018
    Posts:
    6
    Is it possible to add custom GUI element to the shader graph? I am mostly interested in adding the "Apply to systems" button that's on the new standard surface particle shader.
     
  42. Le_Tai

    Le_Tai

    Joined:
    Jun 20, 2014
    Posts:
    353
    The current workflow for making custom node required a lot of boilerplate code.

    A better approach IMO is writing the shader code in an HLSL file, with metadata in the comments at the top of that file.

    It is hacky and prone to error until IDEs catchup, but is easy to implement for Unity, easy for users to manage and share(only 1 file instead of 2), and allow developers to make full use of their IDE features.
     
  43. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Hold alt and click somewhere in the main node-board to pan around.
     
  44. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    647
    Few Bugs to report

    Sub Graph Bug?

    Not sure if this is intentional or a bug but upgrading from lightweight 1.1.1 to 1.1.2 Sub Graphs created in older versions won't open but ones created in 1.1.2 will. Is that intentional because of API changes or just a bug?

    UV Scale
    It seems that if you use another channel other than UV0 the UVs are scaled down (or textures scaled up? something is scaling.)

    Triplanar and the standard UV channel uses the same tiling value
    Here you can see when I switched to Triplanar the UVs are fine (Bottom Image)
    upload_2018-3-29_11-36-2.png
     
  45. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,455
    Users use this thread to talk to Unity staff about shader graph. Don't use it to talk to each other unless it's specific to shader graph. Don't reply to this message.
     
    Reanimate_L, elbows and chiapet1021 like this.
  46. Felor3D

    Felor3D

    Joined:
    Mar 30, 2018
    Posts:
    1
    I there any plans to make nodes with access to scene lighting data, like Luminance?
     
  47. m3rt32

    m3rt32

    Joined:
    Mar 5, 2013
    Posts:
    67
    Is there a way to define array variables in shader graph ? Like this:
    Code (CSharp):
    1.     half _Intensity[15];
     
    sewy likes this.
  48. SmartPolygon

    SmartPolygon

    Joined:
    Jan 26, 2017
    Posts:
    9
    Any way to change the UV channel from a blackboard?
     
  49. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Just change the UV in the Sample Texture Node. :)
     
  50. AurelWu

    AurelWu

    Joined:
    Oct 11, 2013
    Posts:
    26
    just tried shader graph for the first time and wrote a hexagonal grid node (based on world position). Really intuitive to work with.


    However there some things I'd like to be able to do which would make previewing easier:

    Change camera position and distance/size of the preview meshes in the preview windows, this is useful when working with shaders using world position. It's just a really minor thing and not sure if worth the added complexity.

    I also noticed that a property I defined as vector 2 had xyzw components exposed in the inspector, not sure if my mistake or bug
     
Thread Status:
Not open for further replies.
unityunity