Skip to content

Commit 7f88dee

Browse files
committed
disable subgraphs for now
1 parent 2db63f7 commit 7f88dee

13 files changed

+30
-143
lines changed

Editor/Generation/ShaderBuilder.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void BuildTemplate()
129129
target.OnAfterBuild(this);
130130
}
131131

132-
public Dictionary<int, GeneratedPortData> BuildSubgraph(ShaderGraphView subgraphView, NodeVisitor vistor, string assetPath)
132+
/* public Dictionary<int, GeneratedPortData> BuildSubgraph(ShaderGraphView subgraphView, NodeVisitor vistor, string assetPath)
133133
{
134134
var sb = new ShaderBuilder(GenerationMode.Final, subgraphView, BuildTarget);
135135
sb.AddPass(passBuilders[vistor.Pass]);
@@ -160,14 +160,7 @@ public Dictionary<int, GeneratedPortData> BuildSubgraph(ShaderGraphView subgraph
160160
sb.Build(target);
161161
//ShaderGraphView.uniqueID = subgraphView.uniqueID;
162162
return target.subgraphResults;
163-
164-
165-
/* var function = string.Join("\n", pass.surfaceDescription.ToArray());
166-
167-
//var asset = ScriptableObject.CreateInstance<Subgraph>();
168-
169-
return function;*/
170-
}
163+
}*/
171164

172165
public void Build(ShaderNode shaderNode)
173166
{

Editor/Serialization/GraphData.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Collections.Generic;
2-
using static Graphlit.SubgraphOutputNode;
2+
//using static Graphlit.SubgraphOutputNode;
33

44
namespace Graphlit
55
{
@@ -17,8 +17,8 @@ public class GraphData
1717
public bool stencil = false;
1818
public VRCFallbackTags vrcFallbackTags = new VRCFallbackTags();
1919

20-
public List<SerializablePortDescriptor> subgraphOutputs = new();
21-
public List<SerializablePortDescriptor> subgraphInputs = new();
20+
//public List<SerializablePortDescriptor> subgraphOutputs = new();
21+
//public List<SerializablePortDescriptor> subgraphInputs = new();
2222
public int subgraphOutputIdCounter = 0;
2323

2424
public enum GraphPrecision

Editor/ShaderGraphWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ public void AddBar(VisualElement visualElement)
126126
var selectMasterNode = new Button() { text = "Master Node", style = { height = 24 } };
127127
selectMasterNode.clicked += () =>
128128
{
129-
var masterNode = graphView.graphElements.Where(x => x is TemplateOutput || x is SubgraphOutputNode).First();
130-
//var masterNode = graphView.graphElements.Where(x => x is TemplateOutput).First();
129+
//var masterNode = graphView.graphElements.Where(x => x is TemplateOutput || x is SubgraphOutputNode).First();
130+
var masterNode = graphView.graphElements.Where(x => x is TemplateOutput).First();
131131

132132
bool contained = graphView.selection.Contains(masterNode);
133133

Editor/ShaderNode/Nodes/SubgraphInputNode.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
/*using System;
22
using UnityEngine.UIElements;
33
using UnityEngine;
44
using System.Linq;
@@ -44,25 +44,25 @@ public override void Initialize()
4444
4545
ResetPorts();
4646
47-
/*propertyDescriptor.onValueChange += () =>
47+
*//*propertyDescriptor.onValueChange += () =>
4848
{
4949
if (TitleLabel is null || propertyDescriptor is null)
5050
{
5151
return;
5252
}
5353
TitleLabel.text = propertyDescriptor.displayName;
5454
};
55-
TitleLabel.text = propertyDescriptor.displayName;*/
55+
TitleLabel.text = propertyDescriptor.displayName;*//*
5656
}
5757
5858
public override void AdditionalElements(VisualElement root)
5959
{
60-
/*var imgui = new IMGUIContainer();
60+
*//*var imgui = new IMGUIContainer();
6161
imgui.onGUIHandler = () =>
6262
{
6363
propertyDescriptor.PropertyEditorGUI();
6464
};
65-
root.Add(imgui);*/
65+
root.Add(imgui);*//*
6666
}
6767
6868
protected override void Generate(NodeVisitor visitor)
@@ -92,4 +92,4 @@ protected override void Generate(NodeVisitor visitor)
9292
//PortData[OUT] = new GeneratedPortData(portDescriptors[OUT].Type, output.name);
9393
}
9494
}
95-
}
95+
}*/

