Compare commits
No commits in common. "main" and "master" have entirely different histories.
@ -1,11 +0,0 @@
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace ImageProcessingGraph.Editor
|
||||
{
|
||||
public class IPT_Preferences : ScriptableObject
|
||||
{
|
||||
public bool debugMode = false;
|
||||
}
|
||||
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace ImageProcessingGraph.Editor
|
||||
{
|
||||
[Serializable]
|
||||
public class GreyscaleValue
|
||||
{
|
||||
public int value = 255;
|
||||
|
||||
public GreyscaleValue()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class GreyscaleField : IntegerField
|
||||
{
|
||||
public (int, int) minMax = (0,255);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ab37c25c4884480b8777a62e042a37c
|
||||
timeCreated: 1745703416
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6957ba197a1612a4c8f0f588d40e374f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d31e8b213de87c54caaf096620201846
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,27 +0,0 @@
|
||||
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
|
||||
using Unity.Burst;
|
||||
using Unity.Collections;
|
||||
using Unity.Jobs;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture
|
||||
{
|
||||
[NodeInfoAttribute("Get Dimensions", "Dimensions/Get Dimensions", false)]
|
||||
public class TextureGetDimensions : BaseImageNode
|
||||
{
|
||||
[NodeAttributes.Input("")]
|
||||
public ImageData inputTexture;
|
||||
|
||||
[NodeAttributes.Output("Width")]
|
||||
public int width;
|
||||
|
||||
[NodeAttributes.Output("Height")]
|
||||
public int height;
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
this.width = inputTexture.Width;
|
||||
this.height = inputTexture.Height;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 71e1db2a5bfe4a54a6ce2a99fe4d02fb
|
||||
timeCreated: 1745699625
|
@ -1,37 +0,0 @@
|
||||
using System.ComponentModel.Composition.Primitives;
|
||||
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
|
||||
using Unity.Collections;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ImageProcessingGraph.Editor.Nodes.Output
|
||||
{
|
||||
[NodeInfo("Texture Export", "Export/Export Texture", true)]
|
||||
public class Texture2DOutput : BaseImageNode
|
||||
{
|
||||
[NodeAttributes.Input("")] public ImageData inputPixels;
|
||||
[NodeAttributes.Input("File Name")] public string fileName;
|
||||
[NodeAttributes.Input("File Path")] public string fileDirectory;
|
||||
|
||||
public enum ExportType
|
||||
{
|
||||
Texture2D,
|
||||
PNG
|
||||
}
|
||||
|
||||
[NodeAttributes.Input("Export Type")] public ExportType exportType;
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
switch (exportType)
|
||||
{
|
||||
case ExportType.Texture2D:
|
||||
AssetDatabase.CreateAsset(inputPixels.ToTexture2D(), $"{fileDirectory}/{fileName}.asset");
|
||||
break;
|
||||
case ExportType.PNG:
|
||||
inputPixels.ExportPNG($"{fileDirectory}/{fileName}.png");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96b583a3bbd8b2c45a5eaa9e0f00d1b2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf8e2895a77954d45864e9f8edae29c3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c524131b4dbc3414ab755a10441b3841
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,61 +0,0 @@
|
||||
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
|
||||
using Unity.Burst;
|
||||
using Unity.Collections;
|
||||
using Unity.Jobs;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Utilities
|
||||
{
|
||||
public class SingleChannelColor
|
||||
{
|
||||
[NodeInfoAttribute("Channel Color", "Utility/Channel Color", false)]
|
||||
public class SingleColorChannel : BaseImageNode
|
||||
{
|
||||
[NodeAttributes.Input("Color")] public GreyscaleValue range;
|
||||
|
||||
[NodeAttributes.Input("Width")] public int Width;
|
||||
|
||||
[NodeAttributes.Input("Height")] public int Height;
|
||||
|
||||
[NodeAttributes.Output("Color")] public SplitChannelData OutputColor;
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
int pixelCount = Width * Height;
|
||||
|
||||
NativeArray<byte> outputData = new NativeArray<byte>(pixelCount * 4, Allocator.Persistent);
|
||||
|
||||
CreateSingleColorJob job = new CreateSingleColorJob
|
||||
{
|
||||
color32 = range.value,
|
||||
outputData = outputData,
|
||||
width = Width,
|
||||
height = Height
|
||||
};
|
||||
|
||||
job.Run();
|
||||
|
||||
OutputColor = new SplitChannelData(outputData.ToArray(), (Width, Height));
|
||||
}
|
||||
|
||||
[BurstCompile]
|
||||
struct CreateSingleColorJob : IJob
|
||||
{
|
||||
public int color32;
|
||||
[WriteOnly]
|
||||
public NativeArray<byte> outputData;
|
||||
public int width;
|
||||
public int height;
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
// More efficient linear write pattern
|
||||
for (int i = 0; i < width*height*4; i++)
|
||||
{
|
||||
outputData[i] = (byte)color32;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aef9d7bde3d544e6bca5eef8ff58a60e
|
||||
timeCreated: 1745699866
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77d8c5639ebc40947940b6b150aad306
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c221fbc5c38e72643af466921f820588
|
||||
guid: f6fe8f57402cf44e8bb5f1dffb3be6d8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
232
Graphs/URP-MAS.asset
Normal file
232
Graphs/URP-MAS.asset
Normal file
@ -0,0 +1,232 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1da462fd3f736d04e80556b4ac8b470f, type: 3}
|
||||
m_Name: URP-MAS
|
||||
m_EditorClassIdentifier:
|
||||
nodes:
|
||||
- rid: 6869590814762467406
|
||||
- rid: 6869590814762467407
|
||||
- rid: 6869590814762467408
|
||||
- rid: 6869590814762467409
|
||||
- rid: 6869590814762467410
|
||||
- rid: 6869590814762467411
|
||||
- rid: 6869590814762467412
|
||||
connections:
|
||||
- inputPort:
|
||||
nodeID: c72eea15-501d-41b1-add3-4f0816ef3373
|
||||
nodeType: StringAppend
|
||||
portID: 0
|
||||
outputPort:
|
||||
nodeID: c21a6722-828f-4372-a718-298a0fe7b79b
|
||||
nodeType: StringAppend
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: 9ccc58ba-79a7-4a7f-8057-3bdfbf8fb5c3
|
||||
nodeType: Texture2DOutput
|
||||
portID: 1
|
||||
outputPort:
|
||||
nodeID: c72eea15-501d-41b1-add3-4f0816ef3373
|
||||
nodeType: StringAppend
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: 87c7a966-55ec-42aa-a537-73ebe906412b
|
||||
nodeType: RGBASplit
|
||||
portID: 0
|
||||
outputPort:
|
||||
nodeID: ac4be66e-d3b8-4633-a692-60cb30579f97
|
||||
nodeType: Texture2DImport
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
|
||||
nodeType: RGBASplit
|
||||
portID: 0
|
||||
outputPort:
|
||||
nodeID: 9b32fc10-fda3-4faa-82ac-efcff95a5138
|
||||
nodeType: Texture2DImport
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
|
||||
nodeType: RGBASCombine
|
||||
portID: 1
|
||||
outputPort:
|
||||
nodeID: 87c7a966-55ec-42aa-a537-73ebe906412b
|
||||
nodeType: RGBASplit
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
|
||||
nodeType: RGBASCombine
|
||||
portID: 0
|
||||
outputPort:
|
||||
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
|
||||
nodeType: RGBASplit
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
|
||||
nodeType: RGBASCombine
|
||||
portID: 3
|
||||
outputPort:
|
||||
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
|
||||
nodeType: RGBASplit
|
||||
portID: 3
|
||||
- inputPort:
|
||||
nodeID: b882f7b7-9f8b-43ef-a79a-33d4e874edd0
|
||||
nodeType: Texture2DOutput
|
||||
portID: 0
|
||||
outputPort:
|
||||
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
|
||||
nodeType: RGBASCombine
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: b882f7b7-9f8b-43ef-a79a-33d4e874edd0
|
||||
nodeType: Texture2DOutput
|
||||
portID: 2
|
||||
outputPort:
|
||||
nodeID: 9b32fc10-fda3-4faa-82ac-efcff95a5138
|
||||
nodeType: Texture2DImport
|
||||
portID: 2
|
||||
- inputPort:
|
||||
nodeID: 97953833-bdf9-47b5-b1d2-b4cbfa19f57a
|
||||
nodeType: StringAppend
|
||||
portID: 0
|
||||
outputPort:
|
||||
nodeID: 9b32fc10-fda3-4faa-82ac-efcff95a5138
|
||||
nodeType: Texture2DImport
|
||||
portID: 1
|
||||
- inputPort:
|
||||
nodeID: b882f7b7-9f8b-43ef-a79a-33d4e874edd0
|
||||
nodeType: Texture2DOutput
|
||||
portID: 1
|
||||
outputPort:
|
||||
nodeID: 97953833-bdf9-47b5-b1d2-b4cbfa19f57a
|
||||
nodeType: StringAppend
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
|
||||
nodeType: RGBASCombine
|
||||
portID: 2
|
||||
outputPort:
|
||||
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
|
||||
nodeType: RGBASplit
|
||||
portID: 3
|
||||
- inputPort:
|
||||
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
|
||||
nodeType: RGBASCombine
|
||||
portID: 3
|
||||
outputPort:
|
||||
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
|
||||
nodeType: RGBASplit
|
||||
portID: 2
|
||||
references:
|
||||
version: 2
|
||||
RefIds:
|
||||
- rid: 6869590814762467406
|
||||
type: {class: Texture2DImport, ns: ImageProcessingGraph.Editor.Nodes.Import_Nodes, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: ac4be66e-d3b8-4633-a692-60cb30579f97
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: -285.5
|
||||
y: 18
|
||||
width: 311
|
||||
height: 125
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Import_Nodes.Texture2DImport,
|
||||
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
textureImport: {fileID: 2800000, guid: 44da9e368ce69454aa6ccc40919a7f50, type: 3}
|
||||
fileName:
|
||||
filePath:
|
||||
- rid: 6869590814762467407
|
||||
type: {class: Texture2DImport, ns: ImageProcessingGraph.Editor.Nodes.Import_Nodes, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: 9b32fc10-fda3-4faa-82ac-efcff95a5138
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: -287
|
||||
y: 292
|
||||
width: 288
|
||||
height: 125
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Import_Nodes.Texture2DImport,
|
||||
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
textureImport: {fileID: 2800000, guid: 1640d081a2287448cb2a75fba48b9dcf, type: 3}
|
||||
fileName:
|
||||
filePath:
|
||||
- rid: 6869590814762467408
|
||||
type: {class: RGBASplit, ns: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: 87c7a966-55ec-42aa-a537-73ebe906412b
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: 124
|
||||
y: 18
|
||||
width: 138
|
||||
height: 149
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture.RGBASplit,
|
||||
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
- rid: 6869590814762467409
|
||||
type: {class: RGBASplit, ns: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: 124
|
||||
y: 167
|
||||
width: 138
|
||||
height: 149
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture.RGBASplit,
|
||||
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
- rid: 6869590814762467410
|
||||
type: {class: RGBASCombine, ns: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: 3abef457-f0ec-456e-baa8-e8ae657b49e4
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: 315.5
|
||||
y: 92.5
|
||||
width: 138
|
||||
height: 149
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture.RGBASCombine,
|
||||
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
- rid: 6869590814762467411
|
||||
type: {class: Texture2DOutput, ns: ImageProcessingGraph.Editor.Nodes.Output, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: b882f7b7-9f8b-43ef-a79a-33d4e874edd0
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: 559.5
|
||||
y: 143
|
||||
width: 129.5
|
||||
height: 125
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Output.Texture2DOutput, ImageProcessingGraphEditor,
|
||||
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
fileName:
|
||||
fileDirectory:
|
||||
- rid: 6869590814762467412
|
||||
type: {class: StringAppend, ns: ImageProcessingGraph.Editor.Nodes.String_Nodes, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: 97953833-bdf9-47b5-b1d2-b4cbfa19f57a
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: 124
|
||||
y: 450.5
|
||||
width: 248
|
||||
height: 101
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.String_Nodes.StringAppend, ImageProcessingGraphEditor,
|
||||
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
baseString:
|
||||
appendString: _MAS
|
||||
output:
|
@ -1,8 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e6bd53786a8dee54790032792e0b03da
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
guid: d04964bb165ef4820be34fe3f050be61
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
7
Node.uss
7
Node.uss
@ -1,7 +0,0 @@
|
||||
#node-border
|
||||
{
|
||||
border-bottom-color: red;
|
||||
border-left-color: red;
|
||||
border-right-color: red;
|
||||
border-top-color: red;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f213bce165884ca7ae5d567d6bb7f3cb
|
||||
timeCreated: 1745777804
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using UnityEditor.Experimental.GraphView;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
@ -7,8 +6,6 @@ namespace ImageProcessingGraph.Editor
|
||||
{
|
||||
public class IPTPort : Port
|
||||
{
|
||||
public FieldInfo fieldInfo;
|
||||
|
||||
protected IPTPort(Orientation portOrientation, Direction portDirection, Capacity portCapacity, Type type) : base(portOrientation, portDirection, portCapacity, type)
|
||||
{
|
||||
|
||||
@ -17,7 +14,7 @@ namespace ImageProcessingGraph.Editor
|
||||
public static IPTPort Create(IEdgeConnectorListener connectorListener, bool isInput, Type type)
|
||||
{
|
||||
var port = new IPTPort(Orientation.Horizontal, isInput ? Direction.Input : Direction.Output,
|
||||
isInput ? Capacity.Single : Capacity.Multi, type)
|
||||
Capacity.Multi, type)
|
||||
{
|
||||
m_EdgeConnector = new EdgeConnector<Edge>(connectorListener),
|
||||
};
|
18
Scripts/Editor/Data Types/IPT_Preferences.cs
Normal file
18
Scripts/Editor/Data Types/IPT_Preferences.cs
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace ImageProcessingGraph.Editor
|
||||
{
|
||||
#if true
|
||||
[CreateAssetMenu(menuName = "PreferenceCreate")]
|
||||
#endif
|
||||
public class IPT_Preferences : ScriptableObject
|
||||
{
|
||||
[Header("Grid Settings")]
|
||||
public float thickLines;
|
||||
public float spacing;
|
||||
public Color gridBackgroundColour;
|
||||
public Color lineColour;
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
using System.IO;
|
||||
using Unity.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
@ -37,7 +36,7 @@ public struct ImageData
|
||||
/// <param name="sourceTexture">The source texture to extract pixel data from.</param>
|
||||
public ImageData(Texture2D sourceTexture)
|
||||
{
|
||||
PixelData = new NativeArray<Color32>(sourceTexture.GetPixelData<Color32>(0), Allocator.Persistent);
|
||||
PixelData = sourceTexture.GetPixelData<Color32>(0);
|
||||
Dimensions = (sourceTexture.width, sourceTexture.height);
|
||||
isRGBA = sourceTexture.format == TextureFormat.RGBA32;
|
||||
}
|
||||
@ -63,27 +62,4 @@ public struct ImageData
|
||||
texture.Apply();
|
||||
return texture;
|
||||
}
|
||||
|
||||
public void ExportPNG(string path)
|
||||
{
|
||||
Texture2D texture = this.ToTexture2D();
|
||||
byte[] data = texture.EncodeToPNG();
|
||||
string thePath;
|
||||
|
||||
if (path.StartsWith("Assets/"))
|
||||
{
|
||||
thePath = path.Substring("Assets/".Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
thePath = path;
|
||||
}
|
||||
|
||||
thePath.Replace("/", "\\");
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
System.IO.File.WriteAllBytes(Path.Combine(Application.dataPath, thePath), data);
|
||||
}
|
||||
}
|
||||
}
|
@ -16,16 +16,11 @@ namespace ImageProcessingGraph.Editor
|
||||
{
|
||||
[SerializeReference] private List<BaseImageNode> nodes;
|
||||
[SerializeField] private List<GraphConnection> connections;
|
||||
[SerializeReference] public List<BaseImageNode> runOrder;
|
||||
[SerializeField] public List<BaseImageNode> runOrder;
|
||||
[SerializeField] public List<StickyNote> stickyNotes;
|
||||
|
||||
public List<BaseImageNode> Nodes => nodes;
|
||||
public List<GraphConnection> Connections => connections;
|
||||
|
||||
public delegate void OnRunEvent();
|
||||
public event OnRunEvent OnRun;
|
||||
public OnRunEvent OnRunEnd;
|
||||
|
||||
public ImageProcessingGraphAsset()
|
||||
{
|
||||
nodes = new List<BaseImageNode>();
|
||||
@ -47,8 +42,6 @@ namespace ImageProcessingGraph.Editor
|
||||
|
||||
public void RunGraph()
|
||||
{
|
||||
OnRun?.Invoke();
|
||||
|
||||
// Create and start the stopwatch to measure time
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
@ -56,15 +49,9 @@ namespace ImageProcessingGraph.Editor
|
||||
if (runOrder == null)
|
||||
runOrder = GetExecutionOrder(this.nodes, this.connections);
|
||||
|
||||
bool failed = false;
|
||||
|
||||
foreach (var VARIABLE in runOrder)
|
||||
{
|
||||
if (!VARIABLE.RunNode())
|
||||
{
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
VARIABLE.RunNode();
|
||||
}
|
||||
|
||||
// Stop the stopwatch after running the nodes
|
||||
@ -72,8 +59,6 @@ namespace ImageProcessingGraph.Editor
|
||||
|
||||
// Log the elapsed time
|
||||
UnityEngine.Debug.Log($"Graph execution took {stopwatch.ElapsedMilliseconds} milliseconds.");
|
||||
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
|
@ -26,13 +26,10 @@ namespace ImageProcessingGraph.Editor
|
||||
|
||||
public ImageProcessingGraphAsset asset;
|
||||
|
||||
public delegate void OnFailed();
|
||||
public event OnFailed onFailed;
|
||||
|
||||
public BaseImageNode()
|
||||
{
|
||||
guid = Guid.NewGuid().ToString();
|
||||
|
||||
|
||||
/*Type t = this.GetType();
|
||||
Debug.Log(t.Name);*/
|
||||
}
|
||||
@ -64,7 +61,7 @@ namespace ImageProcessingGraph.Editor
|
||||
}
|
||||
|
||||
if (connection.Equals((default(GraphConnection))))
|
||||
continue;
|
||||
return;
|
||||
|
||||
// Get the output node from the connection
|
||||
var outputNode = asset.Nodes.FirstOrDefault(n => n.ID == connection.outputPort.nodeID);
|
||||
@ -104,20 +101,10 @@ namespace ImageProcessingGraph.Editor
|
||||
}
|
||||
|
||||
|
||||
public bool RunNode()
|
||||
public void RunNode()
|
||||
{
|
||||
try
|
||||
{
|
||||
SetNodeInputs();
|
||||
this.Process();
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
onFailed?.Invoke();
|
||||
Debug.LogError(e);
|
||||
return false;
|
||||
}
|
||||
SetNodeInputs();
|
||||
this.Process();
|
||||
}
|
||||
|
||||
public virtual void Process()
|
@ -1,7 +1,4 @@
|
||||
using UnityEditor.Experimental.GraphView;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ImageProcessingGraph.Editor
|
||||
namespace ImageProcessingGraph.Editor
|
||||
{
|
||||
[System.Serializable]
|
||||
public struct GraphConnection
|
||||
@ -9,20 +6,16 @@ namespace ImageProcessingGraph.Editor
|
||||
public GraphPort inputPort;
|
||||
public GraphPort outputPort;
|
||||
|
||||
[SerializeField] public Edge internalEdge;
|
||||
|
||||
public GraphConnection(GraphPort inputPort, GraphPort outputPort, Edge internalEdge)
|
||||
public GraphConnection(GraphPort inputPort, GraphPort outputPort)
|
||||
{
|
||||
this.inputPort = inputPort;
|
||||
this.outputPort = outputPort;
|
||||
this.internalEdge = internalEdge;
|
||||
}
|
||||
|
||||
public GraphConnection(string inputNodeGuid, int inputPortID, string inputNodeType, string outputNodeGuid, int outputPortID, string outputNodeType, Edge internalEdge)
|
||||
public GraphConnection(string inputNodeGuid, int inputPortID, string inputNodeType, string outputNodeGuid, int outputPortID, string outputNodeType)
|
||||
{
|
||||
this.inputPort = new GraphPort(inputNodeGuid, inputPortID, inputNodeType);
|
||||
this.outputPort = new GraphPort(outputNodeGuid, outputPortID, outputNodeType);
|
||||
this.internalEdge = internalEdge;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +26,6 @@ namespace ImageProcessingGraph.Editor
|
||||
public string nodeType;
|
||||
public int portID;
|
||||
|
||||
|
||||
public GraphPort(string nodeID, int portID, string nodeType)
|
||||
{
|
||||
this.nodeID = nodeID;
|
3
Scripts/Editor/Nodes/Fun Nodes.meta
Normal file
3
Scripts/Editor/Nodes/Fun Nodes.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca37b9337d41484892c89933479f1e7f
|
||||
timeCreated: 1743745541
|
3
Scripts/Editor/Nodes/Fun Nodes/Texture.meta
Normal file
3
Scripts/Editor/Nodes/Fun Nodes/Texture.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1646a2bcaf6b4de488cadad1d7cdf795
|
||||
timeCreated: 1743747481
|
@ -1,5 +1,4 @@
|
||||
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
|
||||
using Unity.Burst;
|
||||
using Unity.Collections;
|
||||
using Unity.Jobs;
|
||||
using UnityEngine;
|
||||
@ -23,10 +22,10 @@ namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
int length = inputTexture.PixelData.Length;;
|
||||
int length = inputTexture.PixelData.Length;
|
||||
|
||||
// Allocate NativeArrays for the pixel data and the individual RGBA channels
|
||||
NativeArray<Color32> pixelData = inputTexture.PixelData;
|
||||
NativeArray<Color32> pixelData = new NativeArray<Color32>(inputTexture.PixelData, Allocator.Persistent);
|
||||
NativeArray<byte> rChannel = new NativeArray<byte>(length, Allocator.Persistent);
|
||||
NativeArray<byte> gChannel = new NativeArray<byte>(length, Allocator.Persistent);
|
||||
NativeArray<byte> bChannel = new NativeArray<byte>(length, Allocator.Persistent);
|
||||
@ -54,7 +53,6 @@ namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture
|
||||
}
|
||||
|
||||
// Job struct for processing the image data
|
||||
[BurstCompile]
|
||||
struct RGBAJob : IJob
|
||||
{
|
||||
public NativeArray<Color32> pixelData;
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf47dea8bd47175418a3f462e2ddb060
|
||||
guid: 22b0f0e553dc85e489979a232505a332
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
@ -6,7 +6,7 @@ using UnityEngine;
|
||||
|
||||
namespace ImageProcessingGraph.Editor.Nodes.Import_Nodes
|
||||
{
|
||||
[NodeInfo("Texture Import", "Imports/Import Texture", true)]
|
||||
[NodeInfo("Texture Import", "Imports/Texture2D", true)]
|
||||
public class Texture2DImport : BaseImageNode
|
||||
{
|
||||
[NodeAttributes.Input("")]
|
||||
@ -23,20 +23,6 @@ namespace ImageProcessingGraph.Editor.Nodes.Import_Nodes
|
||||
{
|
||||
if (this.textureImport != null)
|
||||
{
|
||||
TextureImporter textureImporter = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(textureImport)) as TextureImporter;
|
||||
|
||||
TextureImporterPlatformSettings texset = textureImporter.GetDefaultPlatformTextureSettings();
|
||||
texset.format=TextureImporterFormat.RGBA32;
|
||||
texset.maxTextureSize=16384;
|
||||
textureImporter.SetPlatformTextureSettings(texset);
|
||||
|
||||
TextureImporterSettings settings = new TextureImporterSettings();
|
||||
textureImporter.ReadTextureSettings(settings);
|
||||
settings.readable = true;
|
||||
textureImporter.SetTextureSettings(settings);
|
||||
textureImporter.SaveAndReimport();
|
||||
|
||||
|
||||
this.textureOutput = new ImageData(textureImport);
|
||||
this.fileName = textureImport.name;
|
||||
this.filePath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(textureImport));
|
20
Scripts/Editor/Nodes/Output/Texture2DOutput.cs
Normal file
20
Scripts/Editor/Nodes/Output/Texture2DOutput.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
|
||||
using Unity.Collections;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ImageProcessingGraph.Editor.Nodes.Output
|
||||
{
|
||||
[NodeInfo("Texture Export", "Export/Texture2D", true)]
|
||||
public class Texture2DOutput : BaseImageNode
|
||||
{
|
||||
[NodeAttributes.Input("")] public ImageData inputPixels;
|
||||
[NodeAttributes.Input("File Name")] public string fileName;
|
||||
[NodeAttributes.Input("File Path")] public string fileDirectory;
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
AssetDatabase.CreateAsset(inputPixels.ToTexture2D(), $"{fileDirectory}/{fileName}.asset");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor.Experimental.GraphView;
|
||||
using UnityEditor.MemoryProfiler;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
@ -27,43 +26,10 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
{
|
||||
window.searchProvider.target = (VisualElement)window.focusController.focusedElement;
|
||||
SearchWindow.Open(new SearchWindowContext(position), window.searchProvider);
|
||||
|
||||
List<GraphConnection> connections = new List<GraphConnection>();
|
||||
|
||||
foreach (var conn in window.asset.Connections)
|
||||
{
|
||||
if (conn.internalEdge == edge)
|
||||
{
|
||||
connections.Add(conn);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var VARIABLE in connections)
|
||||
{
|
||||
window.asset.Connections.Remove(VARIABLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void OnDrop(UnityEditor.Experimental.GraphView.GraphView graphView, Edge edge)
|
||||
{
|
||||
List<GraphConnection> connections = new List<GraphConnection>();
|
||||
|
||||
foreach (var conn in window.asset.Connections)
|
||||
{
|
||||
if (conn.internalEdge == edge)
|
||||
{
|
||||
connections.Add(conn);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var VARIABLE in connections)
|
||||
{
|
||||
window.asset.Connections.Remove(VARIABLE);
|
||||
}
|
||||
|
||||
|
||||
this.m_EdgesToCreate.Clear();
|
||||
this.m_EdgesToCreate.Add(edge);
|
||||
this.m_EdgesToDelete.Clear();
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Experimental.GraphView;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEngine;
|
||||
@ -22,8 +21,6 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
|
||||
private ImageProcessingGraphViewWindow window;
|
||||
|
||||
private StyleSheet errorStyleSheet;
|
||||
|
||||
public ImageProcessingGraphNodeVisual(BaseImageNode node, ImageProcessingGraphViewWindow window)
|
||||
{
|
||||
this.AddToClassList("image-node-visual");
|
||||
@ -65,27 +62,9 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
CreateInputPorts(inputFieldInfo);
|
||||
CreateOutputPorts(outputFieldInfo);
|
||||
|
||||
errorStyleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Unity Image Processing/Node.uss");
|
||||
if (errorStyleSheet == null)
|
||||
{
|
||||
errorStyleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/Node.uss") as StyleSheet;
|
||||
}
|
||||
|
||||
graphNode.onFailed += () =>
|
||||
{
|
||||
styleSheets.Add(errorStyleSheet);
|
||||
};
|
||||
|
||||
window.asset.OnRun += () =>
|
||||
{
|
||||
if (styleSheets.Contains(errorStyleSheet))
|
||||
styleSheets.Remove(errorStyleSheet);
|
||||
};
|
||||
|
||||
|
||||
this.name = typeInfo.Name;
|
||||
}
|
||||
@ -95,6 +74,10 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
for (var index = 0; index < fields.Count; index++)
|
||||
{
|
||||
var field = fields[index];
|
||||
/*
|
||||
Port port = InstantiatePort(Orientation.Horizontal, Direction.Input, Port.Capacity.Multi, field.FieldType);
|
||||
*/
|
||||
|
||||
var port = IPTPort.Create(window.edgeConnectorListener, true, field.FieldType);
|
||||
|
||||
string label = field.GetCustomAttribute<Input>().Label;
|
||||
@ -104,8 +87,7 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
|
||||
inputContainer.Add(port);
|
||||
ExposeVariableToPort(port, field);
|
||||
port.fieldInfo = field;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,14 +102,13 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
if (label != "")
|
||||
port.portName = label;
|
||||
OutputPorts.Add(port);
|
||||
|
||||
outputContainer.Add(port);
|
||||
|
||||
port.fieldInfo = field;
|
||||
}
|
||||
}
|
||||
|
||||
// Exposes a variable on the port for editing when it's not connected
|
||||
public void ExposeVariableToPort(Port port, FieldInfo field)
|
||||
private void ExposeVariableToPort(Port port, FieldInfo field)
|
||||
{
|
||||
// Only expose when the port is not connected
|
||||
if (port.connections.Count() == 0)
|
||||
@ -139,9 +120,8 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
if (propertyField != null)
|
||||
{
|
||||
// Register a callback for when the value changes
|
||||
if (propertyField.GetType() == typeof(IntegerField))
|
||||
if (propertyField is IntegerField intField)
|
||||
{
|
||||
var intField = propertyField as IntegerField;
|
||||
intField.RegisterValueChangedCallback(evt =>
|
||||
{
|
||||
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
|
||||
@ -196,28 +176,6 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
|
||||
});
|
||||
}
|
||||
else if (propertyField is EnumField enumField)
|
||||
{
|
||||
enumField.RegisterValueChangedCallback(evt =>
|
||||
{
|
||||
field.SetValue(graphNode, evt.newValue); // 🎯 Update the field with the new enum value
|
||||
});
|
||||
}
|
||||
else if (propertyField.GetType() == typeof(GreyscaleField))
|
||||
{
|
||||
var greyscaleField = propertyField as GreyscaleField;
|
||||
greyscaleField.RegisterValueChangedCallback(evt =>
|
||||
{
|
||||
var value = (GreyscaleValue)field.GetValue(graphNode);
|
||||
|
||||
if(evt.newValue > greyscaleField.minMax.Item2)
|
||||
value.value = greyscaleField.minMax.Item2;
|
||||
else if(evt.newValue < greyscaleField.minMax.Item1)
|
||||
value.value = greyscaleField.minMax.Item1;
|
||||
|
||||
value.value = (int)evt.newValue;
|
||||
});
|
||||
}
|
||||
|
||||
propertyFieldContainer.Add(propertyField);
|
||||
port.Add(propertyFieldContainer);
|
||||
@ -226,13 +184,6 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
else
|
||||
{
|
||||
// If the port is connected, remove the exposed UI element
|
||||
List<VisualElement> children = new List<VisualElement>();
|
||||
|
||||
foreach (var child in port.Children())
|
||||
{
|
||||
children.Add(child);
|
||||
}
|
||||
|
||||
var existingPropertyFieldContainer = port.Q<VisualElement>("property-field-container");
|
||||
if (existingPropertyFieldContainer != null)
|
||||
{
|
||||
@ -241,6 +192,7 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
}
|
||||
}
|
||||
|
||||
// Create appropriate property field based on the type of the variable
|
||||
private VisualElement CreatePropertyFieldForType(Type type, object value)
|
||||
{
|
||||
if (type == typeof(int))
|
||||
@ -283,24 +235,11 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
||||
var objectField = new ObjectField { value = (Texture2D)value, objectType = typeof(Texture2D) };
|
||||
return objectField;
|
||||
}
|
||||
else if (type.IsEnum) // 💥✨ ENUMS, BABY! 💥✨
|
||||
{
|
||||
var enumField = new EnumField((Enum)value);
|
||||
return enumField;
|
||||
}
|
||||
else if (type == typeof(GreyscaleValue))
|
||||
{
|
||||
|
||||
var greyscaleValue = (GreyscaleValue)value;
|
||||
var intField = new GreyscaleField { value = (int)greyscaleValue.value };
|
||||
return intField;
|
||||
}
|
||||
|
||||
// Add more types as needed
|
||||
// Add more types as needed (Vector3, etc.)
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void SavePosition() => graphNode.SetPosition(GetPosition());
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ namespace ImageProcessingGraph.Editor
|
||||
internal ImageProcessingGraphAsset asset;
|
||||
private SerializedObject serializedObject;
|
||||
private ImageProcessingGraphEditorWindow window;
|
||||
|
||||
public ImageProcessingGraphEditorWindow Window => window;
|
||||
|
||||
public List<ImageProcessingGraphNodeVisual> graphNodes;
|
||||
@ -22,11 +23,6 @@ namespace ImageProcessingGraph.Editor
|
||||
|
||||
internal ImageProcessingGraphSearchProvider searchProvider;
|
||||
internal ImageProcessingGraphEdgeConnectorListener edgeConnectorListener;
|
||||
|
||||
private bool isDropdownEnabled = false;
|
||||
|
||||
private Button debugModeButton;
|
||||
private Button outputRunOrder;
|
||||
|
||||
public ImageProcessingGraphViewWindow(SerializedObject obeject, ImageProcessingGraphEditorWindow window)
|
||||
{
|
||||
@ -47,20 +43,17 @@ namespace ImageProcessingGraph.Editor
|
||||
this.window = window;
|
||||
|
||||
StyleSheet styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Unity Image Processing/GraphView.uss");
|
||||
if (styleSheet == null)
|
||||
{
|
||||
styleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/GraphView.uss") as StyleSheet;
|
||||
}
|
||||
styleSheets.Add(styleSheet);
|
||||
|
||||
GridBackground background = new GridBackground();
|
||||
|
||||
background.name = "Grid";
|
||||
|
||||
|
||||
Add(background);
|
||||
|
||||
background.SendToBack();
|
||||
|
||||
CreateButtons();
|
||||
|
||||
|
||||
|
||||
this.AddManipulator(new ContentDragger());
|
||||
this.AddManipulator(new SelectionDragger());
|
||||
this.AddManipulator(new RectangleSelector());
|
||||
@ -73,108 +66,7 @@ namespace ImageProcessingGraph.Editor
|
||||
graphViewChanged += OnGraphViewChanged;
|
||||
Undo.undoRedoEvent += UndoEvent;
|
||||
}
|
||||
|
||||
private void CreateButtons()
|
||||
{
|
||||
#region Run Button
|
||||
Button runButton = new Button
|
||||
{
|
||||
text = "Run",
|
||||
style =
|
||||
{
|
||||
width = 100,
|
||||
height = 40,
|
||||
position = Position.Absolute,
|
||||
top = 10,
|
||||
left = 10
|
||||
}
|
||||
};
|
||||
|
||||
runButton.clicked += () =>
|
||||
{
|
||||
asset.RunGraph();
|
||||
};
|
||||
|
||||
Add(runButton);
|
||||
#endregion
|
||||
|
||||
#if false
|
||||
debugModeButton = new Button
|
||||
{
|
||||
text = "Debug Mode",
|
||||
style =
|
||||
{
|
||||
width = 120,
|
||||
height = 40,
|
||||
position = Position.Absolute,
|
||||
top = 55,
|
||||
right = 10
|
||||
}
|
||||
};
|
||||
|
||||
debugModeButton.clicked += () =>
|
||||
{
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
outputRunOrder = new Button
|
||||
{
|
||||
text = "Recalculate Run Order",
|
||||
style =
|
||||
{
|
||||
width = 120,
|
||||
height = 40,
|
||||
position = Position.Absolute,
|
||||
top = 55,
|
||||
right = 10,
|
||||
fontSize = 9
|
||||
}
|
||||
};
|
||||
|
||||
outputRunOrder.clicked += () =>
|
||||
{
|
||||
asset.runOrder = asset.GetExecutionOrder(asset.Nodes, asset.Connections);
|
||||
};
|
||||
|
||||
|
||||
Button dropdownButton = new Button
|
||||
{
|
||||
text = "Options",
|
||||
style =
|
||||
{
|
||||
width = 120,
|
||||
height = 40,
|
||||
position = Position.Absolute,
|
||||
top = 10,
|
||||
right = 10
|
||||
}
|
||||
};
|
||||
|
||||
dropdownButton.clicked+= () =>
|
||||
{
|
||||
if (!isDropdownEnabled)
|
||||
{
|
||||
#if false
|
||||
Add(debugModeButton);
|
||||
#endif
|
||||
Add(outputRunOrder);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if false
|
||||
Remove(debugModeButton);
|
||||
#endif
|
||||
Remove(outputRunOrder);
|
||||
}
|
||||
|
||||
isDropdownEnabled = !isDropdownEnabled;
|
||||
};
|
||||
|
||||
|
||||
Add(dropdownButton);
|
||||
}
|
||||
|
||||
|
||||
private ImageProcessingGraphNodeVisual GetNode(string NodeID)
|
||||
{
|
||||
ImageProcessingGraphNodeVisual node = null;
|
||||
@ -288,36 +180,17 @@ namespace ImageProcessingGraph.Editor
|
||||
string inputType = inputNode.GraphNode.GetType().Name;
|
||||
string outputType = outputNode.GraphNode.GetType().Name;
|
||||
|
||||
GraphConnection connection = new GraphConnection(inputNode.GraphNode.ID,inputIndex, inputType,outputNode.GraphNode.ID, outputIndex, outputType, edge);
|
||||
|
||||
edge.output.Connect(edge);
|
||||
edge.input.Connect(edge);
|
||||
|
||||
IPTPort portIn = (IPTPort)edge.output;
|
||||
IPTPort portOut = (IPTPort)edge.output;
|
||||
|
||||
if (portIn.fieldInfo != null)
|
||||
inputNode.ExposeVariableToPort(edge.input, portOut.fieldInfo);
|
||||
GraphConnection connection = new GraphConnection(inputNode.GraphNode.ID,inputIndex, inputType,outputNode.GraphNode.ID, outputIndex, outputType);
|
||||
|
||||
asset.Connections.Add(connection);
|
||||
}
|
||||
|
||||
private void RemoveEdge(Edge edge)
|
||||
private void RemoveEdge(Edge variable)
|
||||
{
|
||||
if (connectionDictionary.TryGetValue(edge, out GraphConnection connection))
|
||||
if (connectionDictionary.TryGetValue(variable, out GraphConnection connection))
|
||||
{
|
||||
asset.Connections.Remove(connection);
|
||||
connectionDictionary.Remove(edge);
|
||||
|
||||
edge.output.Disconnect(edge);
|
||||
edge.input.Disconnect(edge);
|
||||
|
||||
ImageProcessingGraphNodeVisual inputNode = (ImageProcessingGraphNodeVisual)edge.input.node;
|
||||
|
||||
IPTPort portIn = (IPTPort)edge.input;
|
||||
|
||||
if(portIn.fieldInfo != null)
|
||||
inputNode.ExposeVariableToPort(edge.input, portIn.fieldInfo);
|
||||
connectionDictionary.Remove(variable);
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,8 +211,6 @@ namespace ImageProcessingGraph.Editor
|
||||
Edge edge = inPort.ConnectTo(outPort);
|
||||
AddElement(edge);
|
||||
connectionDictionary.Add(edge, conn);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d053e80c499447499397a64b22ee639
|
||||
guid: a4036f11a5b3def48b6cf5e8b0654a54
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
18
Test Assets/New IPT_Preferences.asset
Normal file
18
Test Assets/New IPT_Preferences.asset
Normal file
@ -0,0 +1,18 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 80dcc02594d68e3439df7dc743c9d4b2, type: 3}
|
||||
m_Name: New IPT_Preferences
|
||||
m_EditorClassIdentifier:
|
||||
thickLines: 0
|
||||
spacing: 0
|
||||
gridBackgroundColour: {r: 0, g: 0, b: 0, a: 0}
|
||||
lineColour: {r: 0, g: 0, b: 0, a: 0}
|
8
Test Assets/New IPT_Preferences.asset.meta
Normal file
8
Test Assets/New IPT_Preferences.asset.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d4bfee84a7579474c8626fb17fcc299b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
658
Test Assets/New Shader Graph.shadergraph
Normal file
658
Test Assets/New Shader Graph.shadergraph
Normal file
@ -0,0 +1,658 @@
|
||||
{
|
||||
"m_SGVersion": 3,
|
||||
"m_Type": "UnityEditor.ShaderGraph.GraphData",
|
||||
"m_ObjectId": "a14387ccdc0e4230b24cf16376062b37",
|
||||
"m_Properties": [],
|
||||
"m_Keywords": [],
|
||||
"m_Dropdowns": [],
|
||||
"m_CategoryData": [
|
||||
{
|
||||
"m_Id": "71cd3153db9241d78583f494f3175e65"
|
||||
}
|
||||
],
|
||||
"m_Nodes": [
|
||||
{
|
||||
"m_Id": "0e3586066bf84a19b29835e8f00f18c8"
|
||||
},
|
||||
{
|
||||
"m_Id": "4a4c9b7678bf48649738dd347fbf691d"
|
||||
},
|
||||
{
|
||||
"m_Id": "6cc2f2b53819431db80cdc902c44b0a2"
|
||||
},
|
||||
{
|
||||
"m_Id": "170a5a0274d84f83b5b3409d7ebccc3c"
|
||||
},
|
||||
{
|
||||
"m_Id": "b6f01d1b41104807b982a044c5e1e005"
|
||||
},
|
||||
{
|
||||
"m_Id": "329dddc156c148b887205cd362845c53"
|
||||
},
|
||||
{
|
||||
"m_Id": "574823597594424bb34f730b62c44aef"
|
||||
},
|
||||
{
|
||||
"m_Id": "a77037c58c28419ba14f3220b7d8fbff"
|
||||
},
|
||||
{
|
||||
"m_Id": "265ae6dabc6f4c57bb9681736466b11f"
|
||||
}
|
||||
],
|
||||
"m_GroupDatas": [],
|
||||
"m_StickyNoteDatas": [],
|
||||
"m_Edges": [],
|
||||
"m_VertexContext": {
|
||||
"m_Position": {
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
},
|
||||
"m_Blocks": [
|
||||
{
|
||||
"m_Id": "0e3586066bf84a19b29835e8f00f18c8"
|
||||
},
|
||||
{
|
||||
"m_Id": "4a4c9b7678bf48649738dd347fbf691d"
|
||||
},
|
||||
{
|
||||
"m_Id": "6cc2f2b53819431db80cdc902c44b0a2"
|
||||
}
|
||||
]
|
||||
},
|
||||
"m_FragmentContext": {
|
||||
"m_Position": {
|
||||
"x": 0.0,
|
||||
"y": 200.0
|
||||
},
|
||||
"m_Blocks": [
|
||||
{
|
||||
"m_Id": "170a5a0274d84f83b5b3409d7ebccc3c"
|
||||
},
|
||||
{
|
||||
"m_Id": "b6f01d1b41104807b982a044c5e1e005"
|
||||
},
|
||||
{
|
||||
"m_Id": "329dddc156c148b887205cd362845c53"
|
||||
},
|
||||
{
|
||||
"m_Id": "574823597594424bb34f730b62c44aef"
|
||||
},
|
||||
{
|
||||
"m_Id": "a77037c58c28419ba14f3220b7d8fbff"
|
||||
},
|
||||
{
|
||||
"m_Id": "265ae6dabc6f4c57bb9681736466b11f"
|
||||
}
|
||||
]
|
||||
},
|
||||
"m_PreviewData": {
|
||||
"serializedMesh": {
|
||||
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
|
||||
"m_Guid": ""
|
||||
},
|
||||
"preventRotation": false
|
||||
},
|
||||
"m_Path": "Shader Graphs",
|
||||
"m_GraphPrecision": 1,
|
||||
"m_PreviewMode": 2,
|
||||
"m_OutputNode": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_SubDatas": [],
|
||||
"m_ActiveTargets": [
|
||||
{
|
||||
"m_Id": "7dffcc0f872e4798bc7d7c277c01ca46"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
|
||||
"m_ObjectId": "0000b8c7f15240e8a92c2c75a833f48f",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Base Color",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "BaseColor",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": {
|
||||
"x": 0.5,
|
||||
"y": 0.5,
|
||||
"z": 0.5
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.5,
|
||||
"y": 0.5,
|
||||
"z": 0.5
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_ColorMode": 0,
|
||||
"m_DefaultColor": {
|
||||
"r": 0.5,
|
||||
"g": 0.5,
|
||||
"b": 0.5,
|
||||
"a": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "0468751a1c344e38b0aec9b2b4467e38",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Smoothness",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Smoothness",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": 0.5,
|
||||
"m_DefaultValue": 0.5,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "0e3586066bf84a19b29835e8f00f18c8",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Position",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "8e9794e0177a4feebf5eb676d84fe1f3"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Position"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "0f43a512a2ae49f3959b2c0347ca55b2",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Ambient Occlusion",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Occlusion",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": 1.0,
|
||||
"m_DefaultValue": 1.0,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "170a5a0274d84f83b5b3409d7ebccc3c",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.BaseColor",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "0000b8c7f15240e8a92c2c75a833f48f"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 2,
|
||||
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget",
|
||||
"m_ObjectId": "1fe22ff03eb64399a2fd9c06b88eafa8",
|
||||
"m_WorkflowMode": 1,
|
||||
"m_NormalDropOffSpace": 0,
|
||||
"m_ClearCoat": false,
|
||||
"m_BlendModePreserveSpecular": true
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "265ae6dabc6f4c57bb9681736466b11f",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.Occlusion",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "0f43a512a2ae49f3959b2c0347ca55b2"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.Occlusion"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "329dddc156c148b887205cd362845c53",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.Metallic",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "bd184b28488f4573bef8c2af64be7436"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.Metallic"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
|
||||
"m_ObjectId": "32e096cd3bb849e7bb32f646989794db",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Tangent",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Tangent",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
|
||||
"m_ObjectId": "382845f601e84d2292ccb7886a370bcb",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Emission",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Emission",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_ColorMode": 1,
|
||||
"m_DefaultColor": {
|
||||
"r": 0.0,
|
||||
"g": 0.0,
|
||||
"b": 0.0,
|
||||
"a": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "4a4c9b7678bf48649738dd347fbf691d",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Normal",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "83dd0d2576664436bb795eba7ffb4883"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Normal"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "574823597594424bb34f730b62c44aef",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.Smoothness",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "0468751a1c344e38b0aec9b2b4467e38"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.Smoothness"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "6cc2f2b53819431db80cdc902c44b0a2",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Tangent",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "32e096cd3bb849e7bb32f646989794db"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Tangent"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
"m_ObjectId": "71cd3153db9241d78583f494f3175e65",
|
||||
"m_Name": "",
|
||||
"m_ChildObjectList": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
|
||||
"m_ObjectId": "7dffcc0f872e4798bc7d7c277c01ca46",
|
||||
"m_Datas": [],
|
||||
"m_ActiveSubTarget": {
|
||||
"m_Id": "1fe22ff03eb64399a2fd9c06b88eafa8"
|
||||
},
|
||||
"m_AllowMaterialOverride": false,
|
||||
"m_SurfaceType": 0,
|
||||
"m_ZTestMode": 4,
|
||||
"m_ZWriteControl": 0,
|
||||
"m_AlphaMode": 0,
|
||||
"m_RenderFace": 2,
|
||||
"m_AlphaClip": false,
|
||||
"m_CastShadows": true,
|
||||
"m_ReceiveShadows": true,
|
||||
"m_DisableTint": false,
|
||||
"m_AdditionalMotionVectorMode": 0,
|
||||
"m_AlembicMotionVectors": false,
|
||||
"m_SupportsLODCrossFade": false,
|
||||
"m_CustomEditorGUI": "",
|
||||
"m_SupportVFX": false
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
|
||||
"m_ObjectId": "83dd0d2576664436bb795eba7ffb4883",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Normal",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Normal",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
|
||||
"m_ObjectId": "8e9794e0177a4feebf5eb676d84fe1f3",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Position",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Position",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
|
||||
"m_ObjectId": "a72d7540c45d4b7e8a8d554f6274d745",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Normal (Tangent Space)",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "NormalTS",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 3
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "a77037c58c28419ba14f3220b7d8fbff",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.Emission",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "382845f601e84d2292ccb7886a370bcb"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.Emission"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "b6f01d1b41104807b982a044c5e1e005",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.NormalTS",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "a72d7540c45d4b7e8a8d554f6274d745"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.NormalTS"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "bd184b28488f4573bef8c2af64be7436",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Metallic",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Metallic",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": 0.0,
|
||||
"m_DefaultValue": 0.0,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
10
Test Assets/New Shader Graph.shadergraph.meta
Normal file
10
Test Assets/New Shader Graph.shadergraph.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c56761e16709479478032d95d74c0274
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
95
Test Assets/Test Graph One.asset
Normal file
95
Test Assets/Test Graph One.asset
Normal file
@ -0,0 +1,95 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1da462fd3f736d04e80556b4ac8b470f, type: 3}
|
||||
m_Name: Test Graph One
|
||||
m_EditorClassIdentifier:
|
||||
nodes:
|
||||
- rid: 6869590814762467392
|
||||
- rid: 6869590814762467393
|
||||
- rid: 6869590814762467394
|
||||
- rid: 6869590814762467395
|
||||
connections:
|
||||
- inputPort:
|
||||
nodeID: 64b814fe-8177-4620-9cf6-cacbe0b8ddd7
|
||||
nodeType: Texture2DDesaturate
|
||||
portID: 0
|
||||
outputPort:
|
||||
nodeID: b8924b16-c816-4168-8ee6-9ee30c6b63a9
|
||||
nodeType: Texture2DImport
|
||||
portID: 0
|
||||
- inputPort:
|
||||
nodeID: aa4b4ff2-61d6-4f84-a4ab-5b6b15c2ba97
|
||||
nodeType: Texture2DOutput
|
||||
portID: 0
|
||||
outputPort:
|
||||
nodeID: 64b814fe-8177-4620-9cf6-cacbe0b8ddd7
|
||||
nodeType: Texture2DDesaturate
|
||||
portID: 0
|
||||
references:
|
||||
version: 2
|
||||
RefIds:
|
||||
- rid: 6869590814762467392
|
||||
type: {class: Texture2DImport, ns: ImageProcessingGraph.Editor.Nodes.Import_Nodes, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: b8924b16-c816-4168-8ee6-9ee30c6b63a9
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: -1110
|
||||
y: 171.5
|
||||
width: 311
|
||||
height: 77
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Import_Nodes.Texture2DImport,
|
||||
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
textureImport: {fileID: 2800000, guid: 727a75301c3d24613a3ebcec4a24c2c8, type: 3}
|
||||
- rid: 6869590814762467393
|
||||
type: {class: Texture2DDesaturate, ns: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: 64b814fe-8177-4620-9cf6-cacbe0b8ddd7
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: -782
|
||||
y: 171.5
|
||||
width: 186
|
||||
height: 77
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture.Texture2DDesaturate,
|
||||
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
- rid: 6869590814762467394
|
||||
type: {class: Texture2DOutput, ns: ImageProcessingGraph.Editor.Nodes.Output, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: aa4b4ff2-61d6-4f84-a4ab-5b6b15c2ba97
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: -541
|
||||
y: 186
|
||||
width: 129.5
|
||||
height: 125
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Output.Texture2DOutput, ImageProcessingGraphEditor,
|
||||
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
fileName: test123432
|
||||
fileDirectory: Assets/
|
||||
- rid: 6869590814762467395
|
||||
type: {class: Texture2DImport, ns: ImageProcessingGraph.Editor.Nodes.Import_Nodes, asm: ImageProcessingGraphEditor}
|
||||
data:
|
||||
guid: 31f0135e-bc96-4c58-b808-210652f702bb
|
||||
position:
|
||||
serializedVersion: 2
|
||||
x: 152
|
||||
y: -9
|
||||
width: 311
|
||||
height: 77
|
||||
typeName: ImageProcessingGraph.Editor.Nodes.Import_Nodes.Texture2DImport,
|
||||
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
asset: {fileID: 11400000}
|
||||
textureImport: {fileID: 0}
|
8
Test Assets/Test Graph One.asset.meta
Normal file
8
Test Assets/Test Graph One.asset.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cef427fd668d96d47b164a934e97ba0d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "com.chromium.imageprocessingrah",
|
||||
"version": "0.0.0",
|
||||
"version": "6000.0.19f1",
|
||||
"displayName": "Image Processing Graph",
|
||||
"description": "Stuffs",
|
||||
"unity": "6000.0",
|
||||
"unity": "6000.0.19f1",
|
||||
"dependencies": {
|
||||
"com.unity.burst": "1.8.17"
|
||||
"com.unity.burst" : "1.8.17"
|
||||
},
|
||||
"author": {
|
||||
"name": "Sam Green",
|
||||
|
Loading…
x
Reference in New Issue
Block a user