Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    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. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    Buuuut it will apply the changes to the shader right? I dont really care about getting it back into shadergraph but would be nice to text edit the shader after its generated
     
  2. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,483
    Well, you would need to save the pasted shader code as a .shader file; and then that can be used with a Material. :)
     
    MadeFromPolygons likes this.
  3. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    Awesome just what I thought, was making sure! Thanks :)
     
  4. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Where is the shader editor in Unity 2018?

    I just installed this and first went to look for the shader editor and can't find it anywhere? Is this a pro feature only? WTF?
     
  5. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    And of course no one will answer my question.
     
  6. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Please be more specific.
    What's your Unity version?
    Did you get SG from Git or Package Manager?
    How did you try to open an SG? Did you create a Graph?
     
  7. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I am using Unity 2018.1.0b9

    I got the package from here:

    https://oc.unity3d.com/index.php/s/mWv6mGlHtCHfz7S

    Went to create and looked for the shader graph and couldn't find it anywhere.
     
  8. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Could you try to make an empty project and import both LW pipeline + SG via Package Manager?
     
  9. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I have never used Package manager before. How do I import SG and the LW pipeline?
     
  10. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    At the top of your screen select Window -> Package Manager, then navigate to 'All', find those 2 assets and install them.
     
  11. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    What is ShaderGraph under in the package manager?
     
  12. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Also I am getting this error when I install Render pipeline HD and Lightweight from the Package Manager.

    C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.render-pipelines.high-definition@1.1.1-preview/HDRP/HDRenderPipeline.cs(560,32): error CS0117: `UnityEngine.Experimental.Rendering.RenderPipeline' does not contain a definition for `BeginCameraRendering'
     
  13. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,483
    In Unity; go to the Package Manager Window and install the Lightweight Render Pipeline. Shader Graph is included with it.

    You should maybe wait more than 5 minutes before assuming no one will answer your question; or read through the thread to find the same question asked and answered multiple times before. :D
     
    buttmatrix and Adam-Bailey like this.
  14. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    I can't believe I am the only guy who has an issue with installing the shader graph...blows my mind. :(
     
  15. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Yes but I am getting this error when I install Lightweight from the package manager.

    C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.render-pipelines.lightweight@1.1.1-preview/LWRP/LightweightPipeline.cs(299,32): error CS0117: `UnityEngine.Experimental.Rendering.RenderPipeline' does not contain a definition for `BeginCameraRendering'

    And the Shader Graph still does not show up?
     
  16. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,483
    You are on b9? Id recommend using Package number 1.0.1 instead. I have been using it with b9 on 3 different projects for a week and have had hardly any problems. :) I haven't had a chance to use 1.1.1 yet!
     
  17. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Ok so now how do I downgrade to Package number 1.0.1?

    Look I really appreciate the Unity team and all but I have literally just been introduced to the package manager a few moments ago and you can't assume I will know exactly whats going on.

    Can you explain in more detail please? Thanks.
     
  18. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Open Windows Explorer, go into your project folder, go into Packages folder and open the manifest file.
    Navigate to com.unity.package-manager-ui and change the version to 1.0.1
     
  19. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    SRP Lightweight and HD 1.1.0 and 1.1.1 will only work on b10.

    To downgrade you need to modify the manifest file
    This is in your project root folder
    upload_2018-3-7_11-29-46.png
    Open that folder and then open this file in a text editor

    upload_2018-3-7_11-30-11.png
    Then you can modify the version numbers and save

    Code (csharp):
    1.  
    2. {
    3.   "registry": "https://staging-packages.unity.com",
    4.   "dependencies": {
    5.     "com.unity.render-pipelines.lightweight": "1.0.0-beta",
    6.     "com.unity.postprocessing": "2.0.1-beta",
    7.     "com.unity.package-manager-ui": "1.8.1"
    8.   }
    9. }
    10.  
     
  20. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
  21. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    you are trying to use a version of the package that needs b10 of unity. It will be out very soon :)
     
  22. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    67
    Can you add translucency? And Parallax Mapping? And Refraction? And Volumetric fog?
     
    Last edited: Mar 7, 2018
  23. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sounds like HD pipeline is for you, not LW.
     
    MadeFromPolygons and buttmatrix like this.
  24. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    ok - 2018 is a fugly-fugly mess.
    2018 b9.
    I imported the asset project linked in the first post. It worked, with crashes.
    I noticed @Andy-Touch recommendation regarding package manager window, opened it and started by upgrading the project manager.
    It broke everything - i get errors, erase all, exit unity, copy assets, open unity, 67 or so errors.
    New project, copy assets, importing takes forever.

    Feedback and questions:

    0. Bad experience so far.
    1. Code that shader graph outputs has wrong indentation (lines 6, 9, 15, this is a tiny part of a 223 lines shader)
    Code (csharp):
    1.  
    2. GraphVertexOutput vert (GraphVertexInput v)
    3.             {
    4.               v = PopulateVertexData(v);
    5.              
    6.                 UNITY_SETUP_INSTANCE_ID(v);
    7.           GraphVertexOutput o = (GraphVertexOutput)0;
    8.           UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
    9.                       o.WorldSpaceNormal = mul(v.normal,(float3x3)unity_WorldToObject);
    10.                     o.WorldSpaceTangent = mul((float3x3)unity_ObjectToWorld,v.tangent);
    11.                     o.WorldSpaceBiTangent = normalize(cross(o.WorldSpaceNormal, o.WorldSpaceTangent.xyz) * v.tangent.w);
    12.                     o.WorldSpaceViewDirection = mul((float3x3)unity_ObjectToWorld,ObjSpaceViewDir(v.vertex));
    13.                     o.WorldSpacePosition = mul(unity_ObjectToWorld,v.vertex);
    14.                     o.uv1 = v.texcoord1;
    15.                 float3 lwWNormal = normalize(UnityObjectToWorldNormal(v.normal));
    16.                 float4 lwWorldPos = mul(unity_ObjectToWorld, v.vertex);
    17.                 float4 clipPos = mul(UNITY_MATRIX_VP, lwWorldPos);
    18.  
    2. There are new directives - is there some documentation and examples on them?
    3. 3 passes on the simplest lightweight lit shader is not lightweight in my book
    5. In this line :
    Code (csharp):
    1.  
    2. #pragma multi_compile _ _MAIN_LIGHT_COOKIE
    3.  
    the single _ before _MAIN_LIGHT_COOKIE is intended or not? What does it do ?
    6. Where is the LightweightLighting.cginc file ?
     
    Last edited: Mar 8, 2018
  25. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    67
    Are these things not going to be possible in the shader-graph? Subsurface scattering I would think would be standard now days. As well as the other items I mentioned.
     
  26. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  27. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    67
    is it a bug that unlit shader is pink? Or am I not setting it up right? I can use the pbr shader with no problems. In the same project, I tried unlit and all I get is pink. When I try to add the material to an object the object disappears.
     
  28. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    you waited only 5 minutes before complaining that no-one answered. leave more time for people to see and respond.
     
  29. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    if you write a master node that will support it then sure you can write it for LW. but your mentioning HD pipeline features, so really you need HD. if you think 2018 will magically make console quality graphics happen on mobile, it wont.
     
    hippocoder likes this.
  30. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    Will Amplify Shader Editor work in Unity 2018 with the new Shader graph that is being implemented? Just wondering before I purchase Amplify Shader editor, if it would be a good idea or not.
     
  31. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You should ask that on the Amplify Shader Editor thread because it is nothing to do with Unity.
     
    MadeFromPolygons likes this.
  32. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    50
    I guess my questions got somewhat lost, is there any information on any of these?

    For those who want to try b10 now, I found it here

    http://beta.unity3d.com/download/4ec9a3104331/public_download.html
     
  33. smallbit

    smallbit

    Joined:
    Oct 3, 2013
    Posts:
    60
    I played a bit with the graph editor today, and the examples with unity's nightmare scene. Unity example also provides some example graphs so I played a bit with them. I also checked the code the graphs generate and was stunned seeing that the "party" shader example outputs over 620,000!!! lines of code shader:(
     
  34. Giles-Coope

    Giles-Coope

    Joined:
    Jan 5, 2015
    Posts:
    50
    After using this a bit more, I have a couple more comments

    - subgraphs should be allowed to have other outputs than Vector4s, at the moment if I want to output a float i have to use a split node immediately after
    - certain associative operations, such as multiply and add should be able to accept more than two inputs
    - custom names and folders for shaders, rather than just "graphs/_"
     
    Last edited: Mar 8, 2018
  35. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    consider that perhaps investing in the unity made solution rather than a 3rd party one could increase the quality of support for it due to better demand for the system.

    I dont see the point in starting with a 3rd party tool when you know an official one is on the way, but thats just me.

    id rather have a system that the entire unity community can extend rather than just a subset of the community.

    sure your not talking about the asm code?

    you want the hlsl.

    i doubt it is 650,000 lines for a single shader if you are looking at the actual hlsl
     
  36. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
  37. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,483
    Amplify Shader Editor is not developed by Unity; you would have to talk to that system's developers directly to see if they are going to support Shader Graph.
     
  38. hwaet

    hwaet

    Joined:
    Mar 21, 2015
    Posts:
    26
  39. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    67
    Last edited: Mar 8, 2018
  40. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    67
    So, LW is for mobile?
    Is there a way to do HD with shadergraph?
     
  41. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,483
  42. Elandir

    Elandir

    Joined:
    Feb 9, 2014
    Posts:
    32
    Do shaders created with shader graph currently works with VR devices? I'm thinking in particular for the Oculus Rift. If not, will they work in the future?
     
  43. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Will be pruning posts that ignore the beta forum rules, sorry. In brief those are:
    • be on topic
    • talk about experimental features or the beta features only
    It's not general discussion and needs low noise so devs can quickly canvas what people are saying then get back to work making YOUR game engine! :)
     
  44. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,483
    chiapet1021, hwaet and hippocoder like this.
  45. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    67
    Thanks, great work!

    ----------------------------------------------------------------------------------------------------------------------
    I found a bug with shader-graph. You can't copy shader-graph components to another shader-graph.
    The components show up but you get and error and a pink shader.
    Error = undeclared identifier '_Property_78CDD224_Out
     
    Last edited: Mar 10, 2018
  46. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    67
    When I use the normal vector node my light and everything works fine, but when I switch to a normal map the lighting moves weird when the sphere is rotated. I use tangent to world transform, which should be right.(Although I have tried every other combination as well) The shadergraph and attenuation node can be downloaded here to see if it is me or something else: https://sites.google.com/site/opensourcegamedevelopment/tutorials/shader_graph



    Also, we need a built in light position node. Right now I am having to externally modify a vec3 property which is quite cumbersome.
     
    Last edited: Mar 10, 2018
  47. FreeGameDev

    FreeGameDev

    Joined:
    Dec 1, 2015
    Posts:
    67
    Found a couple more bugs.
    1. setting the slot to hidden does nothing. [Slot(1, Binding.WorldSpaceTangent , true)] Vector3 vTangent,
    2. With this code
    Code (CSharp):
    1.         [Slot(0, Binding.None)] Vector3 inNormal,
    2.         [Slot(1, Binding.WorldSpaceTangent , true)] Vector3 vTangent,
    3.         [Slot(2, Binding.WorldSpaceBitangent, true)] Vector3 vBitangent,
    4.         [Slot(3, Binding.WorldSpaceNormal, true)] Vector3 vNormal,
    5.         [Slot(4, Binding.None)] out DynamicDimensionVector outNormal)
    Slot 3 shows up in the editor as object space.
    3. Also, along with my post above, there seams to be something funny going on with plugging the normal map texture. Nothing I tried is making the normal map react proper.
     
  48. AHA1ZINT

    AHA1ZINT

    Joined:
    Jan 3, 2016
    Posts:
    12
    help guys plez
     

    Attached Files:

    KarlKarl2000 likes this.
  49. AHA1ZINT

    AHA1ZINT

    Joined:
    Jan 3, 2016
    Posts:
    12
    any shader i creat looks pink
     
    KarlKarl2000 likes this.
  50. Elandir

    Elandir

    Joined:
    Feb 9, 2014
    Posts:
    32
    Check that you are working with Lightweight render pipeline in edit->project settings->graphics. If you don't have Lightweight you can download it from window->package manager.
     
Thread Status:
Not open for further replies.