Editor/ShaderNode/Nodes/SubgraphNode.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
/*using System;
22
using UnityEngine.UIElements;
33
using UnityEngine;
44
using Graphlit.Nodes;
@@ -12,14 +12,14 @@ namespace Graphlit
1212
[NodeInfo("Input/Subgraph"), Serializable]
1313
public class SubgraphNode : ShaderNode
1414
{
15-
/*public static readonly string[] Tag = new[] { "GraphlitFunction", "ZSGFunction" };
15+
*//*public static readonly string[] Tag = new[] { "GraphlitFunction", "ZSGFunction" };
1616
[MenuItem("Assets/Create/Graphlit/Shader Include", priority = -1)]
1717
public static void CreateVariantFile()
1818
{
1919
ProjectWindowUtil.CreateAssetWithContent("CustomFunction.hlsl", DefaultFunction);
2020
var include = new ShaderInclude();
2121
AssetDatabase.SetLabels(include, new[] { Tag[0] });
22-
}*/
22+
}*//*
2323
2424
[SerializeField] public string subgraphRef;
2525
public void UseFile(ShaderInclude include)
@@ -144,7 +144,7 @@ protected override void Generate(NodeVisitor visitor)
144144
visitor._shaderBuilder.dependencies.Add(assetPath);
145145
}
146146
147-
/*public override IEnumerable<Port> Outputs
147+
*//*public override IEnumerable<Port> Outputs
148148
{
149149
get
150150
{
@@ -166,6 +166,6 @@ protected override void Generate(NodeVisitor visitor)
166166
}
167167
}
168168
}
169-
}*/
169+
}*//*
170170
}
171-
}
171+
}*/

Editor/ShaderNode/Nodes/SubgraphOutputNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
/*using System;
22
using UnityEngine.UIElements;
33
using UnityEngine;
44
using Graphlit.Nodes;
@@ -229,4 +229,4 @@ void Update()
229229
CleanLooseEdges();
230230
}
231231
}
232-
}
232+
}*/

Editor/ShaderSearchWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public List<SearchTreeEntry> CreateSearchTree(SearchWindowContext context)
5353
};
5454

5555

56-
if (_graphView.graphData.subgraphInputs.Count > 0)
56+
/*if (_graphView.graphData.subgraphInputs.Count > 0)
5757
{
5858
tree.Add(new SearchTreeGroupEntry(new GUIContent("Subgraph Inputs"), 1));
5959
@@ -63,7 +63,7 @@ public List<SearchTreeEntry> CreateSearchTree(SearchWindowContext context)
6363
var ctx = new CreateSubgraphInputContext() { id = var.id };
6464
tree.Add(new SearchTreeEntry(new GUIContent($"Input: {name}", _nodeIndentationIcon)) { level = 2, userData = ctx });
6565
}
66-
}
66+
}*/
6767

6868
tree.Add(new SearchTreeGroupEntry(new GUIContent("Material Properties"), 1));
6969
for (int i = 0; i < _graphView.graphData.properties.Count; i++)
@@ -192,13 +192,13 @@ public bool OnSelectEntry(SearchTreeEntry searchTreeEntry, SearchWindowContext c
192192
_graphView.CreateNode(node, context.screenMousePosition);
193193
return true;
194194
}
195-
else if (userData is CreateSubgraphInputContext var1)
195+
/*else if (userData is CreateSubgraphInputContext var1)
196196
{
197197
var node = (SubgraphInputNode)Activator.CreateInstance(typeof(SubgraphInputNode));
198198
node.SetReference(var1.id);
199199
_graphView.CreateNode(node, context.screenMousePosition);
200200
return true;
201-
}
201+
}*/
202202
_graphView.CreateNode(searchTreeEntry.userData as Type, context.screenMousePosition);
203203
return true;
204204
}

Editor/Targets/FragmentShadow.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void frag(Varyings varyings)
1616

1717
#if defined(_ALPHAPREMULTIPLY_ON) || defined(_ALPHAMODULATE_ON) || defined(_ALPHAFADE_ON)
1818
#if defined(SHADOWS_DEPTH)
19-
if(UNITY_MATRIX_P._m33 != 0.0)
19+
if(UNITY_MATRIX_P._m33 != 0.0) // thanks liltoon
2020
#endif
2121
{
2222
half dither = Unity_Dither(surfaceDescription.Alpha, varyings.positionCS.xy / _ScreenParams.xy);

Shaders/Lit.graphlit

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@
236236
"mode": 0,
237237
"doubleSided": false
238238
},
239-
"subgraphOutputs": [],
240-
"subgraphInputs": [],
241239
"subgraphOutputIdCounter": 0
242240
},
243241
"nodes": [

Shaders/Test Subgraph.subgraphlit

Lines changed: 0 additions & 93 deletions
This file was deleted.

Shaders/Test Subgraph.subgraphlit.meta

Lines changed: 0 additions & 10 deletions
This file was deleted.

Shaders/Toon.graphlit

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,6 @@
366366
"mode": 0,
367367
"doubleSided": false
368368
},
369-
"subgraphOutputs": [],
370-
"subgraphInputs": [],
371369
"subgraphOutputIdCounter": 0
372370
},
373371
"nodes": [

Shaders/Unlit.graphlit

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"type": 1,
5454
"mode": 0,
5555
"doubleSided": false
56-
}
56+
},
57+
"subgraphOutputIdCounter": 0
5758
},
5859
"nodes": [
5960
{
@@ -71,7 +72,7 @@
7172
"precision": 0,
7273
"preview": 0,
7374
"previewDisabled": false,
74-
"data": ""
75+
"data": "{\"autoKeyword\":false}"
7576
},
7677
{
7778
"type": "Graphlit.Texture2DPropertyNode",
@@ -109,7 +110,7 @@
109110
"precision": 0,
110111
"preview": 0,
111112
"previewDisabled": false,
112-
"data": ""
113+
"data": "{\"_customLighting\":false}"
113114
},
114115
{
115116
"type": "Graphlit.FloatPropertyNode",

0 commit comments

Comments
 (0)