浏览代码

Merge pull request #249 from Unity-Technologies/submodularize

Submodularize
/main
GitHub 6 年前
当前提交
286d82a6
共有 54 个文件被更改,包括 471 次插入1257 次删除
  1. 24
      .gitignore
  2. 4
      com.unity.shadergraph.meta
  3. 1001
      TestbedAssets/Rock_Pack_01/Rocks_Models/Rock_A_01.OBJ
  4. 4
      com.unity.shadergraph/Editor/Drawing/PreviewRate.cs.meta
  5. 21
      com.unity.shadergraph/Editor/Drawing/PreviewManager.cs
  6. 28
      com.unity.shadergraph/Editor/DefaultShaderIncludes.cs
  7. 3
      com.unity.shadergraph/Editor/Data/Util/ShaderGenerator.cs
  8. 76
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Filter/DitherNode.cs
  9. 4
      com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs.meta
  10. 4
      com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs.meta
  11. 278
      com.unity.shadergraph/Editor/Data/Graphs/DynamicValueMaterialSlot.cs
  12. 21
      Testing/Editor/IntegrationTests/ShaderGenerationTest.cs
  13. 7
      LICENSE.meta
  14. 7
      README.md.meta
  15. 8
      Testing.meta
  16. 7
      build.py.meta
  17. 8
      Testing/Editor.meta
  18. 8
      Testing/IntegrationTests.meta
  19. 8
      Testing/IntegrationTests/Graphs.meta
  20. 57
      Testing/IntegrationTests/Graphs/Add.ShaderGraph
  21. 7
      Testing/IntegrationTests/Graphs/Add.ShaderGraph.meta
  22. 8
      Testing/IntegrationTests/ShaderTemplates.meta
  23. 18
      Testing/IntegrationTests/ShaderTemplates/Add.ShaderGraph.png
  24. 83
      Testing/IntegrationTests/ShaderTemplates/Add.ShaderGraph.png.meta
  25. 0
      Testing/IntegrationTests/ShaderTemplates/Add.ShaderGraph.shader
  26. 9
      Testing/IntegrationTests/ShaderTemplates/Add.ShaderGraph.shader.meta
  27. 8
      .hgignore
  28. 0
      .gitmodules
  29. 8
      com.unity.shadergraph/Editor/Testing.meta
  30. 9
      Testing/Editor/IntegrationTests/Graphs.meta
  31. 0
      /com.unity.shadergraph.meta
  32. 0
      /TestbedAssets.meta
  33. 0
      /TestbedAssets
  34. 0
      /TestbedAssets/PartyPreview.ShaderGraph.meta
  35. 0
      /TestbedAssets/graphs_PartyPreview.mat
  36. 0
      /TestbedAssets/graphs_PartyPreview.mat.meta
  37. 0
      /TestbedAssets/PartyPreview.ShaderGraph
  38. 0
      /TestbedAssets/Beachball.ShaderGraph
  39. 0
      /TestbedAssets/Beachball.ShaderGraph.meta
  40. 0
      /TestbedAssets/LightweightAsset.asset
  41. 0
      /TestbedAssets/LightweightAsset.asset.meta
  42. 0
      /TestbedAssets/Oilish.ShaderGraph
  43. 0
      /TestbedAssets/Oilish.ShaderGraph.meta
  44. 0
      /TestbedAssets/Vector1PropGraph.ShaderGraph
  45. 0
      /TestbedAssets/Vector1PropGraph.ShaderGraph.meta
  46. 0
      /com.unity.shadergraph
  47. 0
      /Testing/Editor

24
.gitignore


