Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Question Subgraph v custom node

Discussion in 'Shader Graph' started by monark, Jun 6, 2019.

  1. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    I notice that when you make a subgraph you have no control over the signatures of the values that come out of the graph they are always vector4.
    Does that make them far less performant than writing custom nodes or are they optimised down when compiled to remove all the redundant parts?

    If not then why aren't we able to control what gets passed out of a subgraph?

    They are very convenient but if they are very inefficient I'll look to build custom nodes instead.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,366
    A decent shader compilers will optimize most of that away at the cost of slightly longer compile times.
     
  3. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Thanks for the info, I'm gonna assume Unity compiler is decent for now for convenience sake.
     
  4. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Seems that custom nodes are no longer possible to build anyway so the point turns out to be moot
     
  5. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    If anyone from Unity passes by, a little note about Sub graphs, they are a bit of a pain to work with whilst you are making changes to them. Often to get them to recompile and have the changes appear in networks that use them you have to completely close Unity and restart.