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

Feedback Shadergraph in 2019.3 to 2020.1 production problems/feedback

Discussion in 'Shader Graph' started by hippocoder, Nov 3, 2019.

  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hello! Love shadergraph for production but there are a number of serious pain points which force me to move away from it and hand-code it. It's silly because it's so close to also being usable in production.

    Pros:
    • Rapid prototyping
    • Can add code in blocks or includes
    • Subgraphs are genius
    Cons:
    • Cannot tell if any node or code is running per vertex or per pixel. Vital for production optimisations
    • Cannot set tags or pass behaviours like Depth, Blending, Offset etc
    • Heavy bugs like locking UV precision to ES2 when I guarantee ES3 hardware (pretty cringe)
    • Performance needlessly bad in cases where it would be trivial to put in vertex shader
    These "niggles" are actually show stoppers. I have to go in and basically recode half the entire thing to run code in vert to pass to frag. Yes these optimisations DO matter and have *tripled* my framerate on Oculus Quest (I do a lot of per-vert custom lighting that runs faster than Universal pipeline lighting as I know what conditions in which to use it).



    Please help me use shadergraph for more than a prototyping gimmick :) Ideally I would love to be able to remove the cons part. Any love for shadergraph coming?

    Thanks!
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    AFAIK everything is per pixel, so no need to wonder any more!
     
    hippocoder likes this.
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I can see some vertex operations taking place such as position nodes but it's very guess-work-worthy and I want to create or transform data in vert then pass the result to frag to do my evil bidding.

    I did realtime PBR-lite in Physynth on ipad 1 in 2010, and then did a basic vert based path tracer for PS Vita in 2014, so I'm pretty good at custom work. I want to work in shader graph because for the most part, per-pixel is fine. However when you want to have 3x speedups you do approximations in vert. I don't pass much so it's not a bandwidth issue. But I do calculate a lot in vert.

    The work of re-coding the shader after a designer wants to tweak the graph is burning me out, and it's frustrating as it doesn't need to be this way.

    The purpose of shader graph should be to save work. It does if you're a hobbyist or designer, but for someone making optimised content to show Unity off with performance by default then it cannot be done with shadergraph even though its super-close to being possible.

    I'd love to know if plans are coming for optimisations such as proper control over vertex calculations and tags/offset/other stuff.

    Please let us know something because if it's not going to happen I might as well bin shadergraph and do my own shaders, which means the only use of the graph is really, for hobbyists and that confuses me quite a bit.

    I know @JasonBooth struggled with SG as well (sorry for the tag but you're the only guy springing to mind with a similar scenario).
     
    AcidArrow likes this.
  4. ph_

    ph_

    Joined:
    Sep 5, 2013
    Posts:
    232
    For the same reasons, I have been in teams where artists would use ShaderGraph, then once they are happy with the results, programmer would take the shader and re-code it to optimize it.
    Then when artists want to change something again, programmer become the bottleneck to integrate shader changes in the game .... which is the exact problem ShaderGraph was supposed to solve to begin with!

    That being said, adding Tags / Depth / Blending / Offset is pretty easy (having done so myself in custom master nodes), so it's just a matter of priority on Unity's side.
    Adding the ability to move any code from fragment -> vertex and vertex -> fragment is more challenging and complicated (but not impossible of course :)).
     
    hippocoder likes this.
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Your asset is nice. I didn't see support for Offset and any chance of UV precision for the master node (Unity forces precision to half for Android). I'm guessing those are harder or it's a sticking point for Unity? In any case, nice work.
     
    ph_ likes this.
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    In tools such as these, even if they target hobbyists, I am always of the opinion that they should always have more advanced features.

    Having more advanced features in an optional way, makes the tool useful for learning, since it may gently push people to read on how shaders actually work and that is very useful even if you intend to keep using visual only tools.
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I want a complete tools-driven workflow for making games with little exceptions like function nodes I can dive in to save a lot of time (sometimes nodes can be more messy, or the math too abstract) and we're almost there. I just need the tools to be a little stronger with performance.

    With Unity, the engine is fast but their own tools throttle it.
     
  8. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Strumpy didn't had these problem, it had distinct vertex, light and fragments node, why this model wasn't kept is beyond me. If anything give the light graph distinct output for vertex or fragment in the master light node.
     
    hippocoder likes this.
  9. ph_

    ph_

    Joined:
    Sep 5, 2013
    Posts:
    232
    Thanks! No there's no support for either at the moment, but it shouldn't be too hard to add. Honestly the main reason I didn't jump on it is because I expected Unity to release these feature soon.
     
    hippocoder likes this.