Search Unity

Feature Request Reroute node for ShaderGraph

Discussion in 'Shader Graph' started by JotaRata, Jan 28, 2020.

  1. JotaRata

    JotaRata

    Joined:
    Dec 8, 2014
    Posts:
    61
    Hi, I might ask that is possible to add a reroute node like blender does to SG?

    That would be extremely useful to organize messy graphs and avoid connecting a node's output to multiple and further node's.
     
  2. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    I know it's not exactly the same but you could use a 'preview' node to help a bit with this
     
    JotaRata likes this.
  3. JotaRata

    JotaRata

    Joined:
    Dec 8, 2014
    Posts:
    61
    Yes I was using them since I wrote this post, they are not the same but works anyways
     
  4. levi9000

    levi9000

    Joined:
    Jan 25, 2014
    Posts:
    11
    The documentation says the preview node generates code... Hopefully it gets optimized out though? I want to use it for the same purpose.

    Code (CSharp):
    1. void Unity_Preview_float4(float4 In, out float4 Out)
    2. {
    3.     Out = In;
    4. }
     
  5. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Well, you have new rerouting ports now in shader graph:
    upload_2021-9-24_14-5-54.png
     
    Boyce_Lig likes this.
  6. Boyce_Lig

    Boyce_Lig

    Joined:
    Mar 5, 2019
    Posts:
    4
    How was this node created? I did not find this node in the 2022.3.13f1 version. I only knew that it was called Reroute node. When I copied it again, I got its information.

    Code (JavaScript):
    1. application/vnd.unity.graphview.elements {
    2.     "m_SGVersion": 0,
    3.     "m_Type": "UnityEditor.ShaderGraph.CopyPasteGraph",
    4.     "m_ObjectId": "88e5007f7eb8448b96f90b0512add4bb",
    5.     "m_Edges": [],
    6.     "m_Nodes": [
    7.         {
    8.             "m_Id": "8b00d760e13d40f98797beb847f05ede"
    9.         }
    10.     ],
    11.     "m_Groups": [],
    12.     "m_StickyNotes": [],
    13.     "m_Inputs": [],
    14.     "m_Categories": [],
    15.     "m_MetaProperties": [],
    16.     "m_MetaPropertyIds": [],
    17.     "m_MetaKeywords": [],
    18.     "m_MetaKeywordIds": [],
    19.     "m_MetaDropdowns": [],
    20.     "m_MetaDropdownIds": []
    21. }
    22.  
    23. {
    24.     "m_SGVersion": 0,
    25.     "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    26.     "m_ObjectId": "6d23ac134338499388c740c5dbb93e42",
    27.     "m_Id": 1,
    28.     "m_DisplayName": "",
    29.     "m_SlotType": 1,
    30.     "m_Hidden": false,
    31.     "m_ShaderOutputName": "",
    32.     "m_StageCapability": 3,
    33.     "m_Value": {
    34.         "x": 0.0,
    35.         "y": 0.0,
    36.         "z": 0.0,
    37.         "w": 0.0
    38.     },
    39.     "m_DefaultValue": {
    40.         "x": 0.0,
    41.         "y": 0.0,
    42.         "z": 0.0,
    43.         "w": 0.0
    44.     }
    45. }
    46.  
    47. {
    48.     "m_SGVersion": 0,
    49.     "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData",
    50.     "m_ObjectId": "8b00d760e13d40f98797beb847f05ede",
    51.     "m_Group": {
    52.         "m_Id": ""
    53.     },
    54.     "m_Name": "Redirect Node",
    55.     "m_DrawState": {
    56.         "m_Expanded": true,
    57.         "m_Position": {
    58.             "serializedVersion": "2",
    59.             "x": -1899.0,
    60.             "y": -745.0000610351563,
    61.             "width": 56.0,
    62.             "height": 24.00006103515625
    63.         }
    64.     },
    65.     "m_Slots": [
    66.         {
    67.             "m_Id": "ae3179aed9424741a603ae052af4b1ac"
    68.         },
    69.         {
    70.             "m_Id": "6d23ac134338499388c740c5dbb93e42"
    71.         }
    72.     ],
    73.     "synonyms": [],
    74.     "m_Precision": 0,
    75.     "m_PreviewExpanded": true,
    76.     "m_DismissedVersion": 0,
    77.     "m_PreviewMode": 0,
    78.     "m_CustomColors": {
    79.         "m_SerializableColors": []
    80.     }
    81. }
    82.  
    83. {
    84.     "m_SGVersion": 0,
    85.     "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
    86.     "m_ObjectId": "ae3179aed9424741a603ae052af4b1ac",
    87.     "m_Id": 0,
    88.     "m_DisplayName": "",
    89.     "m_SlotType": 0,
    90.     "m_Hidden": false,
    91.     "m_ShaderOutputName": "",
    92.     "m_StageCapability": 3,
    93.     "m_Value": {
    94.         "x": 0.0,
    95.         "y": 0.0,
    96.         "z": 0.0,
    97.         "w": 0.0
    98.     },
    99.     "m_DefaultValue": {
    100.         "x": 0.0,
    101.         "y": 0.0,
    102.         "z": 0.0,
    103.         "w": 0.0
    104.     }
    105. }
    106.  
    107.  
     
  7. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    143
    You can double-click on any wire in the graph to insert the reroute node.
     
    Boyce_Lig and kojdj0811 like this.
  8. Boyce_Lig

    Boyce_Lig

    Joined:
    Mar 5, 2019
    Posts:
    4
    Thanks My Friend!