Search Unity

Feedback Wanted: Shader Graph

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

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

    Omaek

    Joined:
    Jan 26, 2014
    Posts:
    7
    I'm using Unity 2018.1.0f2 and this is what I get.
    No blackboard at all and pink shader result.
    S.png
     
    RumataM likes this.
  2. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Ive messaged the Shader Graph Team about the 'No Blackboard' bug.

    For those people with the magenta shader result; do you have the Lightweight Render Pipeline set up in Graphics Settings?

    Also, if you have any errors in the console; it would be good to post them too. :)
     
  3. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    ALSO, this could only be for our lightweight render pipeline, but if I turn this on, our built in shaders, like Deffered for an example, would be taken out. If I were to, say, switch our default for my custom deferred, how would I do that with this new system?
     
  4. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    upload_2018-5-5_15-8-1.png
    For starters...
    upload_2018-5-5_15-9-40.png
    My flare shader
    upload_2018-5-5_15-10-58.png
    And a second opinion
    upload_2018-5-5_15-11-37.png
    At work.
     
  5. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    88
    I really like Shader Graph, and what I really want to see is full compatibility with the current material system, as well as the new RPs. It is deplorable that we would have to create different materials or each version, (mobile, VR, HD) the system should automatically adapt our material to the corresponding RP. That increases pipeline complexity, amount of assets to produce, thus production cost, etc., etc. I would love to use SG for our current project which is high end VR and HD (prerendered 360 content) and I can't.
     
  6. RumataM

    RumataM

    Joined:
    Nov 6, 2016
    Posts:
    15
    I have exactly the same problem (no blackboard and pink shader),the console is clear!
    How can I select Lightweight Render Pipeline in Graphics Settings? Can you explain please or add a screenshot?
    Thank you!
     
  7. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Have you imported the Lightweight Render Pipeline via Package Manager?
    Once done so, create a Lightweight Render Asset in your Project Folder and assign that in the Graphics Settings. Simple!

    Maybe I should write a tutorial on how to do this...
     
  8. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Shader Graph is compatible with the new RPs; currently supports LWRP and will soon support HDRP.
    It won't support the Built In RP; as that will eventually become 'Legacy' and is a different library architecture to SRP.

    What is 'wrong' with creating different materials for each platform set?
     
  9. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Yes, your shaders will need to be tweaked for each RP. :)
     
  10. rootsworks

    rootsworks

    Joined:
    Jan 31, 2016
    Posts:
    9
    I did not! This solved it for me, thanks.

    And for anyone else coming to this thread wanting to know how to do this, from the github:

     
  11. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Here is a very quick and easy step-by-step guide to setting up a Render Pipeline:

    1) In Package Manager (Window -> Package Manager), install one of the Render Pipelines; either 'Render-pipelines.high-definition' or 'Render-pipelines.lightweight'.

    2) Once installed in the project (And hopefully there are no errors otherwise this next step won't work); create a Render Pipeline Asset in the Project Window (Should be under the newly added 'Rendering' menu in the 'Create' menu). It will either be 'Lightweight' or 'HD' depending on which Render Pipeline you installed.

    3) Open the Graphics Settings and assign the recently created Render Pipeline Asset in the SRP Settings.

    4) Your project is now set up to use that specific Render Pipeline!

    5) Most of your Shaders are likely to be now rendered in magenta. That is because Shaders now need to be tuned for each Render Pipeline. If you are using built-in shaders; there is a tool under 'Edit -> Render Pipeline -> Upgrade Materials' that will configure your existing material's shaders to equivalent shaders for your installed Render Pipeline; when installing the Render Pipeline Package, a selection of already-tuned shaders were also installed into your project. Custom Shaders won't 'upgrade' using this tool and you will have to hand-tune them yourself.

    6) If you are using one of the recently added Templates in the 'New Project' options; then a Render Pipeline will already be set up.
     
  12. mvinc006

    mvinc006

    Joined:
    Jan 1, 2018
    Posts:
    89
    Thank you this works perfectly. I think the issue some of us may be having is that we are also importing the following unnecessarily:
    • Shadergraph v1.1.4 [Preview]
    • Render-pipelines.core Version 1.1.5 [Preview]
    Not installing the above two things helped me to get it working in both new and existing projects, with the working blackboard.
     
  13. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    You only need to install the Lightweight Render Pipeline packages and SRP Core, Shader Graph and Post Processing will be pulled in automatically... Ill contact the Package Manager team to see if this can be fixed.
     
  14. AutumnPioneer

    AutumnPioneer

    Joined:
    Dec 31, 2015
    Posts:
    1
    I also have the project setup correctly but i'm not seeing the blackboard, on the previous version i was using, the blackboard would work, but i couldn't drag the nodes from it. Also it would be good if the install instructions were on the first post, as it's a bit of a pain to find them in page 14 :D
     
  15. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    88
    Since Shader Graph "will soon support HDRP", it means that it currently doesn't, in which case, the correct answer is that it currently is not compatible with both RPs but only with One of them. (As we all know already.)

    "Soon" is a dangerous word. it could mean in 2 weeks (which is actually the maximum of what soon is supposed to be in real world professional terms and real project speed,) 2 months, 6 months, or more.

    If I tell to my cusomers "soon", and I mean in 2 or 3 months, chances are they are not going to appreciate my honesty and ability to report time estimates accurately.

    Having to create different material for each platform is bad. The whole idea that Unity pioneered, is multiplatform, from a single source. Having to make multiple versions of the same material, is a disadvantage wich goes against Unity's philosophy as an engine since it actually splits the source.


    What is wrong with having to create and maintain different versions of each material for every platform? At least 4 things.
    • Cost
    • Time
    • Complexity
    • Room for Human Error.
     
  16. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    THESE are what we have for flares and attenuation
    what we have 2.png THIS is 64, 159, 255
    what we have.png And THIS is 255, 159, 64
    What I'm looking for's...
    What I want 2.png
    AND
    What I want.png
    Now if I were to change the shaders for, say, deffered and flare, with my custom shaders, how would I do that?
     
  17. TorusGames

    TorusGames

    Joined:
    Nov 9, 2015
    Posts:
    1
    I found a bug that was causing me issues to track down. Normal maps used in a shader made in the shader graph seem to display incorrectly when scaled up. To test I made a very simple shader with a normal map plugged directly into the normal map slot. The same material is applied to 2 planes. One scale set to 1 and the other the scale set to 30. The one scaled up is displaying incorrectly. NormalBug_02.PNG NormalBug_01.PNG
     
    eric_delappe likes this.
  18. resetme

    resetme

    Joined:
    Jun 27, 2012
    Posts:
    179
    For people who write own shaders, we still have to make adjustments for each render pipeline?
     
    Last edited: May 8, 2018
  19. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Here is a branch of Shader Graph with HD Support: https://github.com/Unity-Technologies/ShaderGraph/tree/HDMasterMerge
    When this is ready; it will be merged and released as a Package via the Package Manager.

    If we had a definite release date for a feature; we would announce that date in advance. But as software development goes; unpredictable things sometimes happen (Usually last-minute shipstopping bugs) and things need to be delayed slightly. 'Soon' is a safe way of not disappointing people by accident if they have to wait an extra few days or weeks; we are definitely not the only company that does this. :D

    When a feature (In this case HDRP Support in Shader Graph) is ready; it will be made available in the main package. :)
     
    Last edited: May 7, 2018
    dilippatil and soleron like this.
  20. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Good point! Ill message the Original Poster to see if I can edit the 'setting up LWRP' steps to the first post.
     
  21. rootsworks

    rootsworks

    Joined:
    Jan 31, 2016
    Posts:
    9
    New question: right now I've got the option to create PBR or Unlit graphs, are the simple graphs currently unavailable?
     
  22. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    What do you mean by 'simple graphs'?
     
  23. taecg

    taecg

    Joined:
    Jun 14, 2014
    Posts:
    26
    I think his mean is LightModel,lambert or bllin phong.
     
  24. SmartPolygon

    SmartPolygon

    Joined:
    Jan 26, 2017
    Posts:
    9
    When will we get screen space reflections and graphEditor in HDSRP....? Right now I can't really enjoy anything, yet...... 2018.1 is a bit disappointing release...
     
    Last edited: May 7, 2018
  25. Epicurious

    Epicurious

    Joined:
    Jun 5, 2013
    Posts:
    3
    There may be a misconception. Andy was talking about "platform sets", not platforms. You will have to create different materials for each render pipeline, not each platform.
    If, as you said, you want to make a VR game that targets powerful platforms like PC and modern consoles you will probably want to use the HD rendering pipeline (as soon as it's ready) for all of the platforms and therefore only require one set of materials. Optimizing performance for each platform will still be done via the quality settings.

    If you have a game that targets the PC and mobile with the same codebase (rare use case I presume) you'd probably go for the LWRP for both platforms. If you really want those HD features for your PC release but not mobile you'll probably need to provide different assets anyway.
     
  26. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    229
    The notable exception there is Switch support.

    edit: I believe it was said HDRP didn't support Switch, don't have a license/kit to test myself.
     
    Last edited: May 9, 2018
  27. rootsworks

    rootsworks

    Joined:
    Jan 31, 2016
    Posts:
    9
    Ah, I interpreted the blog post about the lightweight render pipeline to mean that the LWP shaders were models for the shader graphs:



    I'm trying to come up with a shader that complements a project I'm working on that involves models with handpainted watercolor textures, and the PBR graph seems like overkill but the Unlit graph seems too limited for the look I'm after.

     
  28. Ramphic

    Ramphic

    Joined:
    Jun 21, 2017
    Posts:
    57
    Ya it works, thankyou very much!
     
  29. beinteractive

    beinteractive

    Joined:
    Apr 10, 2014
    Posts:
    21
    Is there any plan to support Light and Shadowmap nodes like the following?



    Background:
    I'm using shaders for NPR (stylized) shading. In this situation, Lighting and Shadow calculation requires many custom tweaks. Both PBR and Unlit is not fit for this use case because lighting of PBR is not customizable and Unlit has no lighting.
     
    MythrilMan51 and Jesus like this.
  30. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    What beinteractrive posted is pretty much the endgame, especially for forward-based shaders.

    Right now I'm doing a similar thing by using shader.setglobalcolor, vector, float, etc, and feeding it my own ambient terms, occluding the current ambient, and emitting mine. I've got pretty much all non-shadowed lights working via global values, but that main important shadowed light is the key.
     
  31. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,743
    Cant echo this enough.

    I bought amplify over the madness sale specifically to get around this for now.
     
  32. UltraShibe

    UltraShibe

    Joined:
    Apr 11, 2018
    Posts:
    2
    Hi, whenever I add the lightweight pipeline asset Unity starts spamming this one error upload_2018-5-10_20-54-5.png

    Please help! I've tried reinstalling Unity a hundred times over already, as well as reinstalling the packages, creating new projects. (yeah I've restarted my pc aswell)
     

    Attached Files:

  33. MythrilMan51

    MythrilMan51

    Joined:
    Apr 24, 2017
    Posts:
    122
    ALSO! Bloom while we're at it.
     
  34. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    88
    AFAIK yes.. Sounds like practicing, and waiting for at least 2018.3 before actually using any SRP features is the better approach. The classic RP has also been improved, and it looks better than HDRP in some cases.
     
  35. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    103
    @Andy-Touch sorry if this was brought up already, but are there plans to have some form of budget monitoring for ShaderGraph?

    For instance some of our Artists that are using it currently have been asking for a way to monitor performance. Now granted, scalar operations can differ based on GPU (e.g. vectorization support) but some way of saying ''you get this many nodes, this many texture samples" seems to be what they're looking for.
     
  36. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Technologies

    Joined:
    May 5, 2014
    Posts:
    1,009
    Ive not seen this tool/feature on the roadmap.
     
  37. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    103
    That's a little disappointing. I could see it being a worthwhile feature to at least determine/declare an instruction count per Node, and be able to see the generated instruction count of your output Shader as you are authoring it.

    Our Artists do well with the "you only get this many" approach, and since we'll be offloading a fair amount of the Shader authoring to Artists, it will help us police performance a bit too.
     
  38. tDevogel

    tDevogel

    Joined:
    Oct 10, 2017
    Posts:
    2
    This would be a very useful feature for me. I love the shader graph as an code-inept artist; gives me incredible power. But, without any way to gauge the expense of a shader aside from compile time, I'll still be stuck offloading it to an engineer for optimization.

    (btw, LOVE the new graph guys!)
     
  39. irenya

    irenya

    Joined:
    Nov 22, 2017
    Posts:
    6
    @Andy-Touch
    ^^^
    This, please!!
    Also, I had the "No Blackboard" bug after installing the LSRP in an already existing project. I fumbled for a bit with the magenta issue, until I figured out how to correctly set up the materials, and I had no other problems other than a lack of blackboard. But the little I tried it, it seemed to work correctly.

    From a comment to your video on YouTube (btw, thank you for such awesome lecture!! :) ), I found out that some people had the no blackboard issue after resizing the shader editor. Mine had been very small the first time, so I had no choice but to resize it, so I figured that maybe if I started a new project, the editor would remember the size of the window and I might have the blackboard.

    But in this new project (which only has 1 cube and 1 material), I'm getting errors and can't correctly install the package. The first error that appears on the console is:

    I have no idea what that means in this context, so I'm just posting the whole output from the editor.log here, from a few lines before that error till the end. There are a bunch of errors about shaders not being found, or files not being able to be opened. If I look at the Package Manager, the LSRP appears as if it was installed, even though it isn't and all of the menu items aren't anywhere to be found. Before the log I'm posting, there are a lot of lines of GUIDs being replaced, like

    and then the old ones being trashed, and some package updates, but it made the log way too long and I'm not sure they're relevant. But I'll save a copy locally, in case someone wants it.

    Here's the log: https://pastebin.com/G0UjnV0U

    I will try a few things to see if I get any results and will keep you posted. Thank you, Andy, for the great video and the repo, and to everyone in Unity for all the hard work!
     
  40. irenya

    irenya

    Joined:
    Nov 22, 2017
    Posts:
    6
    Update:
    1) Removing the package and installing it again seems to have fixed the issue with the previous install. When I tried it before I did after Unity just finished loading the project, so maybe it was doing some background stuff with the Package Manager itself that caused some conflict, I don't know. It does seem to me more a bug of the PM than anything related to this package
    2) It does seem to be that the comment on YouTube was correct. Opening in a new project with an already resized window, now I do have the blackboard area correctly. It's not ideal, but workable for now :)
    And I'm not going to resize the window at all for now :p

    BTW, it would make thing much easier to handle if the editor window (as well as all other dockable editor windows) didn't stay on top all the time. I'm pretty sure that wasn't the case in previous versions? I don't really see the advantage of it, and it should be optional, at least, especially for this, since the window is supposed to be quite large
     
    Last edited: May 12, 2018
  41. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    483
    eh?

    In theory, would it be possible to have 3 'output' nodes in one graph or whatever, one for LRP, one for Classic, and one for HD, and then the shader would #Ifdef.... magic some way to choose between what it does based on the current render mode?

    I'm not saying it would be a great idea for production, but rather for shader compatibility. Think Asset Store packs, sharing between projects, etc. I've got this fancy new flame shader, what do I put it as? What if a team wants to use my stuff later on for a mobile port and they only have the HD version?

    Shader operations used to be a thing with Strumpy's Shader Editor circa Unity 3.X (I think) but that was really because of early Shader Model instruction limits. And if I'm being honest, shader instruction count is kind of irrelevant now, with SM4+ cards and high resolution screens, it's more about how the counts are used (sequential things like using textures as a UV for other textures), and the number of times the shader is being called (number of pixels on screen). I can crush the performance of any app to dust in about 20 instructions just using those things badly.

    Anyway, found out this will work (kinda) with terrain. The base map is bright error pink (pfft who cares you're using a fancy shader now lol crank up base distance to >9000) but I'm hopeful of getting it to work better with the terrain. Would also be nice if there was a 'terrain normal/binormal/tangent, binearly filtered' node. Height you can just get from world position.y, and using ddxy on the normal and height seem to come up with different results at different distances, which is unusable.
     
  42. Japa

    Japa

    Joined:
    May 4, 2013
    Posts:
    33
    So, I've started playing around with this, and it works rather well. I'm able to re-create my existing shaders with it pretty easily.

    Two things I would need, however, for it to be a proper replacement, and they tie together.

    1: Namable properties. some textures in my project, namely two giant texture arrays, are set globally for all shaders via code. This is not possible with the graphs right now.

    2: Instanced properties, for use with material property blocks and GPU instancing.

    Speaking of, texture array nodes were missing, but I made a pull request on the GitHub repository fixing that.
     
  43. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    88
    I am not a huge fan of solutions that are not good for production.
    If it's not good for production it has no place in a professional tool.
     
    equalsequals likes this.
  44. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    103
    Though you make a good point about things like dependent texture reads, it's not like SM2.0 and 3.0 has gone away. In fact, LWRP targets SM2.0.

    If you look at Google's Daydream Renderer, they went so far as to unroll some intrinsics and hand-counted scalar ops to maximize performance, in order to preserve a 60Hz refresh rate.

    Just because we HAVE SM4.0+ doesn't mean we can always use them on our hardware. And considering that it's that level of control that SRP is about, ShaderGraph would benefit from taking that into consideration as well.

    Just my two cents as someone who is constantly optimizing for hardware and having to go back to 2001 every time some new technology comes out.
     
    GameDevCouple_I and soleron like this.
  45. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    88
    It's really bad practice to not optimize. It may be "fine" for a small amateur experience, but that's what characterizes small amateur experiences. The question is, do we want our work to be characterized as such?

    I know for sure that I do not want that. As I said earlier, I'm not ok with just "ok".
     
  46. KosmoDED

    KosmoDED

    Joined:
    May 22, 2017
    Posts:
    8
    Hey there, i was trying to change material properties (created with shader graph) via script.Seems that SetFloat() and functions like it currently not working. Am i right ?
     
    LuisHidalgo likes this.
  47. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,366
    Having a shader instruction statistic would be great actually
     
    equalsequals and GameDevCouple_I like this.
  48. AurelWu

    AurelWu

    Joined:
    Oct 11, 2013
    Posts:
    26
    I just spend 2 hours figuring out why my shaders did not work and stumbled on a localisation bug which messes up shader graph

    1) Unity recently started using "," instead of "." as decimal separator in the inspector and everywhere else if you have a localisation where that is the default - in my case German. Even when changing the decimal separator to "." in the language settings of my OS (Win7) did not stop Unity from using ",". Only changing to for example English (UK) helped. It's a bit annoying but that alone is not too problematic, however:

    2) Whenever you create a property in shadergraph which uses a "," in one of it's values eg a Vector1 with value "0,2" every new node created shows up as pink/purple checkerboard and the shader does not compile anymore.
     
  49. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,743
    Unity does not do in built localisation as far as I am aware, are you sure this is not caused by an asset?
     
  50. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,226
    GameDevCouple_I likes this.
Thread Status:
Not open for further replies.