artifacts/**
build/**
MaterialGraphProject/.vs
MaterialGraphProject/.vscode
MaterialGraphProject/Library
MaterialGraphProject/obj
MaterialGraphProject/MaterialGraphProject.CSharp.csproj
MaterialGraphProject/MaterialGraphProject.sln.DotSettings.user
*.csproj
MaterialGraphProject/MaterialGraphProject.sln
MaterialGraphProject/Temp
MaterialGraphProject/MaterialGraphProject.userprefs
MaterialGraphProject/.idea
MaterialGraphProject/Assets/Plugins*
.vs
.vscode
.idea
MaterialGraphProject/Assets/_MingWai/New Custom Texture.asset.meta
MaterialGraphProject/Packages/*
MaterialGraphProject/GeneratedShader.shader
MaterialGraphProject/UberShader.shader
!MaterialGraphProject/Packages/manifest.json
.npmrc
.npmrc
DebugOutput.meta
DebugOutput/**

4
com.unity.shadergraph.meta


fileFormatVersion: 2
guid: 0b601fe23f0347ab8e4892edf2cf76d7
fileFormatVersion: 2
guid: 0b601fe23f0347ab8e4892edf2cf76d7
timeCreated: 1513757926

1001
TestbedAssets/Rock_Pack_01/Rocks_Models/Rock_A_01.OBJ
文件差异内容过多而无法显示
查看文件

4
com.unity.shadergraph/Editor/Drawing/PreviewRate.cs.meta


fileFormatVersion: 2
guid: fa070520993a4b839e705dcd7f22e4d6
fileFormatVersion: 2
guid: fa070520993a4b839e705dcd7f22e4d6
timeCreated: 1506421104

21
com.unity.shadergraph/Editor/Drawing/PreviewManager.cs


var results = m_Graph.GetUberPreviewShader();
m_OutputIdName = results.outputIdProperty.referenceName;
ShaderUtil.UpdateShaderAsset(m_UberShader, results.shader);
#if UNITY_SHADER_GRAPH_DEVMODE
File.WriteAllText(Application.dataPath + "/../UberShader.shader", (results.shader ?? "null").Replace("UnityEngine.MaterialGraph", "Generated"));
#endif
var debugOutputPath = DefaultShaderIncludes.GetDebugOutputPath();
if (debugOutputPath != null)
File.WriteAllText(debugOutputPath + "/UberShader.shader", (results.shader ?? "null").Replace("UnityEngine.MaterialGraph", "Generated"));
bool uberShaderHasError = false;
if (MaterialGraphAsset.ShaderHasError(m_UberShader))
{

shaderData.shaderString = m_Graph.GetPreviewShader(node).shader;
}
#if UNITY_SHADER_GRAPH_DEVMODE
File.WriteAllText(Application.dataPath + "/../GeneratedShader.shader", (shaderData.shaderString ?? "null").Replace("UnityEngine.MaterialGraph", "Generated"));
#endif
var debugOutputPath = DefaultShaderIncludes.GetDebugOutputPath();
if (debugOutputPath != null)
File.WriteAllText(debugOutputPath + "/GeneratedShader.shader", (shaderData.shaderString ?? "null").Replace("UnityEngine.MaterialGraph", "Generated"));
if (string.IsNullOrEmpty(shaderData.shaderString))
{

}
// Debug output
#if UNITY_SHADER_GRAPH_DEVMODE
var message = "RecreateShader: " + node.GetVariableNameForNode() + Environment.NewLine + shaderData.shaderString;
#endif
Debug.LogWarning(message);
if (debugOutputPath != null)
{
var message = "RecreateShader: " + node.GetVariableNameForNode() + Environment.NewLine + shaderData.shaderString;
Debug.LogWarning(message);
}
ShaderUtil.ClearShaderErrors(shaderData.shader);
Object.DestroyImmediate(shaderData.shader, true);
shaderData.shader = null;

28
com.unity.shadergraph/Editor/DefaultShaderIncludes.cs


using System.IO;
using System.Linq;
using UnityEngine;
public static string GetAssetsPackagePath()
{
var packageDirectories = Directory.GetDirectories(Application.dataPath, "com.unity.shadergraph", SearchOption.AllDirectories);
return packageDirectories.Length == 0 ? null : Path.GetFullPath(packageDirectories.First());
}
public static string GetRepositoryPath()
{
var path = GetAssetsPackagePath();
if (path == null)
return null;
return Path.GetFullPath(Directory.GetParent(path).ToString());
}
public static string GetDebugOutputPath()
{
var path = GetRepositoryPath();
if (path == null)
return null;
path = Path.Combine(path, "DebugOutput");
return Directory.Exists(path) ? path : null;
}
Path.GetFullPath("Assets/UnityShaderEditor"),
Path.GetFullPath("Packages/com.unity.shadergraph"),
GetAssetsPackagePath() ?? Path.GetFullPath("Packages/com.unity.shadergraph")
};
}
}

3
com.unity.shadergraph/Editor/Data/Util/ShaderGenerator.cs


var path = new List<string>
{
Application.dataPath,
"UnityShaderEditor",
"ShaderGraph",
"com.unity.shadergraph",
"Editor",
"Templates"
};

76
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Filter/DitherNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Artistic", "Filter", "Dither")]
public class DitherNode : CodeFunctionNode
{
public DitherNode()
{
name = "Dither";
UpdateNodeAfterDeserialization();
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Dither", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Dither(
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.ScreenPosition)] Vector2 ScreenPosition,
[Slot(2, Binding.None)] out DynamicDimensionVector Out)
{
return
@"
{
{precision}2 uv = ScreenPosition.xy * _ScreenParams.xy;
{precision} DITHER_THRESHOLDS[16] =
{
1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
};
uint index = (uint(uv.x) % 4) * 4 + uint(uv.y) % 4;
Out = In - DITHER_THRESHOLDS[index];
}";
}
}
using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Artistic", "Filter", "Dither")]
public class DitherNode : CodeFunctionNode
{
public DitherNode()
{
name = "Dither";
UpdateNodeAfterDeserialization();
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Dither", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Dither(
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.ScreenPosition)] Vector2 ScreenPosition,
[Slot(2, Binding.None)] out DynamicDimensionVector Out)
{
return
@"
{
{precision}2 uv = ScreenPosition.xy * _ScreenParams.xy;
{precision} DITHER_THRESHOLDS[16] =
{
1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
};
uint index = (uint(uv.x) % 4) * 4 + uint(uv.y) % 4;
Out = In - DITHER_THRESHOLDS[index];
}";
}
}
}

4
com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs.meta


fileFormatVersion: 2
guid: ebeb3a21d05d49caa5d3318fb49b7612
fileFormatVersion: 2
guid: ebeb3a21d05d49caa5d3318fb49b7612
timeCreated: 1509276977

4
com.unity.shadergraph/Editor/Data/Graphs/SpaceMaterialSlot.cs.meta


fileFormatVersion: 2
guid: 66199806246c45e493afdfc09208cbdc
fileFormatVersion: 2
guid: 66199806246c45e493afdfc09208cbdc
timeCreated: 1509290088

278
com.unity.shadergraph/Editor/Data/Graphs/DynamicValueMaterialSlot.cs


using System;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEngine;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph
{
[Serializable]
public class DynamicValueMaterialSlot : MaterialSlot, IMaterialSlotHasValue<Matrix4x4>
{
[SerializeField]
private Matrix4x4 m_Value;
[SerializeField]
private Matrix4x4 m_DefaultValue;
private ConcreteSlotValueType m_ConcreteValueType = ConcreteSlotValueType.Vector4;
public DynamicValueMaterialSlot()
{
}
public DynamicValueMaterialSlot(
int slotId,
string displayName,
string shaderOutputName,
SlotType slotType,
Matrix4x4 value,
ShaderStage shaderStage = ShaderStage.Dynamic,
bool hidden = false)
: base(slotId, displayName, shaderOutputName, slotType, shaderStage, hidden)
{
m_Value = value;
}
public Matrix4x4 defaultValue { get { return m_DefaultValue; } }
public Matrix4x4 value
{
get { return m_Value; }
set { m_Value = value; }
}
public override VisualElement InstantiateControl()
{
int components =
concreteValueType == ConcreteSlotValueType.Vector4 ? 4 :
concreteValueType == ConcreteSlotValueType.Vector3 ? 3 :
concreteValueType == ConcreteSlotValueType.Vector2 ? 2 :
concreteValueType == ConcreteSlotValueType.Vector1 ? 1 : 0;
return new MultiFloatSlotControlView(owner, components, () => value.GetRow(0), (newValue) => value = new Matrix4x4(newValue, value.GetRow(1), value.GetRow(2), value.GetRow(3)));
}
public override SlotValueType valueType { get { return SlotValueType.Dynamic; } }
public override ConcreteSlotValueType concreteValueType
{
get { return m_ConcreteValueType; }
}
public void SetConcreteType(ConcreteSlotValueType valueType)
{
m_ConcreteValueType = valueType;
}
public override PreviewProperty GetPreviewProperty(string name)
{
var propType = ConvertConcreteSlotValueTypeToPropertyType(concreteValueType);
var pp = new PreviewProperty(propType) { name = name };
if (propType == PropertyType.Vector1)
pp.floatValue = value.m00;
else
pp.vector4Value = new Vector4(value.m00, value.m01, value.m02, value.m03);
return pp;
}
protected override string ConcreteSlotValueAsVariable(AbstractMaterialNode.OutputPrecision precision)
{
var channelCount = SlotValueHelper.GetChannelCount(concreteValueType);
string values = NodeUtils.FloatToShaderValue(value.m00);
if (channelCount == 1)
return values;
for (var i = 1; i < channelCount; i++)
values += ", " + value.GetRow(0)[i];
return string.Format("{0}{1}({2})", precision, channelCount, values);
}
public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode)
{
if (!generationMode.IsPreview())
return;
var matOwner = owner as AbstractMaterialNode;
if (matOwner == null)
throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode)));
IShaderProperty property;
switch (concreteValueType)
{
case ConcreteSlotValueType.Vector4:
property = new Vector4ShaderProperty();
break;
case ConcreteSlotValueType.Vector3:
property = new Vector3ShaderProperty();
break;
case ConcreteSlotValueType.Vector2:
property = new Vector2ShaderProperty();
break;
case ConcreteSlotValueType.Vector1:
property = new Vector1ShaderProperty();
break;
case ConcreteSlotValueType.Matrix4:
property = new Matrix4ShaderProperty();
break;
case ConcreteSlotValueType.Matrix3:
property = new Matrix3ShaderProperty();
break;
case ConcreteSlotValueType.Matrix2:
property = new Matrix2ShaderProperty();
break;
default:
throw new ArgumentOutOfRangeException();
}
property.overrideReferenceName = matOwner.GetVariableNameForSlot(id);
property.generatePropertyBlock = false;
properties.AddShaderProperty(property);
}
public override void CopyValuesFrom(MaterialSlot foundSlot)
{
var slot = foundSlot as DynamicValueMaterialSlot;
if (slot != null)
value = slot.value;
}
}
}
using System;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEngine;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph
{
[Serializable]
public class DynamicValueMaterialSlot : MaterialSlot, IMaterialSlotHasValue<Matrix4x4>
{
[SerializeField]
private Matrix4x4 m_Value;
[SerializeField]
private Matrix4x4 m_DefaultValue;
private ConcreteSlotValueType m_ConcreteValueType = ConcreteSlotValueType.Vector4;
public DynamicValueMaterialSlot()
{
}
public DynamicValueMaterialSlot(
int slotId,
string displayName,
string shaderOutputName,
SlotType slotType,
Matrix4x4 value,
ShaderStage shaderStage = ShaderStage.Dynamic,
bool hidden = false)
: base(slotId, displayName, shaderOutputName, slotType, shaderStage, hidden)
{
m_Value = value;
}
public Matrix4x4 defaultValue { get { return m_DefaultValue; } }
public Matrix4x4 value
{
get { return m_Value; }
set { m_Value = value; }
}
public override VisualElement InstantiateControl()
{
int components =
concreteValueType == ConcreteSlotValueType.Vector4 ? 4 :
concreteValueType == ConcreteSlotValueType.Vector3 ? 3 :
concreteValueType == ConcreteSlotValueType.Vector2 ? 2 :
concreteValueType == ConcreteSlotValueType.Vector1 ? 1 : 0;
return new MultiFloatSlotControlView(owner, components, () => value.GetRow(0), (newValue) => value = new Matrix4x4(newValue, value.GetRow(1), value.GetRow(2), value.GetRow(3)));
}
public override SlotValueType valueType { get { return SlotValueType.Dynamic; } }
public override ConcreteSlotValueType concreteValueType
{
get { return m_ConcreteValueType; }
}
public void SetConcreteType(ConcreteSlotValueType valueType)
{
m_ConcreteValueType = valueType;
}
public override PreviewProperty GetPreviewProperty(string name)
{
var propType = ConvertConcreteSlotValueTypeToPropertyType(concreteValueType);
var pp = new PreviewProperty(propType) { name = name };
if (propType == PropertyType.Vector1)
pp.floatValue = value.m00;
else
pp.vector4Value = new Vector4(value.m00, value.m01, value.m02, value.m03);
return pp;
}
protected override string ConcreteSlotValueAsVariable(AbstractMaterialNode.OutputPrecision precision)
{
var channelCount = SlotValueHelper.GetChannelCount(concreteValueType);
string values = NodeUtils.FloatToShaderValue(value.m00);
if (channelCount == 1)
return values;
for (var i = 1; i < channelCount; i++)
values += ", " + value.GetRow(0)[i];
return string.Format("{0}{1}({2})", precision, channelCount, values);
}
public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode)
{
if (!generationMode.IsPreview())
return;
var matOwner = owner as AbstractMaterialNode;
if (matOwner == null)
throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode)));
IShaderProperty property;
switch (concreteValueType)
{
case ConcreteSlotValueType.Vector4:
property = new Vector4ShaderProperty();
break;
case ConcreteSlotValueType.Vector3:
property = new Vector3ShaderProperty();
break;
case ConcreteSlotValueType.Vector2:
property = new Vector2ShaderProperty();
break;
case ConcreteSlotValueType.Vector1:
property = new Vector1ShaderProperty();
break;
case ConcreteSlotValueType.Matrix4:
property = new Matrix4ShaderProperty();
break;
case ConcreteSlotValueType.Matrix3:
property = new Matrix3ShaderProperty();
break;
case ConcreteSlotValueType.Matrix2:
property = new Matrix2ShaderProperty();
break;
default:
throw new ArgumentOutOfRangeException();
}
property.overrideReferenceName = matOwner.GetVariableNameForSlot(id);
property.generatePropertyBlock = false;
properties.AddShaderProperty(property);
}
public override void CopyValuesFrom(MaterialSlot foundSlot)
{
var slot = foundSlot as DynamicValueMaterialSlot;
if (slot != null)
value = slot.value;
}
}
}

21
Testing/Editor/IntegrationTests/ShaderGenerationTest.cs


{
public class ShaderGenerationTest
{
private static readonly string[] s_Path =
{
"UnityShaderEditor",
"Editor",
"Testing",
"IntegrationTests",
"Graphs"
};
static readonly string s_Path = Path.Combine(Path.Combine(Path.Combine(DefaultShaderIncludes.GetRepositoryPath(), "Testing"), "IntegrationTests"), "Graphs");
public struct TestInfo
{

{
get
{
var absoluteGraphsPath = s_Path.Aggregate(Application.dataPath, Path.Combine);
var filePaths = Directory.GetFiles(absoluteGraphsPath).Select(x => new FileInfo(x))
var filePaths = Directory.GetFiles(s_Path).Select(x => new FileInfo(x))
.Where(x => x.Extension == ".ShaderGraph");
foreach (var p in filePaths)

public void ShaderGeneratorOutput(TestInfo testInfo)
{
var file = testInfo.info;
var prjRelativeGraphsPath = s_Path.Aggregate("Assets", Path.Combine);
var filePath = Path.Combine(prjRelativeGraphsPath, file.Name);
var filePath = Path.Combine(s_Path, file.Name);
var textGraph = File.ReadAllText(filePath, Encoding.UTF8);
var graph = JsonUtility.FromJson<ShaderGraph.MaterialGraph>(textGraph);

var shaderString = String.Empty;
//graph.masterNode.GetFullShader(GenerationMode.ForReals, Path.GetFileNameWithoutExtension(filePath), out configuredTextures);
var rootPath = Directory.GetParent(Directory.GetParent(Application.dataPath).ToString());
var shaderTemplatePath = Path.Combine(rootPath.ToString(), "ShaderTemplates");
var rootPath = Path.Combine(Path.Combine(DefaultShaderIncludes.GetRepositoryPath(), "Testing"), "IntegrationTests");
var shaderTemplatePath = Path.Combine(rootPath, "ShaderTemplates");
Directory.CreateDirectory(shaderTemplatePath);
var textTemplateFilePath = Path.Combine(shaderTemplatePath, string.Format("{0}.{1}", file.Name, "shader"));

if (0 != textsAreEqual)
{
var failedPath = Path.Combine(rootPath.ToString(), "Failed");
var failedPath = Path.Combine(rootPath, "Failed");
Directory.CreateDirectory(failedPath);
var misMatchLocationResult = Path.Combine(failedPath, string.Format("{0}.{1}", file.Name, "shader"));
var misMatchLocationTemplate = Path.Combine(failedPath, string.Format("{0}.template.{1}", file.Name, "shader"));

7
LICENSE.meta


fileFormatVersion: 2
guid: ccd80e6f5d1fa7e4dbe10a0163abd393
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
README.md.meta


fileFormatVersion: 2
guid: 08534868baca5cc4092711da8c94e981
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Testing.meta


fileFormatVersion: 2
guid: 0191f2183190488449b2ef17660f2593
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
build.py.meta


fileFormatVersion: 2
guid: 7b1a0d0e4b2baea45969a56eca979c72
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Testing/Editor.meta


fileFormatVersion: 2
guid: 5ec6bb6cbe5f7d64fafc86c030ea8684
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Testing/IntegrationTests.meta


fileFormatVersion: 2
guid: 48e4573d1f98ead4d9519560b321f962
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Testing/IntegrationTests/Graphs.meta


fileFormatVersion: 2
guid: b6a29d9d3fa10ca4dbc83d847ef342ee
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

57
Testing/IntegrationTests/Graphs/Add.ShaderGraph


{
"m_SerializedProperties": [],
"m_GUID": {
"m_GuidSerialized": "17176d7a-f8ae-444e-b467-368306d9740e"
},
"m_SerializableNodes": [
{
"typeInfo": {
"fullName": "UnityEditor.ShaderGraph.UnlitMasterNode"
},
"JSONnodeData": "{\n \"m_GuidSerialized\": \"d6f5f404-9428-4ff8-8bac-c3aad434ee94\",\n \"m_Name\": \"Unlit Master\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 0.0,\n \"y\": 0.0,\n \"width\": 0.0,\n \"height\": 0.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ColorRGBMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Color\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Color\\\",\\n \\\"m_ShaderStage\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.5,\\n \\\"y\\\": 0.5,\\n \\\"z\\\": 0.5\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"Alpha\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Alpha\\\",\\n \\\"m_ShaderStage\\\": 2,\\n \\\"m_Value\\\": 1.0,\\n \\\"m_DefaultValue\\\": 1.0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 8,\\n \\\"m_DisplayName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_ShaderStage\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_SerializableSubShaders\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.LightWeightUnlitSubShader\"\n },\n \"JSONnodeData\": \"{}\"\n }\n ],\n \"m_AlphaMode\": 0\n}"
},
{
"typeInfo": {
"fullName": "UnityEditor.ShaderGraph.AddNode"
},
"JSONnodeData": "{\n \"m_GuidSerialized\": \"3d7cb8e2-9a91-47ae-980c-60f5d74b1f29\",\n \"m_Name\": \"Add\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -359.5,\n \"y\": 1.0,\n \"width\": 208.0,\n \"height\": 302.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}"
},
{
"typeInfo": {
"fullName": "UnityEditor.ShaderGraph.Vector2Node"
},
"JSONnodeData": "{\n \"m_GuidSerialized\": \"371aea6f-8280-4d19-8182-006228b43fb1\",\n \"m_Name\": \"Vector 2\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -532.5,\n \"y\": -28.0,\n \"width\": 104.0,\n \"height\": 114.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_Value\": {\n \"x\": 0.20000000298023225,\n \"y\": 0.4000000059604645\n }\n}"
},
{
"typeInfo": {
"fullName": "UnityEditor.ShaderGraph.Vector4Node"
},
"JSONnodeData": "{\n \"m_GuidSerialized\": \"d33350e2-ae0f-43c2-8639-55adc4252c52\",\n \"m_Name\": \"Vector 4\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -615.5,\n \"y\": 89.0,\n \"width\": 188.0,\n \"height\": 114.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_ShaderStage\\\": 0,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_Value\": {\n \"x\": 0.6000000238418579,\n \"y\": 0.5,\n \"z\": 0.699999988079071,\n \"w\": 1.0\n }\n}"
}
],
"m_SerializableEdges": [
{
"typeInfo": {
"fullName": "UnityEditor.Graphing.Edge"
},
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"3d7cb8e2-9a91-47ae-980c-60f5d74b1f29\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"d6f5f404-9428-4ff8-8bac-c3aad434ee94\"\n }\n}"
},
{
"typeInfo": {
"fullName": "UnityEditor.Graphing.Edge"
},
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"371aea6f-8280-4d19-8182-006228b43fb1\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"3d7cb8e2-9a91-47ae-980c-60f5d74b1f29\"\n }\n}"
},
{
"typeInfo": {
"fullName": "UnityEditor.Graphing.Edge"
},
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"d33350e2-ae0f-43c2-8639-55adc4252c52\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"3d7cb8e2-9a91-47ae-980c-60f5d74b1f29\"\n }\n}"
}
],
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": ""
}
}
}

7
Testing/IntegrationTests/Graphs/Add.ShaderGraph.meta


fileFormatVersion: 2
guid: 5afb17f32b499314c8744c5ee1859a0d
ScriptedImporter:
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

8
Testing/IntegrationTests/ShaderTemplates.meta


fileFormatVersion: 2
guid: 40e60e40cb434cf4d8154cf5a15b424e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

18
Testing/IntegrationTests/ShaderTemplates/Add.ShaderGraph.png

之前 之后
宽度: 256  |  高度: 256  |  大小: 3.8 KiB

83
Testing/IntegrationTests/ShaderTemplates/Add.ShaderGraph.png.meta


fileFormatVersion: 2
guid: fb9b3c4c65118764aba1c1aa90df4b56
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

0
Testing/IntegrationTests/ShaderTemplates/Add.ShaderGraph.shader

9
Testing/IntegrationTests/ShaderTemplates/Add.ShaderGraph.shader.meta


fileFormatVersion: 2
guid: 77af32e86de29534d8a9e7f227a27569
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

8
.hgignore


syntax: glob
UnityProject/Library
UnityProject/Temp
UnityProject/obj
UnityProject/UnityProject.v12.suo
UnityProject/UnityProject.sln
UnityProject/Assembly-CSharp-Editor.csproj
UnityProject/Assembly-CSharp.csproj

0
.gitmodules

8
com.unity.shadergraph/Editor/Testing.meta


fileFormatVersion: 2
guid: 5cc649b733bac14459d4d140e18650fa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

9
Testing/Editor/IntegrationTests/Graphs.meta


fileFormatVersion: 2
guid: 30d7777d261724f478e42c8507d11c78
folderAsset: yes
timeCreated: 1454665112
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

/MaterialGraphProject/Assets/UnityShaderEditor.meta → /com.unity.shadergraph.meta

/MaterialGraphProject/Assets/TestAssets.meta → /TestbedAssets.meta

/MaterialGraphProject/Assets/TestAssets → /TestbedAssets

/MaterialGraphProject/Assets/PartyPreview.ShaderGraph.meta → /TestbedAssets/PartyPreview.ShaderGraph.meta

/MaterialGraphProject/Assets/graphs_PartyPreview.mat → /TestbedAssets/graphs_PartyPreview.mat

/MaterialGraphProject/Assets/graphs_PartyPreview.mat.meta → /TestbedAssets/graphs_PartyPreview.mat.meta

/MaterialGraphProject/Assets/PartyPreview.ShaderGraph → /TestbedAssets/PartyPreview.ShaderGraph

/MaterialGraphProject/Assets/Beachball.ShaderGraph → /TestbedAssets/Beachball.ShaderGraph

/MaterialGraphProject/Assets/Beachball.ShaderGraph.meta → /TestbedAssets/Beachball.ShaderGraph.meta

/MaterialGraphProject/Assets/LightweightAsset.asset → /TestbedAssets/LightweightAsset.asset

/MaterialGraphProject/Assets/LightweightAsset.asset.meta → /TestbedAssets/LightweightAsset.asset.meta

/MaterialGraphProject/Assets/Oilish.ShaderGraph → /TestbedAssets/Oilish.ShaderGraph

/MaterialGraphProject/Assets/Oilish.ShaderGraph.meta → /TestbedAssets/Oilish.ShaderGraph.meta

/MaterialGraphProject/Assets/Vector1PropGraph.ShaderGraph → /TestbedAssets/Vector1PropGraph.ShaderGraph

/MaterialGraphProject/Assets/Vector1PropGraph.ShaderGraph.meta → /TestbedAssets/Vector1PropGraph.ShaderGraph.meta

/MaterialGraphProject/Assets/UnityShaderEditor → /com.unity.shadergraph

/com.unity.shadergraph/Editor/Testing → /Testing/Editor

正在加载...
取消
保存