diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/IntegerHashNode.cs b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/IntegerHashNode.cs new file mode 100644 index 00000000000..264e836aea5 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/IntegerHashNode.cs @@ -0,0 +1,129 @@ +using System.Reflection; +using UnityEditor.Graphing; +using UnityEditor.ShaderGraph.Drawing.Controls; +using UnityEngine; + +namespace UnityEditor.ShaderGraph +{ + [Title("Procedural", "Noise", "Integer Hash")] + class IntegerHashNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction + { + public IntegerHashNode() + { + name = "Integer Hash"; + UpdateNodeAfterDeserialization(); + } + + public override bool hasPreview { get { return true; } } + + // Input slots + private const int kInputSlotId = 1; + private const string kInputSlotName = "Coord"; + + // Output slots + private const int kOutputSlotId = 0; + private const string kOutputSlotName = "Hash"; + + // Local state + public enum HashType + { + Tchou_2_1, + Tchou_2_3, + Tchou_3_1, + Tchou_3_3, + }; + + struct Description + { + public string functionName; + public int inputDimension; + public int outputDimension; + public Description(string f, int i, int o) { functionName = f; inputDimension = i; outputDimension = o; } + }; + + static Description[] k_hashDescriptions = + { + new Description("Hash_Tchou_2_1_float", 2, 1), + new Description("Hash_Tchou_2_3_float", 2, 3), + new Description("Hash_Tchou_3_1_float", 3, 1), + new Description("Hash_Tchou_3_3_float", 3, 3), + }; + + [SerializeField] + private HashType m_HashType = HashType.Tchou_2_3; + + [EnumControl("Hash")] + public HashType hashType + { + get + { + return m_HashType; + } + set + { + if (m_HashType == value) + return; + + m_HashType = value; + Dirty(ModificationScope.Topological); + UpdateNodeAfterDeserialization(); + } + } + + Description hashDescription => ((int) hashType >= 0 && (int) hashType < k_hashDescriptions.Length) ? k_hashDescriptions[(int)hashType] : k_hashDescriptions[0]; + + public MaterialSlot CreateVectorSlot(int dimension, int id, string name, SlotType slotType, Vector4 value = default) + { + MaterialSlot slot = null; + switch (dimension) + { + case 1: + slot = new Vector1MaterialSlot(id, name, name, slotType, value.x); + break; + case 2: + slot = new Vector2MaterialSlot(id, name, name, slotType, value); + break; + case 3: + slot = new Vector3MaterialSlot(id, name, name, slotType, value); + break; + case 4: + slot = new Vector4MaterialSlot(id, name, name, slotType, value); + break; + } + return slot; + } + + public sealed override void UpdateNodeAfterDeserialization() + { + var desc = hashDescription; + + MaterialSlot inputSlot = CreateVectorSlot(desc.inputDimension, kInputSlotId, kInputSlotName, SlotType.Input); + AddSlot(inputSlot); + + MaterialSlot outputSlot = CreateVectorSlot(desc.outputDimension, kOutputSlotId, kOutputSlotName, SlotType.Output); + AddSlot(outputSlot); + + RemoveSlotsNameNotMatching(new[] + { + kInputSlotId, + kOutputSlotId + }); + } + + public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode generationMode) + { + registry.RequiresIncludePath("Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl"); + } + + public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) + { + var desc = hashDescription; + + var outputVar = GetVariableNameForSlot(kOutputSlotId); + var input = GetSlotValue(kInputSlotId, generationMode); + + sb.AppendLine($"$precision{desc.outputDimension} {outputVar};"); + sb.AppendLine($"{desc.functionName}({input}, {outputVar});"); + } + } +} diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/IntegerHashNode.cs.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/IntegerHashNode.cs.meta new file mode 100644 index 00000000000..7d8777ebb4f --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/IntegerHashNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e795eefbcbdb5a469a2f0aa1520fa9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/OldTransformNode.cs b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/OldTransformNode.cs new file mode 100644 index 00000000000..7aa76dd5108 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/OldTransformNode.cs @@ -0,0 +1,274 @@ +using System; +using UnityEditor.Graphing; +using UnityEditor.ShaderGraph.Drawing.Controls; +using UnityEditor.ShaderGraph.Internal; +using UnityEngine; + +namespace UnityEditor.ShaderGraph +{ + [Title("Math", "Vector", "OldTransform")] + class OldTransformNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireTangent, IMayRequireBitangent, IMayRequireNormal, IMayRequireTransform + { + public override int latestVersion => 1; + + private const int InputSlotId = 0; + private const int OutputSlotId = 1; + private const string kInputSlotName = "In"; + private const string kOutputSlotName = "Out"; + + public OldTransformNode() + { + name = "OldTransform"; + synonyms = new string[] { "world", "tangent", "object", "view", "screen", "convert" }; + UpdateNodeAfterDeserialization(); + } + + [SerializeField] + CoordinateSpaceConversion m_Conversion = new CoordinateSpaceConversion(CoordinateSpace.Object, CoordinateSpace.World); + + [EnumConversionControl] + public CoordinateSpaceConversion conversion + { + get { return m_Conversion; } + set + { + if (Equals(m_Conversion, value)) + return; + m_Conversion = value; + Dirty(ModificationScope.Graph); + } + } + + [SerializeField] + public ConversionType m_ConversionType = ConversionType.Position; + + [EnumControl("Type")] + public ConversionType conversionType + { + get { return m_ConversionType; } + set + { + if (Equals(m_ConversionType, value)) + return; + m_ConversionType = value; + Dirty(ModificationScope.Graph); + } + } + + public override bool hasPreview + { + get { return true; } + } + + public sealed override void UpdateNodeAfterDeserialization() + { + AddSlot(new Vector3MaterialSlot(InputSlotId, kInputSlotName, kInputSlotName, SlotType.Input, Vector3.zero)); + AddSlot(new Vector3MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector3.zero)); + RemoveSlotsNameNotMatching(new[] { InputSlotId, OutputSlotId }); + } + + public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) + { + NodeUtils.SlotConfigurationExceptionIfBadConfiguration(this, new[] { InputSlotId }, new[] { OutputSlotId }); + string inputValue = string.Format("{0}.xyz", GetSlotValue(InputSlotId, generationMode)); + string targetTransformString = GetVariableNameForNode() + "_tangentTransform_" + conversion.from.ToString(); + string transposeTargetTransformString = GetVariableNameForNode() + "_transposeTangent"; + string transformString = ""; + string tangentTransformSpace = conversion.from.ToString(); + bool requiresTangentTransform = false; + bool requiresTransposeTangentTransform = false; + + if (conversion.from == CoordinateSpace.World) + { + if (conversion.to == CoordinateSpace.World) + { + transformString = inputValue; + } + else if (conversion.to == CoordinateSpace.Object) + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToObjectDir({0})" : "TransformWorldToObject({0})", inputValue); + } + else if (conversion.to == CoordinateSpace.Tangent) + { + requiresTangentTransform = true; + transformString = string.Format("TransformWorldToTangent({0}, {1})", inputValue, targetTransformString); + } + else if (conversion.to == CoordinateSpace.View) + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir({0})" : "TransformWorldToView({0})", inputValue); + } + else if (conversion.to == CoordinateSpace.AbsoluteWorld) + { + transformString = string.Format("GetAbsolutePositionWS({0})", inputValue); + } + } + else if (conversion.from == CoordinateSpace.Object) + { + if (conversion.to == CoordinateSpace.World) + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformObjectToWorldDir({0})" : "TransformObjectToWorld({0})", inputValue); + } + else if (conversion.to == CoordinateSpace.Object) + { + transformString = inputValue; + } + else if (conversion.to == CoordinateSpace.Tangent) + { + requiresTangentTransform = true; + tangentTransformSpace = CoordinateSpace.World.ToString(); + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToTangent(TransformObjectToWorldDir({0}), {1})" : "TransformWorldToTangent(TransformObjectToWorld({0}), {1})", inputValue, targetTransformString); + } + else if (conversion.to == CoordinateSpace.View) + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir(TransformObjectToWorldDir({0}))" : "TransformWorldToView(TransformObjectToWorld({0}))", inputValue); + } + if (conversion.to == CoordinateSpace.AbsoluteWorld) + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformObjectToWorldDir({0})" : "GetAbsolutePositionWS(TransformObjectToWorld({0}))", inputValue); + } + } + else if (conversion.from == CoordinateSpace.Tangent) + { + if (conversion.to == CoordinateSpace.World) + { + requiresTransposeTangentTransform = true; + transformString = string.Format(conversionType == ConversionType.Direction ? "normalize(mul({0}, {1}).xyz)" : "mul({0}, {1}).xyz", transposeTargetTransformString, inputValue); + } + else if (conversion.to == CoordinateSpace.Object) + { + requiresTransposeTangentTransform = true; + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToObjectDir(mul({0}, {1}).xyz)" : "TransformWorldToObject(mul({0}, {1}).xyz)", transposeTargetTransformString, inputValue); + } + else if (conversion.to == CoordinateSpace.Tangent) + { + transformString = inputValue; + } + else if (conversion.to == CoordinateSpace.View) + { + requiresTransposeTangentTransform = true; + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir(mul({0}, {1}).xyz)" : "TransformWorldToView(mul({0}, {1}).xyz)", transposeTargetTransformString, inputValue); + } + if (conversion.to == CoordinateSpace.AbsoluteWorld) + { + requiresTransposeTangentTransform = true; + transformString = string.Format("GetAbsolutePositionWS(mul({0}, {1})).xyz", transposeTargetTransformString, inputValue); + } + } + else if (conversion.from == CoordinateSpace.View) + { + if (conversion.to == CoordinateSpace.World) + { + transformString = string.Format(conversionType == ConversionType.Direction ? + "mul(UNITY_MATRIX_I_V, $precision4({0}, 0)).xyz" : + "mul(UNITY_MATRIX_I_V, $precision4({0}, 1)).xyz", inputValue); + } + else if (conversion.to == CoordinateSpace.Object) + { + transformString = string.Format(conversionType == ConversionType.Direction ? + "TransformWorldToObjectDir(mul((float3x3)UNITY_MATRIX_I_V, {0}))" : + "TransformWorldToObject(mul(UNITY_MATRIX_I_V, $precision4({0}, 1) ).xyz)", inputValue); + } + else if (conversion.to == CoordinateSpace.Tangent) + { + requiresTangentTransform = true; + tangentTransformSpace = CoordinateSpace.World.ToString(); + transformString = string.Format("TransformWorldToTangent(mul(UNITY_MATRIX_I_V, $precision4({0}, 1) ).xyz, {1})", inputValue, targetTransformString); + } + else if (conversion.to == CoordinateSpace.View) + { + transformString = inputValue; + } + else if (conversion.to == CoordinateSpace.AbsoluteWorld) + { + transformString = string.Format("GetAbsolutePositionWS(mul(UNITY_MATRIX_I_V, $precision4({0}, 1))).xyz", inputValue); + } + } + else if (conversion.from == CoordinateSpace.AbsoluteWorld) + { + if (conversion.to == CoordinateSpace.World) + { + transformString = string.Format("GetCameraRelativePositionWS({0})", inputValue); + } + else if (conversion.to == CoordinateSpace.Object) + { + if (m_SGVersion == 0) + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToObjectDir(GetCameraRelativePositionWS({0}))" : "TransformWorldToObject(GetCameraRelativePositionWS({0}))", inputValue); + } + else + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToObjectDir({0})" : "TransformWorldToObject(GetCameraRelativePositionWS({0}))", inputValue); + } + } + else if (conversion.to == CoordinateSpace.Tangent) + { + requiresTangentTransform = true; + tangentTransformSpace = CoordinateSpace.World.ToString(); + transformString = string.Format("TransformWorldToTangent(GetCameraRelativePositionWS({0}), {1})", inputValue, targetTransformString); + } + else if (conversion.to == CoordinateSpace.View) + { + if (m_SGVersion == 0) + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir(GetCameraRelativePositionWS({0}))" : "TransformWorldToView(GetCameraRelativePositionWS({0}))", inputValue); + } + else + { + transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir({0})" : "TransformWorldToView(GetCameraRelativePositionWS({0}))", inputValue); + } + } + else if (conversion.to == CoordinateSpace.AbsoluteWorld) + { + transformString = inputValue; + } + } + if (requiresTransposeTangentTransform) + sb.AppendLine(string.Format("$precision3x3 {0} = transpose($precision3x3(IN.{1}SpaceTangent, IN.{1}SpaceBiTangent, IN.{1}SpaceNormal));", transposeTargetTransformString, CoordinateSpace.World.ToString())); + else if (requiresTangentTransform) + sb.AppendLine(string.Format("$precision3x3 {0} = $precision3x3(IN.{1}SpaceTangent, IN.{1}SpaceBiTangent, IN.{1}SpaceNormal);", targetTransformString, tangentTransformSpace)); + sb.AppendLine("{0} {1} = {2};", FindOutputSlot(OutputSlotId).concreteValueType.ToShaderString(), + GetVariableNameForSlot(OutputSlotId), + transformString); + } + + bool RequiresWorldSpaceTangentTransform() + { + if (conversion.from == CoordinateSpace.View && conversion.to == CoordinateSpace.Tangent + || conversion.from == CoordinateSpace.AbsoluteWorld + || conversion.from == CoordinateSpace.Object && conversion.to == CoordinateSpace.Tangent + || conversion.from == CoordinateSpace.Tangent) + return true; + else + return false; + } + + public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapability) + { + if (RequiresWorldSpaceTangentTransform()) + return NeededCoordinateSpace.World; + return conversion.from.ToNeededCoordinateSpace(); + } + + public NeededCoordinateSpace RequiresBitangent(ShaderStageCapability stageCapability) + { + if (RequiresWorldSpaceTangentTransform()) + return NeededCoordinateSpace.World; + return conversion.from.ToNeededCoordinateSpace(); + } + + public NeededCoordinateSpace RequiresNormal(ShaderStageCapability stageCapability) + { + if (RequiresWorldSpaceTangentTransform()) + return NeededCoordinateSpace.World; + return conversion.from.ToNeededCoordinateSpace(); + } + + public NeededTransform[] RequiresTransform(ShaderStageCapability stageCapability) + { + return new[] + { + new NeededTransform(conversion.from.ToNeededCoordinateSpace(), conversion.to.ToNeededCoordinateSpace()) + }; + } + } +} diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/OldTransformNode.cs.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/OldTransformNode.cs.meta new file mode 100644 index 00000000000..f9c4c3654d2 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/DebugNodes/OldTransformNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd41c312c74a0ac43b5dad99f9b98a9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/NodeTests.cs b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/NodeTests.cs new file mode 100644 index 00000000000..d082582c525 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/NodeTests.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using UnityEditor.ShaderGraph; +using UnityEditor.ShaderGraph.Internal; +using UnityEngine; +using UnityEngine.TestTools; +using UnityEngine.Experimental.Rendering; + +namespace UnityEditor.ShaderGraph.UnitTests +{ + class NodeTests : ShaderGraphTestRenderer + { + [UnityTest] + public IEnumerator NodeTestTest() + { + string graphPath = "Assets/CommonAssets/Graphs/NodeTests/NodeTestTest.shadergraph"; + var graph = LoadGraph(graphPath); + ResetTestReporting(); + var colorStrings = new string[] { "_COLOR_RED", "_COLOR_GREEN", "_COLOR_BLUE" }; + var colors = new Color32[] { new Color32(255, 0, 0, 255), new Color32(0, 255, 0, 255), new Color32(0, 0, 255, 255) }; + for (int i = 0; i < 3; i++) + { + RunNodeTest(graph, $"NodeTestTest_{colorStrings[i]}", + expectedColor: colors[i], + setupMaterial: m => m.EnableKeyword(colorStrings[i])); + } + ReportTests(); + yield break; + } + + [UnityTest] + public IEnumerator TransformV1MatchesOldTransform() + { + string graphPath = "Assets/CommonAssets/Graphs/NodeTests/TransformV1MatchesOldTransform.shadergraph"; + var graph = LoadGraph(graphPath); + + // first check that it renders red in the initial state, to check that the test works + // (graph is initially set up with non-matching transforms) + ResetTestReporting(); + RunNodeTest(graph, $"TransformV1_default", expectedIncorrectPixels: defaultResolution * defaultResolution); + ReportTests(); + + // now check all possible settings + ResetTestReporting(); + var xform = graph.GetNodes().First(); + var old = graph.GetNodes().First(); + + var oldConversionTypes = new ConversionType[] { ConversionType.Position, ConversionType.Direction }; + foreach (ConversionType conversionType in oldConversionTypes) + { + foreach (CoordinateSpace source in Enum.GetValues(typeof(CoordinateSpace))) + { + foreach (CoordinateSpace dest in Enum.GetValues(typeof(CoordinateSpace))) + { + // setup transform(v1) node + xform.conversion = new CoordinateSpaceConversion(source, dest); + xform.conversionType = conversionType; + xform.normalize = false; + + // setup old transform node + old.conversion = new CoordinateSpaceConversion(source, dest); + old.conversionType = conversionType; + + RunNodeTest(graph, $"TransformNodeOld_{source}_to_{dest}_{conversionType}"); + } + + // have to yield to let a frame pass or it will break + // (unity only releases some resources at the end of the frame) + yield return null; + } + } + ReportTests(); + } + + [UnityTest] + public IEnumerator TransformInverses() + { + // Test that A->B and B->A result in the original value + string graphPath = "Assets/CommonAssets/Graphs/NodeTests/TransformInverses.shadergraph"; + var graph = LoadGraph(graphPath); + ResetTestReporting(); + + // check all possible settings + var xforms = graph.GetNodes(); + var xform = xforms.First(); + var inv = xforms.Skip(1).First(); + foreach (ConversionType conversionType in Enum.GetValues(typeof(ConversionType))) + { + foreach (CoordinateSpace source in Enum.GetValues(typeof(CoordinateSpace))) + { + foreach (CoordinateSpace dest in Enum.GetValues(typeof(CoordinateSpace))) + { + // setup transform node + xform.conversion = new CoordinateSpaceConversion(source, dest); + xform.conversionType = conversionType; + xform.normalize = false; + + // setup inverse transform node + inv.conversion = new CoordinateSpaceConversion(dest, source); + inv.conversionType = conversionType; + inv.normalize = false; + + RunNodeTest(graph, $"TransformInverse_{source}_to_{dest}_{conversionType}"); + } + + // have to yield to let a frame pass or it will break + // (unity only releases some resources at the end of the frame) + yield return null; + } + } + ReportTests(); + } + + [UnityTest] + public IEnumerator TransformABC() + { + // Test that transforming from A->B then B->C is the same as A->C (for all A,B,C) + string graphPath = "Assets/CommonAssets/Graphs/NodeTests/TransformABC.shadergraph"; + var graph = LoadGraph(graphPath); + ResetTestReporting(); + + var xforms = graph.GetNodes(); + var A_to_C = xforms.FirstOrDefault(n => (n.conversion.from == CoordinateSpace.Object) && (n.conversion.to == CoordinateSpace.Tangent)); + var A_to_B = xforms.FirstOrDefault(n => (n.conversion.from == CoordinateSpace.Object) && (n.conversion.to == CoordinateSpace.View)); + var B_to_C = xforms.FirstOrDefault(n => (n.conversion.from == CoordinateSpace.View) && (n.conversion.to == CoordinateSpace.Tangent)); + + // check all possible settings + foreach (ConversionType conversionType in Enum.GetValues(typeof(ConversionType))) + { + foreach (CoordinateSpace A in Enum.GetValues(typeof(CoordinateSpace))) + { + foreach (CoordinateSpace B in Enum.GetValues(typeof(CoordinateSpace))) + { + foreach (CoordinateSpace C in Enum.GetValues(typeof(CoordinateSpace))) + { + // setup transforms + A_to_C.conversion = new CoordinateSpaceConversion(A, C); + A_to_C.conversionType = conversionType; + A_to_C.normalize = false; + + A_to_B.conversion = new CoordinateSpaceConversion(A, B); + A_to_B.conversionType = conversionType; + A_to_B.normalize = false; + + B_to_C.conversion = new CoordinateSpaceConversion(B, C); + B_to_C.conversionType = conversionType; + B_to_C.normalize = false; + + RunNodeTest(graph, $"TransformABC_{A}_{B}_{C}_{conversionType}"); + } + + // have to yield to let a frame pass or it will break + // (unity only releases some resources at the end of the frame) + yield return null; + } + } + } + ReportTests(); + } + + [UnityTest] + public IEnumerator TransformNormalize() + { + // Test that A->B then normalizing is the same as A->B with normalize enabled + // for all direction and normal conversion types + string graphPath = "Assets/CommonAssets/Graphs/NodeTests/TransformNormalize.shadergraph"; + var graph = LoadGraph(graphPath); + + // now check all possible settings + ResetTestReporting(); + var xforms = graph.GetNodes(); + var norm = xforms.FirstOrDefault(n => n.normalize); + var unnorm = xforms.FirstOrDefault(n => !n.normalize); + + var normalizeConversionTypes = new ConversionType[] { ConversionType.Direction, ConversionType.Normal }; + foreach (ConversionType conversionType in normalizeConversionTypes) + { + foreach (CoordinateSpace source in Enum.GetValues(typeof(CoordinateSpace))) + { + foreach (CoordinateSpace dest in Enum.GetValues(typeof(CoordinateSpace))) + { + // setup normalized transform + norm.conversion = new CoordinateSpaceConversion(source, dest); + norm.conversionType = conversionType; + + // setup unnormalized transform + unnorm.conversion = new CoordinateSpaceConversion(source, dest); + unnorm.conversionType = conversionType; + + RunNodeTest(graph, $"TransformNormalize_{source}_to_{dest}_{conversionType}"); + } + + // have to yield to let a frame pass or it will break + // (unity only releases some resources at the end of the frame) + yield return null; + } + } + ReportTests(); + } + } +} diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/NodeTests.cs.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/NodeTests.cs.meta new file mode 100644 index 00000000000..08aa4edfd50 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/NodeTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dae135db9c4e0e74da33ca86214bbab8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphGraphicsTestsEditor.asmdef b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphGraphicsTestsEditor.asmdef index dd5069f1737..664d3580a6d 100644 --- a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphGraphicsTestsEditor.asmdef +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphGraphicsTestsEditor.asmdef @@ -1,10 +1,12 @@ { "name": "Unity.ShaderGraph.Editor.GraphicsTests", + "rootNamespace": "", "references": [ "UnityEditor.TestTools.Graphics", "Unity.ShaderGraph.Editor", "UnityEngine.TestRunner", - "UnityEditor.TestRunner" + "UnityEditor.TestRunner", + "Unity.TestProtocol" ], "includePlatforms": [ "Editor" @@ -19,5 +21,6 @@ "defineConstraints": [ "UNITY_INCLUDE_TESTS" ], - "versionDefines": [] + "versionDefines": [], + "noEngineReferences": false } \ No newline at end of file diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphTestRenderer.cs b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphTestRenderer.cs new file mode 100644 index 00000000000..efd87611efd --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphTestRenderer.cs @@ -0,0 +1,244 @@ +using System; +using System.IO; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using UnityEditor.ShaderGraph; +using UnityEditor.ShaderGraph.Drawing; +using NUnit.Framework; + +public class ShaderGraphTestRenderer +{ + internal const int defaultResolution = 128; + + internal PreviewSceneResources previewScene = new PreviewSceneResources(); + + internal delegate void SetupMaterialDelegate(Material m); + + internal int wrongImageCount; + internal int mostWrongPixels; + internal string mostWrongString; + internal void ResetTestReporting() + { + wrongImageCount = 0; + mostWrongPixels = 0; + mostWrongString = string.Empty; + } + internal void ReportTests() + { + if (wrongImageCount > 0) + { + Assert.That(false, $"{wrongImageCount} images failed, worst was: {mostWrongString}"); + } + } + + internal GraphData LoadGraph(string graphPath) + { + List lti; + var assetCollection = new AssetCollection(); + ShaderGraphImporter.GetShaderText(graphPath, out lti, assetCollection, out var graph); + Assert.NotNull(graph, $"Invalid graph data found for {graphPath}"); + graph.OnEnable(); + graph.ValidateGraph(); + return graph; + } + + // we apply a transform to the test setup, so that the transform matrices are non-trivial + internal Vector3 testPosition = new Vector3(0.24699998f, 0.51900005f, 0.328999996f); + internal Quaternion testRotation = new Quaternion(-0.164710045f, -0.0826543793f, -0.220811233f, 0.957748055f); + + internal int RunNodeTest(GraphData graph, string filePrefix, SetupMaterialDelegate setupMaterial = null, Color32? expectedColor = null, int expectedIncorrectPixels = 0) + { + RenderTextureDescriptor descriptor = new RenderTextureDescriptor(defaultResolution, defaultResolution, GraphicsFormat.R8G8B8A8_SRGB, depthBufferBits: 32); + var target = RenderTexture.GetTemporary(descriptor); + + // use a non-standard transform, so that view, object, etc. transforms are non trivial + RenderQuadPreview(graph, target, testPosition, testRotation, setupMaterial, Mode.DIFF, useSRP: true); + + // default expected color is green (test shaders should be set up to return green on success) + int incorrectPixels = CountPixelsNotEqual(target, expectedColor ?? new Color32(0, 255, 0, 255), false); + + if (incorrectPixels != expectedIncorrectPixels) + { + // report images + SaveToPNG(target, $"test-results/NodeTests/{filePrefix}.diff.png"); + + RenderQuadPreview(graph, target, testPosition, testRotation, setupMaterial, Mode.EXPECTED, useSRP: true); + SaveToPNG(target, $"test-results/NodeTests/{filePrefix}.expected.png"); + + RenderQuadPreview(graph, target, testPosition, testRotation, setupMaterial, Mode.ACTUAL, useSRP: true); + SaveToPNG(target, $"test-results/NodeTests/{filePrefix}.png"); + + // record failure + wrongImageCount++; + int wrongPixels = Math.Abs(incorrectPixels - expectedIncorrectPixels); + if (wrongPixels > mostWrongPixels) + { + mostWrongPixels = wrongPixels; + mostWrongString = $"{filePrefix} incorrect pixels expected: {expectedIncorrectPixels} actual: {incorrectPixels}"; + } + } + + RenderTexture.ReleaseTemporary(target); + return incorrectPixels; + } + + internal static Shader BuildShaderGraph(GraphData graph, string name, bool hide = true) + { + var generator = new Generator(graph, graph.outputNode, GenerationMode.ForReals, "TransformGraph", null); + string shaderString = generator.generatedShader; + + var shader = ShaderUtil.CreateShaderAsset(shaderString, false); + if (hide) + shader.hideFlags = HideFlags.HideAndDontSave; + + return shader; + } + + internal static void RenderMeshWithMaterial(Camera cam, Mesh mesh, Matrix4x4 transform, Material mat, RenderTexture target, bool useSRP = true) + { + // Force async compile OFF + var wasAsyncAllowed = ShaderUtil.allowAsyncCompilation; + ShaderUtil.allowAsyncCompilation = false; + + var previousRenderTexture = RenderTexture.active; + RenderTexture.active = target; + + GL.Clear(true, true, Color.black); + + cam.targetTexture = target; + Graphics.DrawMesh( + mesh: mesh, + matrix: transform, + material: mat, + layer: 1, + camera: cam, + submeshIndex: 0, + properties: null, + castShadows: ShadowCastingMode.Off, + receiveShadows: false, + probeAnchor: null, + useLightProbes: false); + + var previousUseSRP = Unsupported.useScriptableRenderPipeline; + Unsupported.useScriptableRenderPipeline = useSRP; + cam.Render(); + Unsupported.useScriptableRenderPipeline = previousUseSRP; + + RenderTexture.active = previousRenderTexture; + ShaderUtil.allowAsyncCompilation = wasAsyncAllowed; + } + + internal static void CreateDirectoriesForFilePath(string systemFilePath) + { + var dirPath = Path.GetDirectoryName(systemFilePath); + CreateDirectories(dirPath); + } + + internal static void CreateDirectories(string systemDirectoryPath) + { + Directory.CreateDirectory(systemDirectoryPath); + } + + internal static void ReportArtifact(string artifactPath) + { + var fullpath = Path.GetFullPath(artifactPath); + var message = Unity.TestProtocol.Messages.ArtifactPublishMessage.Create(fullpath); + Debug.Log(Unity.TestProtocol.UnityTestProtocolMessageBuilder.Serialize(message)); + } + + internal static void SaveToPNG(RenderTexture target, string path, bool createDirectory = true, bool reportArtifact = true) + { + if (createDirectory) + CreateDirectoriesForFilePath(path); + + Texture2D temp = new Texture2D(target.width, target.height, TextureFormat.RGBA32, mipChain: false, linear: false); + + var previousRenderTexture = RenderTexture.active; + RenderTexture.active = target; + temp.ReadPixels(new Rect(0, 0, target.width, target.height), 0, 0); + RenderTexture.active = previousRenderTexture; + + var pngData = temp.EncodeToPNG(); + if (pngData != null) + { + File.WriteAllBytes(path, pngData); + } + UnityEngine.Object.DestroyImmediate(temp); + + if (reportArtifact) + ShaderGraphTestRenderer.ReportArtifact(path); + } + + internal static int CountPixelsNotEqual(RenderTexture target, Color32 value, bool compareAlpha) + { + Texture2D temp = new Texture2D(target.width, target.height, TextureFormat.RGBA32, mipChain: false, linear: false); + + var previousRenderTexture = RenderTexture.active; + RenderTexture.active = target; + temp.ReadPixels(new Rect(0, 0, target.width, target.height), 0, 0); + RenderTexture.active = previousRenderTexture; + + int mismatchCount = 0; + var pixels = temp.GetPixels32(0); + foreach (var pixel in pixels) + { + if ((pixel.r != value.r) || + (pixel.g != value.g) || + (pixel.b != value.b) || + (compareAlpha && (pixel.a != value.a))) + { + mismatchCount++; + } + } + + UnityEngine.Object.DestroyImmediate(temp); + return mismatchCount; + } + + internal enum Mode + { + DIFF, + EXPECTED, + ACTUAL + } + + internal void SetKeyword(Material mat, string keyword, bool enabled) + { + if (enabled) + mat.EnableKeyword(keyword); + else + mat.DisableKeyword(keyword); + } + + internal void RenderQuadPreview(GraphData graph, RenderTexture target, Vector3 scenePosition, Quaternion sceneRotation, SetupMaterialDelegate setupMaterial = null, Mode mode = Mode.DIFF, bool useSRP = false) + { + var camXform = previewScene.camera.transform; + + // setup 2D quad render + camXform.position = -Vector3.forward * 2 + scenePosition; + camXform.rotation = sceneRotation; + previewScene.camera.orthographicSize = 0.5f; + previewScene.camera.orthographic = true; + + graph.ValidateGraph(); + + // build the shader + var shader = BuildShaderGraph(graph, "Test Shader"); + var mat = new Material(shader) { hideFlags = HideFlags.HideAndDontSave }; + + SetKeyword(mat, "_MODE_DIFF", (mode == Mode.DIFF)); + SetKeyword(mat, "_MODE_EXPECTED", (mode == Mode.EXPECTED)); + SetKeyword(mat, "_MODE_ACTUAL", (mode == Mode.ACTUAL)); + + if (setupMaterial != null) + setupMaterial(mat); + + var quadMatrix = Matrix4x4.TRS(camXform.position + camXform.forward * 2, camXform.rotation, Vector3.one); + + // render with it + RenderMeshWithMaterial(previewScene.camera, previewScene.quad, quadMatrix, mat, target, useSRP); + } +} diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphTestRenderer.cs.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphTestRenderer.cs.meta new file mode 100644 index 00000000000..cd7a679ccfe --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ShaderGraphTestRenderer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b12b457ea0f15344394a0a574e276043 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests.meta new file mode 100644 index 00000000000..63febdb4f1f --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c171d0a5c6937ae4eb59a6c70d8f9dfa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/NodeTestTest.shadergraph b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/NodeTestTest.shadergraph new file mode 100644 index 00000000000..2d9a19167c3 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/NodeTestTest.shadergraph @@ -0,0 +1,830 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "5794c0fc834944ae8236b510ae2a494b", + "m_Properties": [], + "m_Keywords": [ + { + "m_Id": "3f29a7a705cc4b98b260a52d4cac4af7" + } + ], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "0536202d0f76420f9e81de7eb7f9bc18" + } + ], + "m_Nodes": [ + { + "m_Id": "fc6ab7c410284dbabb360fd37becc1b3" + }, + { + "m_Id": "b03c06b3044a456097aa4599d3f2b771" + }, + { + "m_Id": "762c16d3749a4bc8a7849d9806559663" + }, + { + "m_Id": "0894e62f5acb4df5952151568cc3eead" + }, + { + "m_Id": "4a0f6e07c11d4bf790182c317b7f78fa" + }, + { + "m_Id": "b9cd385803404e4384fa2c323c05bc68" + }, + { + "m_Id": "16c77226a6c149f5b2cf139a4ea31330" + }, + { + "m_Id": "1688de6865054174b0e7314a2faeaa12" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [ + { + "m_Id": "0997847061d84fe6a39765a3069249ac" + } + ], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1688de6865054174b0e7314a2faeaa12" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4a0f6e07c11d4bf790182c317b7f78fa" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "16c77226a6c149f5b2cf139a4ea31330" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4a0f6e07c11d4bf790182c317b7f78fa" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4a0f6e07c11d4bf790182c317b7f78fa" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0894e62f5acb4df5952151568cc3eead" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b9cd385803404e4384fa2c323c05bc68" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4a0f6e07c11d4bf790182c317b7f78fa" + }, + "m_SlotId": 4 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "fc6ab7c410284dbabb360fd37becc1b3" + }, + { + "m_Id": "b03c06b3044a456097aa4599d3f2b771" + }, + { + "m_Id": "762c16d3749a4bc8a7849d9806559663" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "0894e62f5acb4df5952151568cc3eead" + } + ] + }, + "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_ActiveTargets": [ + { + "m_Id": "a3dd56494f774c38ac7a624014242301" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "0536202d0f76420f9e81de7eb7f9bc18", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "3f29a7a705cc4b98b260a52d4cac4af7" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "0894e62f5acb4df5952151568cc3eead", + "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": "37070abbec4c450fbd50efa3c9becd7d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "0997847061d84fe6a39765a3069249ac", + "m_Title": "Purpose", + "m_Content": "Basic test to see if the Node Test system is working and can detect color changes", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -375.1851806640625, + "y": -27.819337844848634, + "width": 200.0, + "height": 160.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ColorNode", + "m_ObjectId": "1688de6865054174b0e7314a2faeaa12", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Color", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -652.0001220703125, + "y": 347.0000305175781, + "width": 208.00009155273438, + "height": 126.99996948242188 + } + }, + "m_Slots": [ + { + "m_Id": "7844ebe59bdd47868611e9ec611d89ef" + } + ], + "synonyms": [ + "rgba" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Color": { + "color": { + "r": 0.0, + "g": 0.0, + "b": 1.0, + "a": 0.0 + }, + "mode": 0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ColorNode", + "m_ObjectId": "16c77226a6c149f5b2cf139a4ea31330", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Color", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -652.0001220703125, + "y": 220.00001525878907, + "width": 208.00009155273438, + "height": 127.00001525878906 + } + }, + "m_Slots": [ + { + "m_Id": "53edcc79cf12413fb5d81493648d60d0" + } + ], + "synonyms": [ + "rgba" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Color": { + "color": { + "r": 0.0, + "g": 1.0, + "b": 0.0, + "a": 0.0 + }, + "mode": 0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "37070abbec4c450fbd50efa3c9becd7d", + "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.0, + "y": 0.0, + "z": 0.0 + }, + "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.TangentMaterialSlot", + "m_ObjectId": "3f15dc9d2ca14343a82768f269898a8e", + "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": 1, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "3f29a7a705cc4b98b260a52d4cac4af7", + "m_Guid": { + "m_GuidSerialized": "50819290-e62f-4c42-9b9e-f9c9fa25680e" + }, + "m_Name": "COLOR", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "COLOR", + "m_DefaultReferenceName": "_COLOR", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_KeywordType": 1, + "m_KeywordDefinition": 0, + "m_KeywordScope": 0, + "m_KeywordStages": 63, + "m_Entries": [ + { + "id": 4, + "displayName": "RED", + "referenceName": "RED" + }, + { + "id": 1, + "displayName": "GREEN", + "referenceName": "GREEN" + }, + { + "id": 2, + "displayName": "BLUE", + "referenceName": "BLUE" + } + ], + "m_Value": 2, + "m_IsEditable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "402398862b46423d9eb671076a04d8fd", + "m_Id": 2, + "m_DisplayName": "BLUE", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BLUE", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "4a0f6e07c11d4bf790182c317b7f78fa", + "m_Group": { + "m_Id": "" + }, + "m_Name": "COLOR", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -323.0000915527344, + "y": 199.99998474121095, + "width": 208.00003051757813, + "height": 326.00006103515627 + } + }, + "m_Slots": [ + { + "m_Id": "72755c4a8d884deabd4da0e6da0d1ca6" + }, + { + "m_Id": "cf2f7f6f8d0f49da98b63f88d3be5c2f" + }, + { + "m_Id": "5e014be303dd4ab696d4af167c1bee45" + }, + { + "m_Id": "402398862b46423d9eb671076a04d8fd" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "3f29a7a705cc4b98b260a52d4cac4af7" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "53edcc79cf12413fb5d81493648d60d0", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5e014be303dd4ab696d4af167c1bee45", + "m_Id": 1, + "m_DisplayName": "GREEN", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "GREEN", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "72755c4a8d884deabd4da0e6da0d1ca6", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "762c16d3749a4bc8a7849d9806559663", + "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": "3f15dc9d2ca14343a82768f269898a8e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "7844ebe59bdd47868611e9ec611d89ef", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "a3dd56494f774c38ac7a624014242301", + "m_ActiveSubTarget": { + "m_Id": "e0cce20dd89649ecac7f1c523d25be28" + }, + "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_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "b03c06b3044a456097aa4599d3f2b771", + "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": "d14653b74e3c4f2f89a767be40b699b0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ColorNode", + "m_ObjectId": "b9cd385803404e4384fa2c323c05bc68", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Color", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -652.0001220703125, + "y": 93.00000762939453, + "width": 208.00009155273438, + "height": 127.00000762939453 + } + }, + "m_Slots": [ + { + "m_Id": "f7165d0015a54bc9be941d6b8f74edd3" + } + ], + "synonyms": [ + "rgba" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Color": { + "color": { + "r": 1.0, + "g": 0.0, + "b": 0.0, + "a": 0.0 + }, + "mode": 0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "cf2f7f6f8d0f49da98b63f88d3be5c2f", + "m_Id": 4, + "m_DisplayName": "RED", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "RED", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "d14653b74e3c4f2f89a767be40b699b0", + "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.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "e0cce20dd89649ecac7f1c523d25be28" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "ed1ae7d21efb4c26beee46b999260313", + "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.Vector4MaterialSlot", + "m_ObjectId": "f7165d0015a54bc9be941d6b8f74edd3", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "fc6ab7c410284dbabb360fd37becc1b3", + "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": "ed1ae7d21efb4c26beee46b999260313" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/NodeTestTest.shadergraph.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/NodeTestTest.shadergraph.meta new file mode 100644 index 00000000000..582e2c820da --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/NodeTestTest.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 16fd65af5f24e5646b7cb9f8d16020c6 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformABC.shadergraph b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformABC.shadergraph new file mode 100644 index 00000000000..1dfc1371fae --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformABC.shadergraph @@ -0,0 +1,2377 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "d3a578d5f6c048d989f4fc22763a096c", + "m_Properties": [], + "m_Keywords": [ + { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } + ], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "82645ecd662c4d88a7de4083a8e5b53c" + } + ], + "m_Nodes": [ + { + "m_Id": "fc28a5ef65284ed0967870ff69516ffe" + }, + { + "m_Id": "970cbadefd8f4fcca05f884246b4ad3e" + }, + { + "m_Id": "3ec2632bb2694b7699d26c257e2879ea" + }, + { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + }, + { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + { + "m_Id": "997e733a37a141d4b698281397e00d14" + }, + { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + { + "m_Id": "11320eeb0d9f4e2aaf7c881af29e9d14" + }, + { + "m_Id": "9fa27d76367a4b37b0351f86e835a86e" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [ + { + "m_Id": "ebeb58a811964ae1ae55c9969cd6e146" + }, + { + "m_Id": "6861d370b150463a8e84fb6bf7973bdc" + } + ], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "11320eeb0d9f4e2aaf7c881af29e9d14" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "11320eeb0d9f4e2aaf7c881af29e9d14" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "997e733a37a141d4b698281397e00d14" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9fa27d76367a4b37b0351f86e835a86e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9fa27d76367a4b37b0351f86e835a86e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9fa27d76367a4b37b0351f86e835a86e" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "11320eeb0d9f4e2aaf7c881af29e9d14" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 362.00006103515627, + "y": -291.0 + }, + "m_Blocks": [ + { + "m_Id": "fc28a5ef65284ed0967870ff69516ffe" + }, + { + "m_Id": "970cbadefd8f4fcca05f884246b4ad3e" + }, + { + "m_Id": "3ec2632bb2694b7699d26c257e2879ea" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 362.00006103515627, + "y": -91.0 + }, + "m_Blocks": [ + { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + } + ] + }, + "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_ActiveTargets": [ + { + "m_Id": "1e17856cccb848638b5a1829dd00d4f8" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "008e372e323b4f7190fc81b4798c881c", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "07748643054049eea2a69011501a6a15", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "11320eeb0d9f4e2aaf7c881af29e9d14", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1783.0, + "y": 281.0, + "width": 213.0, + "height": 341.0 + } + }, + "m_Slots": [ + { + "m_Id": "008e372e323b4f7190fc81b4798c881c" + }, + { + "m_Id": "b773686d103b468db631276e1625c82c" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 1, + "to": 3 + }, + "m_ConversionType": 0, + "m_Normalize": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SaturateNode", + "m_ObjectId": "1746ecad396f45c2808181de7c16ab2d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Saturate", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -688.0, + "y": 2.0, + "width": 208.0, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "691ae26bade44166941282be4b9e5582" + }, + { + "m_Id": "b20bd24cda5545cba5f1e7f3fdb7868d" + } + ], + "synonyms": [ + "clamp" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "1bd0bd2d8a644a369163cb727342c308", + "m_Guid": { + "m_GuidSerialized": "7a8918ce-9570-4947-b06a-6445703e6938" + }, + "m_Name": "MODE", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "MODE", + "m_DefaultReferenceName": "_MODE", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_KeywordType": 1, + "m_KeywordDefinition": 0, + "m_KeywordScope": 0, + "m_KeywordStages": 63, + "m_Entries": [ + { + "id": 3, + "displayName": "DIFF", + "referenceName": "DIFF" + }, + { + "id": 1, + "displayName": "EXPECTED", + "referenceName": "EXPECTED" + }, + { + "id": 2, + "displayName": "ACTUAL", + "referenceName": "ACTUAL" + } + ], + "m_Value": 0, + "m_IsEditable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "1d11b6b53cef4b47869bbb766c74c0ea", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "1e17856cccb848638b5a1829dd00d4f8", + "m_ActiveSubTarget": { + "m_Id": "416b95b32d794f768b76ab713d607602" + }, + "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_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "21393da4eb4d423a8f0b10e2ec444b34", + "m_Id": 1, + "m_DisplayName": "Coord", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Coord", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "34ee9d276de1426ea3815b3e26e80564", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "353328e353834293ac0840fb8eb6f2c8", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "38d77b7f78e54e4e952af3311791ccd4", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "3b6e685d10224984b1ec689fc2168cf2", + "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.0, + "y": 0.0, + "z": 0.0 + }, + "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.BlockNode", + "m_ObjectId": "3ec2632bb2694b7699d26c257e2879ea", + "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": "628ef29e9b5d447e9caa4531bcbe6b10" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "3f4fe83ebf4a492c8bd4bd8d039d4e4e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -113.00003051757813, + "y": 363.0000915527344, + "width": 132.0000457763672, + "height": 93.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "1d11b6b53cef4b47869bbb766c74c0ea" + }, + { + "m_Id": "07748643054049eea2a69011501a6a15" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "416b95b32d794f768b76ab713d607602" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "42ed096a23f0457eab55df8305100690", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "44ff4c8e37d149f0a0ea59d40128711c", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "49eb3060313949e8a29142442a4c029a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2635.999755859375, + "y": 41.00001907348633, + "width": 208.0, + "height": 302.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "cee2261d7bcb4e288eb8e4171fa1e0b9" + }, + { + "m_Id": "c481840984234183a87b86bd85e4b13d" + }, + { + "m_Id": "6b856ac4f8634c3bae87e2ac66690f86" + } + ], + "synonyms": [ + "addition", + "sum", + "plus" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "4f283af276d64dac858d0947d1fdbaaa", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "50f3802c0e1d464abca40855381706b0", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "54d1e21495064ae8982ce8365d45d873", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -113.00003051757813, + "y": -294.9999694824219, + "width": 132.0000457763672, + "height": 94.00001525878906 + } + }, + "m_Slots": [ + { + "m_Id": "c87f1f151ea74a4995743a525e3f011b" + }, + { + "m_Id": "8331dcbe952448e3b4cf2b6523349985" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "54f4946a07ec470ab8eec9a158a27258", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5743e9b1804044f38daa56bd9f883145", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5773db1af68243e0b9bd3ef7d7e70faa", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6286951a44ca42e8adf651ceec17a756", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "628ef29e9b5d447e9caa4531bcbe6b10", + "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.BlockNode", + "m_ObjectId": "65611bc2ea7845359ab31d44dd0816ab", + "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": "3b6e685d10224984b1ec689fc2168cf2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "6861d370b150463a8e84fb6bf7973bdc", + "m_Title": "Purpose", + "m_Content": "Testing that a transform from space A -> space C is equivalent to a transform from space A -> space B, followed by a transfrom from space B -> space C.\n", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -1892.0, + "y": -407.0, + "width": 200.0, + "height": 160.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "691ae26bade44166941282be4b9e5582", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6a253040a6fd42dcbf025ac7ff33aa6c", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6b856ac4f8634c3bae87e2ac66690f86", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "6bb1519686984d74ab200c925b9a3676", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "6dc28149a6e2450a9b06b18a139d8695", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1312.0001220703125, + "y": -247.9999542236328, + "width": 56.0001220703125, + "height": 23.999984741210939 + } + }, + "m_Slots": [ + { + "m_Id": "5743e9b1804044f38daa56bd9f883145" + }, + { + "m_Id": "50f3802c0e1d464abca40855381706b0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "76d15710128b4ba5a42566d71f242c7e", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "78abf71b291948a891e8fa2a931cac62", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 200.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "79c8bd704d2a4ce48efa862b75d36053", + "m_Id": 3, + "m_DisplayName": "DIFF", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "DIFF", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "82645ecd662c4d88a7de4083a8e5b53c", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8331dcbe952448e3b4cf2b6523349985", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "8a871f1b8d354b02b2dbcf3aed00bd1d", + "m_Id": 0, + "m_DisplayName": "Hash", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Hash", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "907dd0a26f124143bbc87326f74c2f54", + "m_Group": { + "m_Id": "" + }, + "m_Name": "MODE", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 126.99999237060547, + "y": -91.0, + "width": 208.00003051757813, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "42ed096a23f0457eab55df8305100690" + }, + { + "m_Id": "79c8bd704d2a4ce48efa862b75d36053" + }, + { + "m_Id": "aec17fc7875a44f38f7d9153cf74f50f" + }, + { + "m_Id": "994474eebdcf4c66a55e6ac3838b66ce" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "970cbadefd8f4fcca05f884246b4ad3e", + "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": "d25d1af86a094ac7be2f0127f4634d7b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "994474eebdcf4c66a55e6ac3838b66ce", + "m_Id": 2, + "m_DisplayName": "ACTUAL", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "ACTUAL", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode", + "m_ObjectId": "997e733a37a141d4b698281397e00d14", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Screen Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2935.999755859375, + "y": 107.99995422363281, + "width": 208.0, + "height": 312.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "ad89e0280e524d9999c12e31260bd0a2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ScreenSpaceType": 4 +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "9fa27d76367a4b37b0351f86e835a86e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1889.0, + "y": -129.0, + "width": 213.0, + "height": 341.0000305175781 + } + }, + "m_Slots": [ + { + "m_Id": "4f283af276d64dac858d0947d1fdbaaa" + }, + { + "m_Id": "353328e353834293ac0840fb8eb6f2c8" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 0, + "to": 3 + }, + "m_ConversionType": 0, + "m_Normalize": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "a6ad0619b0ff4b35b9c068ac56819033", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "ad89e0280e524d9999c12e31260bd0a2", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "aec17fc7875a44f38f7d9153cf74f50f", + "m_Id": 1, + "m_DisplayName": "EXPECTED", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "EXPECTED", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "afd6fed3d8e8461c9ac141b19e55e04d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -321.0, + "y": -86.99998474121094, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "d0bc4074e39847c09e25d45223ff7f12" + }, + { + "m_Id": "fefaeb0050de4b00a9a812607dec2e12" + }, + { + "m_Id": "44ff4c8e37d149f0a0ea59d40128711c" + }, + { + "m_Id": "54f4946a07ec470ab8eec9a158a27258" + } + ], + "synonyms": [ + "mix", + "blend", + "linear interpolate" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b20bd24cda5545cba5f1e7f3fdb7868d", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "b773686d103b468db631276e1625c82c", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c481840984234183a87b86bd85e4b13d", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c87f1f151ea74a4995743a525e3f011b", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "cd74f48ac90a40f49890cd16fbf6660a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -896.0, + "y": 2.0, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "78abf71b291948a891e8fa2a931cac62" + }, + { + "m_Id": "df63aca4443847ec96ffc346ffd297b7" + }, + { + "m_Id": "a6ad0619b0ff4b35b9c068ac56819033" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "cee2261d7bcb4e288eb8e4171fa1e0b9", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d0bc4074e39847c09e25d45223ff7f12", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "d25d1af86a094ac7be2f0127f4634d7b", + "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.SubtractNode", + "m_ObjectId": "d5c0ffaecc9d45f986de4d8925bc0051", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Subtract", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1312.0, + "y": 3.0000650882720949, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "5773db1af68243e0b9bd3ef7d7e70faa" + }, + { + "m_Id": "6a253040a6fd42dcbf025ac7ff33aa6c" + }, + { + "m_Id": "38d77b7f78e54e4e952af3311791ccd4" + } + ], + "synonyms": [ + "subtraction", + "remove", + "minus", + "take away" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.IntegerHashNode", + "m_ObjectId": "d7fc69d9fbd84fe5b18d4361e39b39b9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integer Hash", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2386.999755859375, + "y": 107.99995422363281, + "width": 207.999755859375, + "height": 312.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "21393da4eb4d423a8f0b10e2ec444b34" + }, + { + "m_Id": "8a871f1b8d354b02b2dbcf3aed00bd1d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_HashType": 1 +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "de1092b024884fdf9e8a5171a48ef13e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1996.0, + "y": 281.0, + "width": 213.0, + "height": 341.0 + } + }, + "m_Slots": [ + { + "m_Id": "e52abb26e3ba40958f14752a649a892c" + }, + { + "m_Id": "6bb1519686984d74ab200c925b9a3676" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 0, + "to": 1 + }, + "m_ConversionType": 0, + "m_Normalize": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "df63aca4443847ec96ffc346ffd297b7", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 200.0, + "e01": 200.0, + "e02": 200.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "e52abb26e3ba40958f14752a649a892c", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e6aff6e4a9b14ff7827921e6353a87a3", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "ebeb58a811964ae1ae55c9969cd6e146", + "m_Title": "Note", + "m_Content": "Since screen position is 0.5 centered, the round on the integer hash is sitting right on the boundary which is unstable.\nWe give it a bit of a push to one side to make sure it's deterministic.\n", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -2630.0, + "y": -133.0, + "width": 200.0, + "height": 172.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "fa72769f37e54f599d367774a779d845", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1104.0, + "y": 3.0000650882720949, + "width": 207.9998779296875, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "76d15710128b4ba5a42566d71f242c7e" + }, + { + "m_Id": "6286951a44ca42e8adf651ceec17a756" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "fc28a5ef65284ed0967870ff69516ffe", + "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": "fc66c175daa9462fa1430c43a99d7698" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "fc66c175daa9462fa1430c43a99d7698", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "fefaeb0050de4b00a9a812607dec2e12", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "ffde04b05e2c42f38093d4ddd027315b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1286.0001220703125, + "y": 410.00006103515627, + "width": 56.0001220703125, + "height": 23.999969482421876 + } + }, + "m_Slots": [ + { + "m_Id": "e6aff6e4a9b14ff7827921e6353a87a3" + }, + { + "m_Id": "34ee9d276de1426ea3815b3e26e80564" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformABC.shadergraph.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformABC.shadergraph.meta new file mode 100644 index 00000000000..cdd8a798c5b --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformABC.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3f6802084604c8643adedcba5bde5df7 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformInverses.shadergraph b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformInverses.shadergraph new file mode 100644 index 00000000000..c2e3c1de5ca --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformInverses.shadergraph @@ -0,0 +1,2366 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "d3a578d5f6c048d989f4fc22763a096c", + "m_Properties": [], + "m_Keywords": [ + { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } + ], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "82645ecd662c4d88a7de4083a8e5b53c" + } + ], + "m_Nodes": [ + { + "m_Id": "fc28a5ef65284ed0967870ff69516ffe" + }, + { + "m_Id": "970cbadefd8f4fcca05f884246b4ad3e" + }, + { + "m_Id": "3ec2632bb2694b7699d26c257e2879ea" + }, + { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + }, + { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + { + "m_Id": "997e733a37a141d4b698281397e00d14" + }, + { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + { + "m_Id": "4303390d71784ac2ac6443638dc5aaae" + }, + { + "m_Id": "11320eeb0d9f4e2aaf7c881af29e9d14" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [ + { + "m_Id": "ebeb58a811964ae1ae55c9969cd6e146" + }, + { + "m_Id": "4e585c78521e42b7a2565e9e062786fc" + } + ], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "11320eeb0d9f4e2aaf7c881af29e9d14" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "11320eeb0d9f4e2aaf7c881af29e9d14" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4303390d71784ac2ac6443638dc5aaae" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4303390d71784ac2ac6443638dc5aaae" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "997e733a37a141d4b698281397e00d14" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4303390d71784ac2ac6443638dc5aaae" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "11320eeb0d9f4e2aaf7c881af29e9d14" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 362.00006103515627, + "y": -291.0 + }, + "m_Blocks": [ + { + "m_Id": "fc28a5ef65284ed0967870ff69516ffe" + }, + { + "m_Id": "970cbadefd8f4fcca05f884246b4ad3e" + }, + { + "m_Id": "3ec2632bb2694b7699d26c257e2879ea" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 362.00006103515627, + "y": -91.0 + }, + "m_Blocks": [ + { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + } + ] + }, + "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_ActiveTargets": [ + { + "m_Id": "1e17856cccb848638b5a1829dd00d4f8" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "008e372e323b4f7190fc81b4798c881c", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "07748643054049eea2a69011501a6a15", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0feeb8b29d1e419eace88f822f0989c2", + "m_Id": 3, + "m_DisplayName": "DIFF", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "DIFF", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "11320eeb0d9f4e2aaf7c881af29e9d14", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1783.0, + "y": 281.0, + "width": 213.0, + "height": 341.0 + } + }, + "m_Slots": [ + { + "m_Id": "008e372e323b4f7190fc81b4798c881c" + }, + { + "m_Id": "b773686d103b468db631276e1625c82c" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 4, + "to": 1 + }, + "m_ConversionType": 0, + "m_Normalize": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "156a815141254f84a321db112c7b7771", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SaturateNode", + "m_ObjectId": "1746ecad396f45c2808181de7c16ab2d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Saturate", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -688.0, + "y": 2.0, + "width": 208.0, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "691ae26bade44166941282be4b9e5582" + }, + { + "m_Id": "b20bd24cda5545cba5f1e7f3fdb7868d" + } + ], + "synonyms": [ + "clamp" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "1bd0bd2d8a644a369163cb727342c308", + "m_Guid": { + "m_GuidSerialized": "7a8918ce-9570-4947-b06a-6445703e6938" + }, + "m_Name": "MODE", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "MODE", + "m_DefaultReferenceName": "_MODE", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_KeywordType": 1, + "m_KeywordDefinition": 0, + "m_KeywordScope": 0, + "m_KeywordStages": 63, + "m_Entries": [ + { + "id": 3, + "displayName": "DIFF", + "referenceName": "DIFF" + }, + { + "id": 1, + "displayName": "EXPECTED", + "referenceName": "EXPECTED" + }, + { + "id": 2, + "displayName": "ACTUAL", + "referenceName": "ACTUAL" + } + ], + "m_Value": 0, + "m_IsEditable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "1d11b6b53cef4b47869bbb766c74c0ea", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "1e17856cccb848638b5a1829dd00d4f8", + "m_ActiveSubTarget": { + "m_Id": "416b95b32d794f768b76ab713d607602" + }, + "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_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "21393da4eb4d423a8f0b10e2ec444b34", + "m_Id": 1, + "m_DisplayName": "Coord", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Coord", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "311522a28e9843e8a1f5e8b38b3ea247", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "34ee9d276de1426ea3815b3e26e80564", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "38d77b7f78e54e4e952af3311791ccd4", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "3b6e685d10224984b1ec689fc2168cf2", + "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.0, + "y": 0.0, + "z": 0.0 + }, + "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.BlockNode", + "m_ObjectId": "3ec2632bb2694b7699d26c257e2879ea", + "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": "628ef29e9b5d447e9caa4531bcbe6b10" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "3f4fe83ebf4a492c8bd4bd8d039d4e4e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -113.00003051757813, + "y": 363.0000915527344, + "width": 132.0000457763672, + "height": 93.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "1d11b6b53cef4b47869bbb766c74c0ea" + }, + { + "m_Id": "07748643054049eea2a69011501a6a15" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "416b95b32d794f768b76ab713d607602" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "42ed096a23f0457eab55df8305100690", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "4303390d71784ac2ac6443638dc5aaae", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1782.9998779296875, + "y": -102.9999008178711, + "width": 56.0001220703125, + "height": 24.0 + } + }, + "m_Slots": [ + { + "m_Id": "156a815141254f84a321db112c7b7771" + }, + { + "m_Id": "311522a28e9843e8a1f5e8b38b3ea247" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "44ff4c8e37d149f0a0ea59d40128711c", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "49eb3060313949e8a29142442a4c029a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2635.999755859375, + "y": 41.00001907348633, + "width": 208.0, + "height": 302.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "cee2261d7bcb4e288eb8e4171fa1e0b9" + }, + { + "m_Id": "c481840984234183a87b86bd85e4b13d" + }, + { + "m_Id": "6b856ac4f8634c3bae87e2ac66690f86" + } + ], + "synonyms": [ + "addition", + "sum", + "plus" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "4e585c78521e42b7a2565e9e062786fc", + "m_Title": "Purpose", + "m_Content": "Testing that a transfom, followed by it's inverse, is equivalent to the original value (when not normalized)", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -1834.0, + "y": -393.0, + "width": 200.0, + "height": 160.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "50f3802c0e1d464abca40855381706b0", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "54d1e21495064ae8982ce8365d45d873", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -113.00003051757813, + "y": -294.9999694824219, + "width": 132.0000457763672, + "height": 94.00001525878906 + } + }, + "m_Slots": [ + { + "m_Id": "c87f1f151ea74a4995743a525e3f011b" + }, + { + "m_Id": "8331dcbe952448e3b4cf2b6523349985" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "54f4946a07ec470ab8eec9a158a27258", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5743e9b1804044f38daa56bd9f883145", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5773db1af68243e0b9bd3ef7d7e70faa", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6286951a44ca42e8adf651ceec17a756", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "628ef29e9b5d447e9caa4531bcbe6b10", + "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.BlockNode", + "m_ObjectId": "65611bc2ea7845359ab31d44dd0816ab", + "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": "3b6e685d10224984b1ec689fc2168cf2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "691ae26bade44166941282be4b9e5582", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6a253040a6fd42dcbf025ac7ff33aa6c", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6b856ac4f8634c3bae87e2ac66690f86", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "6bb1519686984d74ab200c925b9a3676", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "6dc28149a6e2450a9b06b18a139d8695", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1312.0001220703125, + "y": -247.9999542236328, + "width": 56.0001220703125, + "height": 23.999984741210939 + } + }, + "m_Slots": [ + { + "m_Id": "5743e9b1804044f38daa56bd9f883145" + }, + { + "m_Id": "50f3802c0e1d464abca40855381706b0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "76d15710128b4ba5a42566d71f242c7e", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "78abf71b291948a891e8fa2a931cac62", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 200.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "82645ecd662c4d88a7de4083a8e5b53c", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8331dcbe952448e3b4cf2b6523349985", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "8a871f1b8d354b02b2dbcf3aed00bd1d", + "m_Id": 0, + "m_DisplayName": "Hash", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Hash", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "907dd0a26f124143bbc87326f74c2f54", + "m_Group": { + "m_Id": "" + }, + "m_Name": "MODE", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 126.99999237060547, + "y": -91.0, + "width": 208.00003051757813, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "42ed096a23f0457eab55df8305100690" + }, + { + "m_Id": "0feeb8b29d1e419eace88f822f0989c2" + }, + { + "m_Id": "aec17fc7875a44f38f7d9153cf74f50f" + }, + { + "m_Id": "994474eebdcf4c66a55e6ac3838b66ce" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "970cbadefd8f4fcca05f884246b4ad3e", + "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": "d25d1af86a094ac7be2f0127f4634d7b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "994474eebdcf4c66a55e6ac3838b66ce", + "m_Id": 2, + "m_DisplayName": "ACTUAL", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "ACTUAL", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode", + "m_ObjectId": "997e733a37a141d4b698281397e00d14", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Screen Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2935.999755859375, + "y": 107.99995422363281, + "width": 208.0, + "height": 312.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "ad89e0280e524d9999c12e31260bd0a2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ScreenSpaceType": 4 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "a6ad0619b0ff4b35b9c068ac56819033", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "ad89e0280e524d9999c12e31260bd0a2", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "aec17fc7875a44f38f7d9153cf74f50f", + "m_Id": 1, + "m_DisplayName": "EXPECTED", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "EXPECTED", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "afd6fed3d8e8461c9ac141b19e55e04d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -321.0, + "y": -86.99998474121094, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "d0bc4074e39847c09e25d45223ff7f12" + }, + { + "m_Id": "fefaeb0050de4b00a9a812607dec2e12" + }, + { + "m_Id": "44ff4c8e37d149f0a0ea59d40128711c" + }, + { + "m_Id": "54f4946a07ec470ab8eec9a158a27258" + } + ], + "synonyms": [ + "mix", + "blend", + "linear interpolate" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b20bd24cda5545cba5f1e7f3fdb7868d", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "b773686d103b468db631276e1625c82c", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c481840984234183a87b86bd85e4b13d", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c87f1f151ea74a4995743a525e3f011b", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "cd74f48ac90a40f49890cd16fbf6660a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -896.0, + "y": 2.0, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "78abf71b291948a891e8fa2a931cac62" + }, + { + "m_Id": "df63aca4443847ec96ffc346ffd297b7" + }, + { + "m_Id": "a6ad0619b0ff4b35b9c068ac56819033" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "cee2261d7bcb4e288eb8e4171fa1e0b9", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d0bc4074e39847c09e25d45223ff7f12", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "d25d1af86a094ac7be2f0127f4634d7b", + "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.SubtractNode", + "m_ObjectId": "d5c0ffaecc9d45f986de4d8925bc0051", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Subtract", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1312.0, + "y": 3.0000650882720949, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "5773db1af68243e0b9bd3ef7d7e70faa" + }, + { + "m_Id": "6a253040a6fd42dcbf025ac7ff33aa6c" + }, + { + "m_Id": "38d77b7f78e54e4e952af3311791ccd4" + } + ], + "synonyms": [ + "subtraction", + "remove", + "minus", + "take away" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.IntegerHashNode", + "m_ObjectId": "d7fc69d9fbd84fe5b18d4361e39b39b9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integer Hash", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2386.999755859375, + "y": 107.99995422363281, + "width": 207.999755859375, + "height": 312.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "21393da4eb4d423a8f0b10e2ec444b34" + }, + { + "m_Id": "8a871f1b8d354b02b2dbcf3aed00bd1d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_HashType": 1 +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "de1092b024884fdf9e8a5171a48ef13e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1996.0, + "y": 281.0, + "width": 213.0, + "height": 341.0 + } + }, + "m_Slots": [ + { + "m_Id": "e52abb26e3ba40958f14752a649a892c" + }, + { + "m_Id": "6bb1519686984d74ab200c925b9a3676" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 0, + "to": 4 + }, + "m_ConversionType": 0, + "m_Normalize": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "df63aca4443847ec96ffc346ffd297b7", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 200.0, + "e01": 200.0, + "e02": 200.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "e52abb26e3ba40958f14752a649a892c", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e6aff6e4a9b14ff7827921e6353a87a3", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "ebeb58a811964ae1ae55c9969cd6e146", + "m_Title": "Note", + "m_Content": "Since screen position is 0.5 centered, the round on the integer hash is sitting right on the boundary which is unstable.\nWe give it a bit of a push to one side to make sure it's deterministic.\n", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -2630.0, + "y": -133.0, + "width": 200.0, + "height": 172.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "fa72769f37e54f599d367774a779d845", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1104.0, + "y": 3.0000650882720949, + "width": 207.9998779296875, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "76d15710128b4ba5a42566d71f242c7e" + }, + { + "m_Id": "6286951a44ca42e8adf651ceec17a756" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "fc28a5ef65284ed0967870ff69516ffe", + "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": "fc66c175daa9462fa1430c43a99d7698" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "fc66c175daa9462fa1430c43a99d7698", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "fefaeb0050de4b00a9a812607dec2e12", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "ffde04b05e2c42f38093d4ddd027315b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1286.0001220703125, + "y": 410.00006103515627, + "width": 56.0001220703125, + "height": 23.999969482421876 + } + }, + "m_Slots": [ + { + "m_Id": "e6aff6e4a9b14ff7827921e6353a87a3" + }, + { + "m_Id": "34ee9d276de1426ea3815b3e26e80564" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformInverses.shadergraph.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformInverses.shadergraph.meta new file mode 100644 index 00000000000..185ac754dfa --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformInverses.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bb2cd92af7992f741b9ccaa858abcd08 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformNormalize.shadergraph b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformNormalize.shadergraph new file mode 100644 index 00000000000..d30a161c457 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformNormalize.shadergraph @@ -0,0 +1,2366 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "d3a578d5f6c048d989f4fc22763a096c", + "m_Properties": [], + "m_Keywords": [ + { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } + ], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "82645ecd662c4d88a7de4083a8e5b53c" + } + ], + "m_Nodes": [ + { + "m_Id": "fc28a5ef65284ed0967870ff69516ffe" + }, + { + "m_Id": "970cbadefd8f4fcca05f884246b4ad3e" + }, + { + "m_Id": "3ec2632bb2694b7699d26c257e2879ea" + }, + { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + }, + { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + { + "m_Id": "997e733a37a141d4b698281397e00d14" + }, + { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + { + "m_Id": "9fa27d76367a4b37b0351f86e835a86e" + }, + { + "m_Id": "bd41e49cf4f8409f9dfb75d384345a4b" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [ + { + "m_Id": "ebeb58a811964ae1ae55c9969cd6e146" + }, + { + "m_Id": "6861d370b150463a8e84fb6bf7973bdc" + } + ], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "997e733a37a141d4b698281397e00d14" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9fa27d76367a4b37b0351f86e835a86e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "bd41e49cf4f8409f9dfb75d384345a4b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "bd41e49cf4f8409f9dfb75d384345a4b" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "bd41e49cf4f8409f9dfb75d384345a4b" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9fa27d76367a4b37b0351f86e835a86e" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 362.00006103515627, + "y": -291.0 + }, + "m_Blocks": [ + { + "m_Id": "fc28a5ef65284ed0967870ff69516ffe" + }, + { + "m_Id": "970cbadefd8f4fcca05f884246b4ad3e" + }, + { + "m_Id": "3ec2632bb2694b7699d26c257e2879ea" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 362.00006103515627, + "y": -91.0 + }, + "m_Blocks": [ + { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + } + ] + }, + "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_ActiveTargets": [ + { + "m_Id": "1e17856cccb848638b5a1829dd00d4f8" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "07748643054049eea2a69011501a6a15", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SaturateNode", + "m_ObjectId": "1746ecad396f45c2808181de7c16ab2d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Saturate", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -688.0, + "y": 2.0, + "width": 208.0, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "691ae26bade44166941282be4b9e5582" + }, + { + "m_Id": "b20bd24cda5545cba5f1e7f3fdb7868d" + } + ], + "synonyms": [ + "clamp" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "1bd0bd2d8a644a369163cb727342c308", + "m_Guid": { + "m_GuidSerialized": "7a8918ce-9570-4947-b06a-6445703e6938" + }, + "m_Name": "MODE", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "MODE", + "m_DefaultReferenceName": "_MODE", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_KeywordType": 1, + "m_KeywordDefinition": 0, + "m_KeywordScope": 0, + "m_KeywordStages": 63, + "m_Entries": [ + { + "id": 3, + "displayName": "DIFF", + "referenceName": "DIFF" + }, + { + "id": 1, + "displayName": "EXPECTED", + "referenceName": "EXPECTED" + }, + { + "id": 2, + "displayName": "ACTUAL", + "referenceName": "ACTUAL" + } + ], + "m_Value": 0, + "m_IsEditable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "1d11b6b53cef4b47869bbb766c74c0ea", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "1e17856cccb848638b5a1829dd00d4f8", + "m_ActiveSubTarget": { + "m_Id": "416b95b32d794f768b76ab713d607602" + }, + "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_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "21393da4eb4d423a8f0b10e2ec444b34", + "m_Id": 1, + "m_DisplayName": "Coord", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Coord", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "2a3224dfa9bd4cae86c581149bb64689", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "34ee9d276de1426ea3815b3e26e80564", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "353328e353834293ac0840fb8eb6f2c8", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "38d77b7f78e54e4e952af3311791ccd4", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "3b6e685d10224984b1ec689fc2168cf2", + "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.0, + "y": 0.0, + "z": 0.0 + }, + "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.BlockNode", + "m_ObjectId": "3ec2632bb2694b7699d26c257e2879ea", + "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": "628ef29e9b5d447e9caa4531bcbe6b10" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "3f4fe83ebf4a492c8bd4bd8d039d4e4e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -113.00003051757813, + "y": 363.0000915527344, + "width": 132.0000457763672, + "height": 93.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "1d11b6b53cef4b47869bbb766c74c0ea" + }, + { + "m_Id": "07748643054049eea2a69011501a6a15" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "416b95b32d794f768b76ab713d607602" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "42ed096a23f0457eab55df8305100690", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "44ff4c8e37d149f0a0ea59d40128711c", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "49eb3060313949e8a29142442a4c029a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2635.999755859375, + "y": 41.00001907348633, + "width": 208.0, + "height": 302.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "cee2261d7bcb4e288eb8e4171fa1e0b9" + }, + { + "m_Id": "c481840984234183a87b86bd85e4b13d" + }, + { + "m_Id": "6b856ac4f8634c3bae87e2ac66690f86" + } + ], + "synonyms": [ + "addition", + "sum", + "plus" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "4f283af276d64dac858d0947d1fdbaaa", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "50f3802c0e1d464abca40855381706b0", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "54d1e21495064ae8982ce8365d45d873", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -113.00003051757813, + "y": -294.9999694824219, + "width": 132.0000457763672, + "height": 94.00001525878906 + } + }, + "m_Slots": [ + { + "m_Id": "c87f1f151ea74a4995743a525e3f011b" + }, + { + "m_Id": "8331dcbe952448e3b4cf2b6523349985" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "54f4946a07ec470ab8eec9a158a27258", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5743e9b1804044f38daa56bd9f883145", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5773db1af68243e0b9bd3ef7d7e70faa", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6286951a44ca42e8adf651ceec17a756", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "628ef29e9b5d447e9caa4531bcbe6b10", + "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.BlockNode", + "m_ObjectId": "65611bc2ea7845359ab31d44dd0816ab", + "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": "3b6e685d10224984b1ec689fc2168cf2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "6861d370b150463a8e84fb6bf7973bdc", + "m_Title": "Purpose", + "m_Content": "Validate that the normalization option works", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -1892.0, + "y": -407.0, + "width": 200.0, + "height": 160.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "691ae26bade44166941282be4b9e5582", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6a253040a6fd42dcbf025ac7ff33aa6c", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6b856ac4f8634c3bae87e2ac66690f86", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "6bb1519686984d74ab200c925b9a3676", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "6dc28149a6e2450a9b06b18a139d8695", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1312.0001220703125, + "y": -247.9999542236328, + "width": 56.0001220703125, + "height": 23.999984741210939 + } + }, + "m_Slots": [ + { + "m_Id": "5743e9b1804044f38daa56bd9f883145" + }, + { + "m_Id": "50f3802c0e1d464abca40855381706b0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "76d15710128b4ba5a42566d71f242c7e", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "78abf71b291948a891e8fa2a931cac62", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 200.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "79c8bd704d2a4ce48efa862b75d36053", + "m_Id": 3, + "m_DisplayName": "DIFF", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "DIFF", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "82645ecd662c4d88a7de4083a8e5b53c", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8331dcbe952448e3b4cf2b6523349985", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "8a871f1b8d354b02b2dbcf3aed00bd1d", + "m_Id": 0, + "m_DisplayName": "Hash", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Hash", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "907dd0a26f124143bbc87326f74c2f54", + "m_Group": { + "m_Id": "" + }, + "m_Name": "MODE", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 126.99999237060547, + "y": -91.0, + "width": 208.00003051757813, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "42ed096a23f0457eab55df8305100690" + }, + { + "m_Id": "79c8bd704d2a4ce48efa862b75d36053" + }, + { + "m_Id": "aec17fc7875a44f38f7d9153cf74f50f" + }, + { + "m_Id": "994474eebdcf4c66a55e6ac3838b66ce" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "970cbadefd8f4fcca05f884246b4ad3e", + "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": "d25d1af86a094ac7be2f0127f4634d7b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "994474eebdcf4c66a55e6ac3838b66ce", + "m_Id": 2, + "m_DisplayName": "ACTUAL", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "ACTUAL", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode", + "m_ObjectId": "997e733a37a141d4b698281397e00d14", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Screen Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2935.999755859375, + "y": 107.99995422363281, + "width": 208.0, + "height": 312.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "ad89e0280e524d9999c12e31260bd0a2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ScreenSpaceType": 4 +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "9fa27d76367a4b37b0351f86e835a86e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1996.0001220703125, + "y": -115.0, + "width": 213.0, + "height": 341.0000305175781 + } + }, + "m_Slots": [ + { + "m_Id": "4f283af276d64dac858d0947d1fdbaaa" + }, + { + "m_Id": "353328e353834293ac0840fb8eb6f2c8" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 0, + "to": 3 + }, + "m_ConversionType": 1, + "m_Normalize": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "a6ad0619b0ff4b35b9c068ac56819033", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "ad89e0280e524d9999c12e31260bd0a2", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "aec17fc7875a44f38f7d9153cf74f50f", + "m_Id": 1, + "m_DisplayName": "EXPECTED", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "EXPECTED", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "afd6fed3d8e8461c9ac141b19e55e04d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -321.0, + "y": -86.99998474121094, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "d0bc4074e39847c09e25d45223ff7f12" + }, + { + "m_Id": "fefaeb0050de4b00a9a812607dec2e12" + }, + { + "m_Id": "44ff4c8e37d149f0a0ea59d40128711c" + }, + { + "m_Id": "54f4946a07ec470ab8eec9a158a27258" + } + ], + "synonyms": [ + "mix", + "blend", + "linear interpolate" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b20bd24cda5545cba5f1e7f3fdb7868d", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalizeNode", + "m_ObjectId": "bd41e49cf4f8409f9dfb75d384345a4b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Normalize", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1783.0001220703125, + "y": -115.0, + "width": 208.0, + "height": 278.0000305175781 + } + }, + "m_Slots": [ + { + "m_Id": "2a3224dfa9bd4cae86c581149bb64689" + }, + { + "m_Id": "c9171edd5edd4b8ab9a329ee2f0e0658" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c481840984234183a87b86bd85e4b13d", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c87f1f151ea74a4995743a525e3f011b", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c9171edd5edd4b8ab9a329ee2f0e0658", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "cd74f48ac90a40f49890cd16fbf6660a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -896.0, + "y": 2.0, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "78abf71b291948a891e8fa2a931cac62" + }, + { + "m_Id": "df63aca4443847ec96ffc346ffd297b7" + }, + { + "m_Id": "a6ad0619b0ff4b35b9c068ac56819033" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "cee2261d7bcb4e288eb8e4171fa1e0b9", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d0bc4074e39847c09e25d45223ff7f12", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "d25d1af86a094ac7be2f0127f4634d7b", + "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.SubtractNode", + "m_ObjectId": "d5c0ffaecc9d45f986de4d8925bc0051", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Subtract", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1312.0, + "y": 3.0000650882720949, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "5773db1af68243e0b9bd3ef7d7e70faa" + }, + { + "m_Id": "6a253040a6fd42dcbf025ac7ff33aa6c" + }, + { + "m_Id": "38d77b7f78e54e4e952af3311791ccd4" + } + ], + "synonyms": [ + "subtraction", + "remove", + "minus", + "take away" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.IntegerHashNode", + "m_ObjectId": "d7fc69d9fbd84fe5b18d4361e39b39b9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integer Hash", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2386.999755859375, + "y": 107.99995422363281, + "width": 207.999755859375, + "height": 312.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "21393da4eb4d423a8f0b10e2ec444b34" + }, + { + "m_Id": "8a871f1b8d354b02b2dbcf3aed00bd1d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_HashType": 1 +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "de1092b024884fdf9e8a5171a48ef13e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1996.0001220703125, + "y": 226.00003051757813, + "width": 213.0, + "height": 340.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "e52abb26e3ba40958f14752a649a892c" + }, + { + "m_Id": "6bb1519686984d74ab200c925b9a3676" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 0, + "to": 3 + }, + "m_ConversionType": 1, + "m_Normalize": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "df63aca4443847ec96ffc346ffd297b7", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 200.0, + "e01": 200.0, + "e02": 200.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "e52abb26e3ba40958f14752a649a892c", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e6aff6e4a9b14ff7827921e6353a87a3", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "ebeb58a811964ae1ae55c9969cd6e146", + "m_Title": "Note", + "m_Content": "Since screen position is 0.5 centered, the round on the integer hash is sitting right on the boundary which is unstable.\nWe give it a bit of a push to one side to make sure it's deterministic.\n", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -2630.0, + "y": -133.0, + "width": 200.0, + "height": 172.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "fa72769f37e54f599d367774a779d845", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1104.0, + "y": 3.0000650882720949, + "width": 207.9998779296875, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "76d15710128b4ba5a42566d71f242c7e" + }, + { + "m_Id": "6286951a44ca42e8adf651ceec17a756" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "fc28a5ef65284ed0967870ff69516ffe", + "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": "fc66c175daa9462fa1430c43a99d7698" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "fc66c175daa9462fa1430c43a99d7698", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "fefaeb0050de4b00a9a812607dec2e12", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "ffde04b05e2c42f38093d4ddd027315b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1286.0001220703125, + "y": 410.00006103515627, + "width": 56.0001220703125, + "height": 23.999969482421876 + } + }, + "m_Slots": [ + { + "m_Id": "e6aff6e4a9b14ff7827921e6353a87a3" + }, + { + "m_Id": "34ee9d276de1426ea3815b3e26e80564" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformNormalize.shadergraph.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformNormalize.shadergraph.meta new file mode 100644 index 00000000000..37543d59203 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformNormalize.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f27c372b91c153749bfee96a4083a5fe +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformV1MatchesOldTransform.shadergraph b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformV1MatchesOldTransform.shadergraph new file mode 100644 index 00000000000..48c7b305de4 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformV1MatchesOldTransform.shadergraph @@ -0,0 +1,2265 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "d3a578d5f6c048d989f4fc22763a096c", + "m_Properties": [], + "m_Keywords": [ + { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } + ], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "82645ecd662c4d88a7de4083a8e5b53c" + } + ], + "m_Nodes": [ + { + "m_Id": "fc28a5ef65284ed0967870ff69516ffe" + }, + { + "m_Id": "970cbadefd8f4fcca05f884246b4ad3e" + }, + { + "m_Id": "3ec2632bb2694b7699d26c257e2879ea" + }, + { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + }, + { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + { + "m_Id": "997e733a37a141d4b698281397e00d14" + }, + { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + { + "m_Id": "df18f46740a84dab99307b542e7e9102" + }, + { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + { + "m_Id": "49eb3060313949e8a29142442a4c029a" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [ + { + "m_Id": "ebeb58a811964ae1ae55c9969cd6e146" + }, + { + "m_Id": "fb3521ba1d0e4afc8006f556b4cb15a4" + } + ], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "54d1e21495064ae8982ce8365d45d873" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "997e733a37a141d4b698281397e00d14" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "49eb3060313949e8a29142442a4c029a" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "afd6fed3d8e8461c9ac141b19e55e04d" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "907dd0a26f124143bbc87326f74c2f54" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1746ecad396f45c2808181de7c16ab2d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7fc69d9fbd84fe5b18d4361e39b39b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "df18f46740a84dab99307b542e7e9102" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "de1092b024884fdf9e8a5171a48ef13e" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "df18f46740a84dab99307b542e7e9102" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6dc28149a6e2450a9b06b18a139d8695" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "df18f46740a84dab99307b542e7e9102" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d5c0ffaecc9d45f986de4d8925bc0051" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "fa72769f37e54f599d367774a779d845" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cd74f48ac90a40f49890cd16fbf6660a" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ffde04b05e2c42f38093d4ddd027315b" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3f4fe83ebf4a492c8bd4bd8d039d4e4e" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 362.00006103515627, + "y": -291.0 + }, + "m_Blocks": [ + { + "m_Id": "fc28a5ef65284ed0967870ff69516ffe" + }, + { + "m_Id": "970cbadefd8f4fcca05f884246b4ad3e" + }, + { + "m_Id": "3ec2632bb2694b7699d26c257e2879ea" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 362.00006103515627, + "y": -91.0 + }, + "m_Blocks": [ + { + "m_Id": "65611bc2ea7845359ab31d44dd0816ab" + } + ] + }, + "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_ActiveTargets": [ + { + "m_Id": "1e17856cccb848638b5a1829dd00d4f8" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "07748643054049eea2a69011501a6a15", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SaturateNode", + "m_ObjectId": "1746ecad396f45c2808181de7c16ab2d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Saturate", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -688.0, + "y": 2.0, + "width": 208.0, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "691ae26bade44166941282be4b9e5582" + }, + { + "m_Id": "b20bd24cda5545cba5f1e7f3fdb7868d" + } + ], + "synonyms": [ + "clamp" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.ShaderKeyword", + "m_ObjectId": "1bd0bd2d8a644a369163cb727342c308", + "m_Guid": { + "m_GuidSerialized": "7a8918ce-9570-4947-b06a-6445703e6938" + }, + "m_Name": "MODE", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "MODE", + "m_DefaultReferenceName": "_MODE", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_KeywordType": 1, + "m_KeywordDefinition": 0, + "m_KeywordScope": 0, + "m_KeywordStages": 63, + "m_Entries": [ + { + "id": 3, + "displayName": "DIFF", + "referenceName": "DIFF" + }, + { + "id": 1, + "displayName": "EXPECTED", + "referenceName": "EXPECTED" + }, + { + "id": 2, + "displayName": "ACTUAL", + "referenceName": "ACTUAL" + } + ], + "m_Value": 0, + "m_IsEditable": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "1d11b6b53cef4b47869bbb766c74c0ea", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "1e17856cccb848638b5a1829dd00d4f8", + "m_ActiveSubTarget": { + "m_Id": "416b95b32d794f768b76ab713d607602" + }, + "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_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "21393da4eb4d423a8f0b10e2ec444b34", + "m_Id": 1, + "m_DisplayName": "Coord", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Coord", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "2e230e759137416eae22a09ab75727e6", + "m_Id": 3, + "m_DisplayName": "DIFF", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "DIFF", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "34ee9d276de1426ea3815b3e26e80564", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "38d77b7f78e54e4e952af3311791ccd4", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "3b6e685d10224984b1ec689fc2168cf2", + "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.0, + "y": 0.0, + "z": 0.0 + }, + "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.BlockNode", + "m_ObjectId": "3ec2632bb2694b7699d26c257e2879ea", + "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": "628ef29e9b5d447e9caa4531bcbe6b10" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "3f4fe83ebf4a492c8bd4bd8d039d4e4e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -113.00003051757813, + "y": 363.0000915527344, + "width": 132.0000457763672, + "height": 93.9998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "1d11b6b53cef4b47869bbb766c74c0ea" + }, + { + "m_Id": "07748643054049eea2a69011501a6a15" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "416b95b32d794f768b76ab713d607602" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "42ed096a23f0457eab55df8305100690", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "44ff4c8e37d149f0a0ea59d40128711c", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "49eb3060313949e8a29142442a4c029a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2096.0, + "y": -41.99998474121094, + "width": 208.0, + "height": 303.00006103515627 + } + }, + "m_Slots": [ + { + "m_Id": "cee2261d7bcb4e288eb8e4171fa1e0b9" + }, + { + "m_Id": "c481840984234183a87b86bd85e4b13d" + }, + { + "m_Id": "6b856ac4f8634c3bae87e2ac66690f86" + } + ], + "synonyms": [ + "addition", + "sum", + "plus" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "50f3802c0e1d464abca40855381706b0", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "54d1e21495064ae8982ce8365d45d873", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -113.00003051757813, + "y": -294.9999694824219, + "width": 132.0000457763672, + "height": 94.00001525878906 + } + }, + "m_Slots": [ + { + "m_Id": "c87f1f151ea74a4995743a525e3f011b" + }, + { + "m_Id": "8331dcbe952448e3b4cf2b6523349985" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "54f4946a07ec470ab8eec9a158a27258", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5743e9b1804044f38daa56bd9f883145", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5773db1af68243e0b9bd3ef7d7e70faa", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6286951a44ca42e8adf651ceec17a756", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "628ef29e9b5d447e9caa4531bcbe6b10", + "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.BlockNode", + "m_ObjectId": "65611bc2ea7845359ab31d44dd0816ab", + "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": "3b6e685d10224984b1ec689fc2168cf2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "691ae26bade44166941282be4b9e5582", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6a253040a6fd42dcbf025ac7ff33aa6c", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6b856ac4f8634c3bae87e2ac66690f86", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "6bb1519686984d74ab200c925b9a3676", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "6dc28149a6e2450a9b06b18a139d8695", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1312.0001220703125, + "y": -247.9999542236328, + "width": 56.0001220703125, + "height": 23.999984741210939 + } + }, + "m_Slots": [ + { + "m_Id": "5743e9b1804044f38daa56bd9f883145" + }, + { + "m_Id": "50f3802c0e1d464abca40855381706b0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "76d15710128b4ba5a42566d71f242c7e", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "78abf71b291948a891e8fa2a931cac62", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 200.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "82645ecd662c4d88a7de4083a8e5b53c", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8331dcbe952448e3b4cf2b6523349985", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "8a871f1b8d354b02b2dbcf3aed00bd1d", + "m_Id": 0, + "m_DisplayName": "Hash", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Hash", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.KeywordNode", + "m_ObjectId": "907dd0a26f124143bbc87326f74c2f54", + "m_Group": { + "m_Id": "" + }, + "m_Name": "MODE", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 126.99999237060547, + "y": -91.0, + "width": 208.00003051757813, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "42ed096a23f0457eab55df8305100690" + }, + { + "m_Id": "2e230e759137416eae22a09ab75727e6" + }, + { + "m_Id": "aec17fc7875a44f38f7d9153cf74f50f" + }, + { + "m_Id": "994474eebdcf4c66a55e6ac3838b66ce" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Keyword": { + "m_Id": "1bd0bd2d8a644a369163cb727342c308" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "970cbadefd8f4fcca05f884246b4ad3e", + "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": "d25d1af86a094ac7be2f0127f4634d7b" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "994474eebdcf4c66a55e6ac3838b66ce", + "m_Id": 2, + "m_DisplayName": "ACTUAL", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "ACTUAL", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode", + "m_ObjectId": "997e733a37a141d4b698281397e00d14", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Screen Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2396.0, + "y": 24.000011444091798, + "width": 208.0, + "height": 313.0 + } + }, + "m_Slots": [ + { + "m_Id": "ad89e0280e524d9999c12e31260bd0a2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ScreenSpaceType": 4 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "a0079a38ddea4edca79008d23399c5b1", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "a6ad0619b0ff4b35b9c068ac56819033", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "ad89e0280e524d9999c12e31260bd0a2", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "aec17fc7875a44f38f7d9153cf74f50f", + "m_Id": 1, + "m_DisplayName": "EXPECTED", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "EXPECTED", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "afd6fed3d8e8461c9ac141b19e55e04d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -321.0, + "y": -86.99998474121094, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "d0bc4074e39847c09e25d45223ff7f12" + }, + { + "m_Id": "fefaeb0050de4b00a9a812607dec2e12" + }, + { + "m_Id": "44ff4c8e37d149f0a0ea59d40128711c" + }, + { + "m_Id": "54f4946a07ec470ab8eec9a158a27258" + } + ], + "synonyms": [ + "mix", + "blend", + "linear interpolate" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b20bd24cda5545cba5f1e7f3fdb7868d", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "b8a878cba4724959b9edf1199fa01fd7", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c481840984234183a87b86bd85e4b13d", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c87f1f151ea74a4995743a525e3f011b", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "cd74f48ac90a40f49890cd16fbf6660a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -896.0, + "y": 2.0, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "78abf71b291948a891e8fa2a931cac62" + }, + { + "m_Id": "df63aca4443847ec96ffc346ffd297b7" + }, + { + "m_Id": "a6ad0619b0ff4b35b9c068ac56819033" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "cee2261d7bcb4e288eb8e4171fa1e0b9", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d0bc4074e39847c09e25d45223ff7f12", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 1.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "d25d1af86a094ac7be2f0127f4634d7b", + "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.SubtractNode", + "m_ObjectId": "d5c0ffaecc9d45f986de4d8925bc0051", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Subtract", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1312.0, + "y": 3.0000650882720949, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "5773db1af68243e0b9bd3ef7d7e70faa" + }, + { + "m_Id": "6a253040a6fd42dcbf025ac7ff33aa6c" + }, + { + "m_Id": "38d77b7f78e54e4e952af3311791ccd4" + } + ], + "synonyms": [ + "subtraction", + "remove", + "minus", + "take away" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.IntegerHashNode", + "m_ObjectId": "d7fc69d9fbd84fe5b18d4361e39b39b9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integer Hash", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1847.0001220703125, + "y": 24.000011444091798, + "width": 208.0001220703125, + "height": 313.0 + } + }, + "m_Slots": [ + { + "m_Id": "21393da4eb4d423a8f0b10e2ec444b34" + }, + { + "m_Id": "8a871f1b8d354b02b2dbcf3aed00bd1d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_HashType": 1 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.TransformNode", + "m_ObjectId": "de1092b024884fdf9e8a5171a48ef13e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Transform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1570.0, + "y": 180.00003051757813, + "width": 213.0, + "height": 340.9999084472656 + } + }, + "m_Slots": [ + { + "m_Id": "e52abb26e3ba40958f14752a649a892c" + }, + { + "m_Id": "6bb1519686984d74ab200c925b9a3676" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 2, + "to": 4 + }, + "m_ConversionType": 0, + "m_Normalize": false +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.OldTransformNode", + "m_ObjectId": "df18f46740a84dab99307b542e7e9102", + "m_Group": { + "m_Id": "" + }, + "m_Name": "OldTransform", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1570.0, + "y": -160.99998474121095, + "width": 213.0, + "height": 341.0 + } + }, + "m_Slots": [ + { + "m_Id": "b8a878cba4724959b9edf1199fa01fd7" + }, + { + "m_Id": "a0079a38ddea4edca79008d23399c5b1" + } + ], + "synonyms": [ + "world", + "tangent", + "object", + "view", + "screen", + "convert" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Conversion": { + "from": 3, + "to": 0 + }, + "m_ConversionType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "df63aca4443847ec96ffc346ffd297b7", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 200.0, + "e01": 200.0, + "e02": 200.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "e52abb26e3ba40958f14752a649a892c", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "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_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e6aff6e4a9b14ff7827921e6353a87a3", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "ebeb58a811964ae1ae55c9969cd6e146", + "m_Title": "Note", + "m_Content": "Since screen position is 0.5 centered, the round on the integer hash is sitting right on the boundary which is unstable.\nWe give it a bit of a push to one side to make sure it's deterministic.\n", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -2090.0, + "y": -217.0, + "width": 200.0, + "height": 172.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "fa72769f37e54f599d367774a779d845", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1104.0, + "y": 3.0000650882720949, + "width": 207.9998779296875, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "76d15710128b4ba5a42566d71f242c7e" + }, + { + "m_Id": "6286951a44ca42e8adf651ceec17a756" + } + ], + "synonyms": [ + "positive" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.StickyNoteData", + "m_ObjectId": "fb3521ba1d0e4afc8006f556b4cb15a4", + "m_Title": "Purpose", + "m_Content": "Testing that the new Transform node, in legacy v1 mode, is equivalent to the old Transform node behavior.", + "m_TextSize": 0, + "m_Theme": 0, + "m_Position": { + "serializedVersion": "2", + "x": -1560.0, + "y": -368.0, + "width": 200.0, + "height": 192.0 + }, + "m_Group": { + "m_Id": "" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "fc28a5ef65284ed0967870ff69516ffe", + "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": "fc66c175daa9462fa1430c43a99d7698" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "fc66c175daa9462fa1430c43a99d7698", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "fefaeb0050de4b00a9a812607dec2e12", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "ffde04b05e2c42f38093d4ddd027315b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1286.0001220703125, + "y": 410.00006103515627, + "width": 56.0001220703125, + "height": 23.999969482421876 + } + }, + "m_Slots": [ + { + "m_Id": "e6aff6e4a9b14ff7827921e6353a87a3" + }, + { + "m_Id": "34ee9d276de1426ea3815b3e26e80564" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformV1MatchesOldTransform.shadergraph.meta b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformV1MatchesOldTransform.shadergraph.meta new file mode 100644 index 00000000000..5ea92803467 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Graphs/NodeTests/TransformV1MatchesOldTransform.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 11db3ab64fa437d448ed346df5754a16 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl index 101ab023c97..0995b2d35f6 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl @@ -33,6 +33,11 @@ float4x4 GetWorldToViewMatrix() return UNITY_MATRIX_V; } +float4x4 GetViewToWorldMatrix() +{ + return UNITY_MATRIX_I_V; +} + // Transform to homogenous clip space float4x4 GetWorldToHClipMatrix() { @@ -94,6 +99,11 @@ float3 TransformWorldToView(float3 positionWS) return mul(GetWorldToViewMatrix(), float4(positionWS, 1.0)).xyz; } +float3 TransformViewToWorld(float3 positionVS) +{ + return mul(GetViewToWorldMatrix(), float4(positionVS, 1.0)).xyz; +} + // Transforms position from object space to homogenous space float4 TransformObjectToHClip(float3 positionOS) { @@ -101,13 +111,13 @@ float4 TransformObjectToHClip(float3 positionOS) return mul(GetWorldToHClipMatrix(), mul(GetObjectToWorldMatrix(), float4(positionOS, 1.0))); } -// Tranforms position from world space to homogenous space +// Transforms position from world space to homogenous space float4 TransformWorldToHClip(float3 positionWS) { return mul(GetWorldToHClipMatrix(), float4(positionWS, 1.0)); } -// Tranforms position from view space to homogenous space +// Transforms position from view space to homogenous space float4 TransformWViewToHClip(float3 positionVS) { return mul(GetViewToHClipMatrix(), float4(positionVS, 1.0)); @@ -141,7 +151,7 @@ float3 TransformWorldToObjectDir(float3 dirWS, bool doNormalize = true) return dirOS; } -// Tranforms vector from world space to view space +// Transforms vector from world space to view space real3 TransformWorldToViewDir(real3 dirWS, bool doNormalize = false) { float3 dirVS = mul((real3x3)GetWorldToViewMatrix(), dirWS).xyz; @@ -151,7 +161,31 @@ real3 TransformWorldToViewDir(real3 dirWS, bool doNormalize = false) return dirVS; } -// Tranforms vector from world space to homogenous space +// Transforms vector from view space to world space +real3 TransformViewToWorldDir(real3 dirVS, bool doNormalize = false) +{ + float3 dirWS = mul((real3x3)GetViewToWorldMatrix(), dirVS).xyz; + if (doNormalize) + return normalize(dirWS); + + return dirWS; +} + +// Transforms normal from world space to view space +real3 TransformWorldToViewNormal(real3 normalWS, bool doNormalize = false) +{ + // assuming view matrix is uniformly scaled, we can use direction transform + return TransformWorldToViewDir(normalWS, doNormalize); +} + +// Transforms normal from view space to world space +real3 TransformViewToWorldNormal(real3 normalVS, bool doNormalize = false) +{ + // assuming view matrix is uniformly scaled, we can use direction transform + return TransformViewToWorldDir(normalVS, doNormalize); +} + +// Transforms vector from world space to homogenous space real3 TransformWorldToHClipDir(real3 directionWS, bool doNormalize = false) { float3 dirHCS = mul((real3x3)GetWorldToHClipMatrix(), directionWS).xyz; @@ -200,16 +234,23 @@ real3x3 CreateTangentToWorld(real3 normal, real3 tangent, real flipSign) return real3x3(tangent, bitangent, normal); } -real3 TransformTangentToWorld(real3 dirTS, real3x3 tangentToWorld) +// this function is intended to work on Normals (handles non-uniform scale) +// tangentToWorld is the matrix representing the transformation of a normal from tangent to world space +real3 TransformTangentToWorld(real3 normalTS, real3x3 tangentToWorld, bool doNormalize = false) { // Note matrix is in row major convention with left multiplication as it is build on the fly - return mul(dirTS, tangentToWorld); + real3 result = mul(normalTS, tangentToWorld); + if (doNormalize) + return SafeNormalize(result); + return result; } +// this function is intended to work on Normals (handles non-uniform scale) // This function does the exact inverse of TransformTangentToWorld() and is // also decribed within comments in mikktspace.h and it follows implicitly // from the scalar triple product (google it). -real3 TransformWorldToTangent(real3 dirWS, real3x3 tangentToWorld) +// tangentToWorld is the matrix representing the transformation of a normal from tangent to world space +real3 TransformWorldToTangent(real3 normalWS, real3x3 tangentToWorld, bool doNormalize = true) { // Note matrix is in row major convention with left multiplication as it is build on the fly float3 row0 = tangentToWorld[0]; @@ -222,16 +263,64 @@ real3 TransformWorldToTangent(real3 dirWS, real3x3 tangentToWorld) float3 col2 = cross(row0, row1); float determinant = dot(row0, col0); - float sgn = determinant<0.0 ? (-1.0) : 1.0; // inverse transposed but scaled by determinant // Will remove transpose part by using matrix as the first arg in the mul() below // this makes it the exact inverse of what TransformTangentToWorld() does. real3x3 matTBN_I_T = real3x3(col0, col1, col2); + real3 result = mul(matTBN_I_T, normalWS); + if (doNormalize) + { + float sgn = determinant < 0.0 ? (-1.0) : 1.0; + return SafeNormalize(sgn * result); + } + else + return result / determinant; +} - return SafeNormalize( sgn * mul(matTBN_I_T, dirWS) ); +// this function is intended to work on Vectors/Directions +// tangentToWorld is the matrix representing the transformation of a normal from tangent to world space +real3 TransformWorldToTangentDir(real3 dirWS, real3x3 tangentToWorld, bool doNormalize = false) +{ + // Note matrix is in row major convention with left multiplication as it is build on the fly + real3 result = mul(tangentToWorld, dirWS); + if (doNormalize) + return SafeNormalize(result); + return result; +} + +// this function is intended to work on Vectors/Directions +// This function does the exact inverse of TransformWorldToTangentDir() +// tangentToWorld is the matrix representing the transformation of a normal from tangent to world space +real3 TransformTangentToWorldDir(real3 dirWS, real3x3 tangentToWorld, bool doNormalize = false) +{ + // Note matrix is in row major convention with left multiplication as it is build on the fly + float3 row0 = tangentToWorld[0]; + float3 row1 = tangentToWorld[1]; + float3 row2 = tangentToWorld[2]; + + // these are the columns of the inverse matrix but scaled by the determinant + float3 col0 = cross(row1, row2); + float3 col1 = cross(row2, row0); + float3 col2 = cross(row0, row1); + + float determinant = dot(row0, col0); + + // inverse transposed but scaled by determinant + // Will remove transpose part by using matrix as the second arg in the mul() below + // this makes it the exact inverse of what TransformWorldToTangentDir() does. + real3x3 matTBN_I_T = real3x3(col0, col1, col2); + real3 result = mul(dirWS, matTBN_I_T); + if (doNormalize) + { + float sgn = determinant < 0.0 ? (-1.0) : 1.0; + return SafeNormalize(sgn * result); + } + else + return result / determinant; } +// tangentToWorld is the matrix representing the transformation of a normal from tangent to world space real3 TransformTangentToObject(real3 dirTS, real3x3 tangentToWorld) { // Note matrix is in row major convention with left multiplication as it is build on the fly @@ -239,6 +328,7 @@ real3 TransformTangentToObject(real3 dirTS, real3x3 tangentToWorld) return TransformWorldToObjectNormal(normalWS); } +// tangentToWorld is the matrix representing the transformation of a normal from tangent to world space real3 TransformObjectToTangent(real3 dirOS, real3x3 tangentToWorld) { // Note matrix is in row major convention with left multiplication as it is build on the fly diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfilePropertyDrawer.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfilePropertyDrawer.cs index 9d47aab3edb..ede57af4505 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfilePropertyDrawer.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/DiffusionProfilePropertyDrawer.cs @@ -49,6 +49,8 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } [CustomPropertyDrawer(typeof(DiffusionProfileSettings))] diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 351127708c0..a356faa189c 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -36,6 +36,7 @@ The version number for this package has increased due to a version update of a r - Fixed the Scene Depth node so it returns proper results in Eye space when using an orthographic camera [1311272] - Fixed the sticky-note editable title text size in shader graph not matching the set font size [1357657]. - Fixed how graph errors were displayed when variant limits were reached [1355815] + - Fixed errors in the ShaderGraph Transform node [1368082] ## [12.0.0] - 2021-01-11 @@ -70,6 +71,7 @@ The version number for this package has increased due to a version update of a r - Added visible errors for invalid stage capability connections to shader graph. - Added a ShaderGraph animated preview framerate throttle. - Added many node synonyms for the Create Node search so that it's easier to find nodes. + - Added normal transforms to the Transform node ### Changed - Properties and Keywords are no longer separated by type on the blackboard. Categories allow for any combination of properties and keywords to be grouped together as the user defines. diff --git a/com.unity.shadergraph/Editor/Data/Interfaces/IPropertyDrawer.cs b/com.unity.shadergraph/Editor/Data/Interfaces/IPropertyDrawer.cs index b43a4ab3ef1..7cd825769da 100644 --- a/com.unity.shadergraph/Editor/Data/Interfaces/IPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Data/Interfaces/IPropertyDrawer.cs @@ -11,5 +11,7 @@ public interface IPropertyDrawer Action inspectorUpdateDelegate { get; set; } VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject, InspectableAttribute attribute); + + void DisposePropertyDrawer(); } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs index f038fc041b2..15b1fc96e0a 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs @@ -6,12 +6,6 @@ namespace UnityEditor.ShaderGraph { - enum ConversionType - { - Position, - Direction - } - [Serializable] struct CoordinateSpaceConversion : IEnumConversion { @@ -38,9 +32,9 @@ Enum IEnumConversion.to } [Title("Math", "Vector", "Transform")] - class TransformNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireTangent, IMayRequireBitangent, IMayRequireNormal, IMayRequireTransform + class TransformNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireTangent, IMayRequireBitangent, IMayRequireNormal, IMayRequireTransform, IMayRequirePosition { - public override int latestVersion => 1; + public override int latestVersion => 2; private const int InputSlotId = 0; private const int OutputSlotId = 1; @@ -86,6 +80,20 @@ public ConversionType conversionType } } + [SerializeField] + bool m_Normalize = false; + public bool normalize + { + get { return m_Normalize; } + set + { + if (Equals(m_Normalize, value)) + return; + m_Normalize = value; + Dirty(ModificationScope.Graph); + } + } + public override bool hasPreview { get { return true; } @@ -101,165 +109,16 @@ public sealed override void UpdateNodeAfterDeserialization() public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { NodeUtils.SlotConfigurationExceptionIfBadConfiguration(this, new[] { InputSlotId }, new[] { OutputSlotId }); - string inputValue = string.Format("{0}.xyz", GetSlotValue(InputSlotId, generationMode)); - string targetTransformString = GetVariableNameForNode() + "_tangentTransform_" + conversion.from.ToString(); - string transposeTargetTransformString = GetVariableNameForNode() + "_transposeTangent"; - string transformString = ""; - string tangentTransformSpace = conversion.from.ToString(); - bool requiresTangentTransform = false; - bool requiresTransposeTangentTransform = false; - if (conversion.from == CoordinateSpace.World) - { - if (conversion.to == CoordinateSpace.World) - { - transformString = inputValue; - } - else if (conversion.to == CoordinateSpace.Object) - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToObjectDir({0})" : "TransformWorldToObject({0})", inputValue); - } - else if (conversion.to == CoordinateSpace.Tangent) - { - requiresTangentTransform = true; - transformString = string.Format("TransformWorldToTangent({0}, {1})", inputValue, targetTransformString); - } - else if (conversion.to == CoordinateSpace.View) - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir({0})" : "TransformWorldToView({0})", inputValue); - } - else if (conversion.to == CoordinateSpace.AbsoluteWorld) - { - transformString = string.Format("GetAbsolutePositionWS({0})", inputValue); - } - } - else if (conversion.from == CoordinateSpace.Object) - { - if (conversion.to == CoordinateSpace.World) - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformObjectToWorldDir({0})" : "TransformObjectToWorld({0})", inputValue); - } - else if (conversion.to == CoordinateSpace.Object) - { - transformString = inputValue; - } - else if (conversion.to == CoordinateSpace.Tangent) - { - requiresTangentTransform = true; - tangentTransformSpace = CoordinateSpace.World.ToString(); - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToTangent(TransformObjectToWorldDir({0}), {1})" : "TransformWorldToTangent(TransformObjectToWorld({0}), {1})", inputValue, targetTransformString); - } - else if (conversion.to == CoordinateSpace.View) - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir(TransformObjectToWorldDir({0}))" : "TransformWorldToView(TransformObjectToWorld({0}))", inputValue); - } - if (conversion.to == CoordinateSpace.AbsoluteWorld) - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformObjectToWorldDir({0})" : "GetAbsolutePositionWS(TransformObjectToWorld({0}))", inputValue); - } - } - else if (conversion.from == CoordinateSpace.Tangent) - { - if (conversion.to == CoordinateSpace.World) - { - requiresTransposeTangentTransform = true; - transformString = string.Format(conversionType == ConversionType.Direction ? "normalize(mul({0}, {1}).xyz)" : "mul({0}, {1}).xyz", transposeTargetTransformString, inputValue); - } - else if (conversion.to == CoordinateSpace.Object) - { - requiresTransposeTangentTransform = true; - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToObjectDir(mul({0}, {1}).xyz)" : "TransformWorldToObject(mul({0}, {1}).xyz)", transposeTargetTransformString, inputValue); - } - else if (conversion.to == CoordinateSpace.Tangent) - { - transformString = inputValue; - } - else if (conversion.to == CoordinateSpace.View) - { - requiresTransposeTangentTransform = true; - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir(mul({0}, {1}).xyz)" : "TransformWorldToView(mul({0}, {1}).xyz)", transposeTargetTransformString, inputValue); - } - if (conversion.to == CoordinateSpace.AbsoluteWorld) - { - requiresTransposeTangentTransform = true; - transformString = string.Format("GetAbsolutePositionWS(mul({0}, {1})).xyz", transposeTargetTransformString, inputValue); - } - } - else if (conversion.from == CoordinateSpace.View) - { - if (conversion.to == CoordinateSpace.World) - { - transformString = string.Format(conversionType == ConversionType.Direction ? - "mul(UNITY_MATRIX_I_V, $precision4({0}, 0)).xyz" : - "mul(UNITY_MATRIX_I_V, $precision4({0}, 1)).xyz", inputValue); - } - else if (conversion.to == CoordinateSpace.Object) - { - transformString = string.Format(conversionType == ConversionType.Direction ? - "TransformWorldToObjectDir(mul((float3x3)UNITY_MATRIX_I_V, {0}))" : - "TransformWorldToObject(mul(UNITY_MATRIX_I_V, $precision4({0}, 1) ).xyz)", inputValue); - } - else if (conversion.to == CoordinateSpace.Tangent) - { - requiresTangentTransform = true; - tangentTransformSpace = CoordinateSpace.World.ToString(); - transformString = string.Format("TransformWorldToTangent(mul(UNITY_MATRIX_I_V, $precision4({0}, 1) ).xyz, {1})", inputValue, targetTransformString); - } - else if (conversion.to == CoordinateSpace.View) - { - transformString = inputValue; - } - else if (conversion.to == CoordinateSpace.AbsoluteWorld) - { - transformString = string.Format("GetAbsolutePositionWS(mul(UNITY_MATRIX_I_V, $precision4({0}, 1))).xyz", inputValue); - } - } - else if (conversion.from == CoordinateSpace.AbsoluteWorld) - { - if (conversion.to == CoordinateSpace.World) - { - transformString = string.Format("GetCameraRelativePositionWS({0})", inputValue); - } - else if (conversion.to == CoordinateSpace.Object) - { - if (m_SGVersion == 0) - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToObjectDir(GetCameraRelativePositionWS({0}))" : "TransformWorldToObject(GetCameraRelativePositionWS({0}))", inputValue); - } - else - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToObjectDir({0})" : "TransformWorldToObject(GetCameraRelativePositionWS({0}))", inputValue); - } - } - else if (conversion.to == CoordinateSpace.Tangent) - { - requiresTangentTransform = true; - tangentTransformSpace = CoordinateSpace.World.ToString(); - transformString = string.Format("TransformWorldToTangent(GetCameraRelativePositionWS({0}), {1})", inputValue, targetTransformString); - } - else if (conversion.to == CoordinateSpace.View) - { - if (m_SGVersion == 0) - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir(GetCameraRelativePositionWS({0}))" : "TransformWorldToView(GetCameraRelativePositionWS({0}))", inputValue); - } - else - { - transformString = string.Format(conversionType == ConversionType.Direction ? "TransformWorldToViewDir({0})" : "TransformWorldToView(GetCameraRelativePositionWS({0}))", inputValue); - } - } - else if (conversion.to == CoordinateSpace.AbsoluteWorld) - { - transformString = inputValue; - } - } - if (requiresTransposeTangentTransform) - sb.AppendLine(string.Format("$precision3x3 {0} = transpose($precision3x3(IN.{1}SpaceTangent, IN.{1}SpaceBiTangent, IN.{1}SpaceNormal));", transposeTargetTransformString, CoordinateSpace.World.ToString())); - else if (requiresTangentTransform) - sb.AppendLine(string.Format("$precision3x3 {0} = $precision3x3(IN.{1}SpaceTangent, IN.{1}SpaceBiTangent, IN.{1}SpaceNormal);", targetTransformString, tangentTransformSpace)); - sb.AppendLine("{0} {1} = {2};", FindOutputSlot(OutputSlotId).concreteValueType.ToShaderString(), - GetVariableNameForSlot(OutputSlotId), - transformString); + var xform = new SpaceTransform(conversion.from, conversion.to, conversionType, normalize, sgVersion); + + string inputValue = $"{GetSlotValue(InputSlotId, generationMode)}.xyz"; + string outputVariable = GetVariableNameForSlot(OutputSlotId); + string outputType = FindOutputSlot(OutputSlotId).concreteValueType.ToShaderString(); + + // declare output variable and fill it out + sb.AddLine(outputType, " ", outputVariable, ";"); + SpaceTransformUtil.GenerateTransformCodeStatement(xform, inputValue, outputVariable, sb); } bool RequiresWorldSpaceTangentTransform() @@ -301,5 +160,15 @@ public NeededTransform[] RequiresTransform(ShaderStageCapability stageCapability new NeededTransform(conversion.from.ToNeededCoordinateSpace(), conversion.to.ToNeededCoordinateSpace()) }; } + + NeededCoordinateSpace IMayRequirePosition.RequiresPosition(ShaderStageCapability stageCapability) + { + // tangent space transforms need world position + if (sgVersion > 1) + if ((conversion.from == CoordinateSpace.Tangent) || (conversion.to == CoordinateSpace.Tangent)) + return NeededCoordinateSpace.World; + + return NeededCoordinateSpace.None; + } } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs.meta b/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs.meta index 8871e2dbdb5..77767a717e4 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs.meta +++ b/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 guid: 1d252394349e74b278276a6e0857635e -timeCreated: 1490745697 -licenseType: Pro MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/com.unity.shadergraph/Editor/Data/Util/SpaceTransformUtil.cs b/com.unity.shadergraph/Editor/Data/Util/SpaceTransformUtil.cs new file mode 100644 index 00000000000..5c146ce7373 --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Util/SpaceTransformUtil.cs @@ -0,0 +1,364 @@ +// using System; +using UnityEditor.ShaderGraph.Internal; + +namespace UnityEditor.ShaderGraph +{ + enum ConversionType + { + Position, + Direction, + Normal + } + + internal struct SpaceTransform + { + public CoordinateSpace from; + public CoordinateSpace to; + public ConversionType type; + public bool normalize; + public int version; + + public const int kLatestVersion = 2; + + public SpaceTransform(CoordinateSpace from, CoordinateSpace to, ConversionType type, bool normalize = false, int version = kLatestVersion) + { + this.from = from; + this.to = to; + this.type = type; + this.normalize = normalize; + this.version = version; + } + + internal string NormalizeString() + { + return normalize ? "true" : "false"; + } + }; + + static class SpaceTransformUtil + { + delegate void TransformFunction(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb); + + public static string GenerateTangentTransform(ShaderStringBuilder sb, CoordinateSpace tangentTransformSpace) + { + sb.AddLine("$precision3x3 tangentTransform = $precision3x3(IN.", + tangentTransformSpace.ToString(), "SpaceTangent, IN.", + tangentTransformSpace.ToString(), "SpaceBiTangent, IN.", + tangentTransformSpace.ToString(), "SpaceNormal);"); + return "tangentTransform"; + } + + public static void Identity(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + // identity didn't normalize before version 2 + if ((xform.version > 1) && xform.normalize && (xform.type != ConversionType.Position)) + sb.AddLine(outputVariable, " = SafeNormalize(", inputValue, ");"); + else + sb.AddLine(outputVariable, " = ", inputValue, ";"); + } + + private static void ViaWorld(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + // should never be calling this if one of the spaces is already world space (silly, and could lead to infinite recursions) + if ((xform.from == CoordinateSpace.World) || (xform.to == CoordinateSpace.World)) + return; + + // this breaks the transform into two parts: (from->world) and (world->to) + var toWorld = new SpaceTransform() + { + from = xform.from, + to = CoordinateSpace.World, + type = xform.type, + normalize = false, + version = xform.version + }; + + var fromWorld = new SpaceTransform() + { + from = CoordinateSpace.World, + to = xform.to, + type = xform.type, + normalize = xform.normalize, + version = xform.version + }; + + // Apply Versioning Hacks to match old (incorrect) versions + if (xform.version <= 1) + { + if (xform.type == ConversionType.Direction) + { + switch (xform.from) + { + case CoordinateSpace.AbsoluteWorld: + if ((xform.to == CoordinateSpace.Object) || (xform.to == CoordinateSpace.View)) + { + // these transforms were wrong in v0, but correct in v1, so here we + // pretend it is a later version to disable the v1 versioning in the AbsWorldToWorld transform + if (xform.version == 1) + toWorld.version = 2; + } + break; + case CoordinateSpace.View: + if ((xform.to == CoordinateSpace.Tangent) || (xform.to == CoordinateSpace.AbsoluteWorld)) + { + // these transforms erroneously used the position view-to-world transform + toWorld.type = ConversionType.Position; + } + break; + case CoordinateSpace.Tangent: + if ((xform.to == CoordinateSpace.Object) || (xform.to == CoordinateSpace.View) || (xform.to == CoordinateSpace.AbsoluteWorld)) + { + // manually version to 2, to remove normalization (while keeping Normal type) + toWorld.type = ConversionType.Normal; + toWorld.version = 2; + } + break; + } + } + } + + using (sb.BlockScope()) + { + sb.AddLine("// Converting ", xform.type.ToString(), " from ", xform.from.ToString(), " to ", xform.to.ToString(), " via world space"); + sb.AddLine("float3 world;"); + GenerateTransformCodeStatement(toWorld, inputValue, "world", sb); + GenerateTransformCodeStatement(fromWorld, "world", outputVariable, sb); + } + } + + public static void WorldToObject(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + switch (xform.type) + { + case ConversionType.Position: + sb.AddLine(outputVariable, " = TransformWorldToObject(", inputValue, ");"); + break; + case ConversionType.Direction: + if (xform.version <= 1) + xform.normalize = true; + sb.AddLine(outputVariable, " = TransformWorldToObjectDir(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + case ConversionType.Normal: + sb.AddLine(outputVariable, " = TransformWorldToObjectNormal(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + } + } + + public static void WorldToTangent(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + if (xform.version <= 1) + { + // prior to version 2, all transform were normalized, and all transforms were Normal transforms + xform.normalize = true; + xform.type = ConversionType.Normal; + } + + using (sb.BlockScope()) + { + string tangentTransform = GenerateTangentTransform(sb, xform.from); + + switch (xform.type) + { + case ConversionType.Position: + sb.AddLine(outputVariable, " = TransformWorldToTangentDir(", inputValue, " - IN.WorldSpacePosition, ", tangentTransform, ", false);"); + break; + case ConversionType.Direction: + sb.AddLine(outputVariable, " = TransformWorldToTangentDir(", inputValue, ", ", tangentTransform, ", ", xform.NormalizeString(), ");"); + break; + case ConversionType.Normal: + sb.AddLine(outputVariable, " = TransformWorldToTangent(", inputValue, ", ", tangentTransform, ", ", xform.NormalizeString(), ");"); + break; + } + } + } + + public static void WorldToView(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + switch (xform.type) + { + case ConversionType.Position: + sb.AddLine(outputVariable, " = TransformWorldToView(", inputValue, ");"); + break; + case ConversionType.Direction: + if (xform.version <= 1) + xform.normalize = false; + sb.AddLine(outputVariable, " = TransformWorldToViewDir(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + case ConversionType.Normal: + sb.AddLine(outputVariable, " = TransformWorldToViewNormal(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + } + } + + public static void WorldToAbsoluteWorld(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + // prior to version 2 always used Position transform + if (xform.version <= 1) + xform.type = ConversionType.Position; + + switch (xform.type) + { + case ConversionType.Position: + sb.AddLine(outputVariable, " = GetAbsolutePositionWS(", inputValue, ");"); + break; + case ConversionType.Direction: + case ConversionType.Normal: + // both normal and direction are unchanged + if (xform.normalize) + sb.AddLine(outputVariable, " = SafeNormalize(", inputValue, ");"); + else + sb.AddLine(outputVariable, " = ", inputValue, ";"); + break; + } + } + + public static void ObjectToWorld(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + switch (xform.type) + { + case ConversionType.Position: + sb.AddLine(outputVariable, " = TransformObjectToWorld(", inputValue, ");"); + break; + case ConversionType.Direction: + if (xform.version <= 1) + xform.normalize = true; + sb.AddLine(outputVariable, " = TransformObjectToWorldDir(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + case ConversionType.Normal: + sb.AddLine(outputVariable, " = TransformObjectToWorldNormal(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + } + } + + public static void ObjectToAbsoluteWorld(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + switch (xform.type) + { + case ConversionType.Position: + ViaWorld(xform, inputValue, outputVariable, sb); + break; + case ConversionType.Direction: + if (xform.version <= 1) + xform.normalize = true; + sb.AddLine(outputVariable, " = TransformObjectToWorldDir(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + case ConversionType.Normal: + sb.AddLine(outputVariable, " = TransformObjectToWorldNormal(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + } + } + + public static void TangentToWorld(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + // prior to version 2 all transforms were Normal, and directional transforms were normalized + if (xform.version <= 1) + { + if (xform.type != ConversionType.Position) + xform.normalize = true; + xform.type = ConversionType.Normal; + } + + using (sb.BlockScope()) + { + string tangentTransform = GenerateTangentTransform(sb, CoordinateSpace.World); + switch (xform.type) + { + case ConversionType.Position: + sb.AddLine(outputVariable, " = TransformTangentToWorldDir(", inputValue, ", ", tangentTransform, ", false).xyz + IN.WorldSpacePosition;"); + break; + case ConversionType.Direction: + sb.AddLine(outputVariable, " = TransformTangentToWorldDir(", inputValue, ", ", tangentTransform, ", ", xform.NormalizeString(), ").xyz;"); + break; + case ConversionType.Normal: + sb.AddLine(outputVariable, " = TransformTangentToWorld(", inputValue, ", ", tangentTransform, ", ", xform.NormalizeString(), ");"); + break; + } + } + } + + public static void ViewToWorld(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + switch (xform.type) + { + case ConversionType.Position: + sb.AddLine(outputVariable, " = TransformViewToWorld(", inputValue, ");"); + break; + case ConversionType.Direction: + if (xform.version <= 1) + xform.normalize = false; + sb.AddLine(outputVariable, " = TransformViewToWorldDir(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + case ConversionType.Normal: + sb.AddLine(outputVariable, " = TransformViewToWorldNormal(", inputValue, ", ", xform.NormalizeString(), ");"); + break; + } + } + + public static void AbsoluteWorldToWorld(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + // prior to version 2, always used position transform + if (xform.version <= 1) + xform.type = ConversionType.Position; + + switch (xform.type) + { + case ConversionType.Position: + sb.AddLine(outputVariable, " = GetCameraRelativePositionWS(", inputValue, ");"); + break; + case ConversionType.Direction: + case ConversionType.Normal: + // both normal and direction are unchanged + if (xform.normalize) + sb.AddLine(outputVariable, " = SafeNormalize(", inputValue, ");"); + else + sb.AddLine(outputVariable, " = ", inputValue, ";"); + break; + } + } + + static readonly TransformFunction[,] k_TransformFunctions = new TransformFunction[5, 5] // [from, to] + { + { // from CoordinateSpace.Object + Identity, // to CoordinateSpace.Object + ViaWorld, // to CoordinateSpace.View + ObjectToWorld, // to CoordinateSpace.World + ViaWorld, // to CoordinateSpace.Tangent + ObjectToAbsoluteWorld, // to CoordinateSpace.AbsoluteWorld + }, + { // from CoordinateSpace.View + ViaWorld, // to CoordinateSpace.Object + Identity, // to CoordinateSpace.View + ViewToWorld, // to CoordinateSpace.World + ViaWorld, // to CoordinateSpace.Tangent + ViaWorld, // to CoordinateSpace.AbsoluteWorld + }, + { // from CoordinateSpace.World + WorldToObject, // to CoordinateSpace.Object + WorldToView, // to CoordinateSpace.View + Identity, // to CoordinateSpace.World + WorldToTangent, // to CoordinateSpace.Tangent + WorldToAbsoluteWorld, // to CoordinateSpace.AbsoluteWorld + }, + { // from CoordinateSpace.Tangent + ViaWorld, // to CoordinateSpace.Object + ViaWorld, // to CoordinateSpace.View + TangentToWorld, // to CoordinateSpace.World + Identity, // to CoordinateSpace.Tangent + ViaWorld, // to CoordinateSpace.AbsoluteWorld + }, + { // from CoordinateSpace.AbsoluteWorld + ViaWorld, // to CoordinateSpace.Object + ViaWorld, // to CoordinateSpace.View + AbsoluteWorldToWorld, // to CoordinateSpace.World + ViaWorld, // to CoordinateSpace.Tangent + Identity, // to CoordinateSpace.AbsoluteWorld + } + }; + + public static void GenerateTransformCodeStatement(SpaceTransform xform, string inputValue, string outputVariable, ShaderStringBuilder sb) + { + var func = k_TransformFunctions[(int)xform.from, (int)xform.to]; + func(xform, inputValue, outputVariable, sb); + } + } +} diff --git a/com.unity.shadergraph/Editor/Data/Util/SpaceTransformUtil.cs.meta b/com.unity.shadergraph/Editor/Data/Util/SpaceTransformUtil.cs.meta new file mode 100644 index 00000000000..0da66c60117 --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Util/SpaceTransformUtil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd2b12a40ed6b7d40bb34740b5b6728a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs index 02005a22d78..fb8ff832756 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs @@ -36,6 +36,8 @@ class InspectorView : GraphSubWindow protected VisualElement m_GraphSettingsContainer; protected VisualElement m_NodeSettingsContainer; + List m_AllActivePropertyDrawers = new List(); + Label m_MaxItemsMessageLabel; void RegisterPropertyDrawer(Type newPropertyDrawerType) @@ -131,6 +133,11 @@ public void TriggerInspectorUpdate(IEnumerable selectionList) public void Update() { + // Tear down all existing active property drawers, everything is getting rebuilt + foreach (IPropertyDrawer propDrawer in m_AllActivePropertyDrawers) + propDrawer.DisposePropertyDrawer(); + m_AllActivePropertyDrawers.Clear(); + ShowGraphSettings_Internal(m_GraphSettingsContainer); m_NodeSettingsContainer.Clear(); @@ -191,7 +198,7 @@ void DrawInspectable( IInspectable inspectable, IPropertyDrawer propertyDrawerToUse = null) { - InspectorUtils.GatherInspectorContent(m_PropertyDrawerList, outputVisualElement, inspectable, TriggerInspectorUpdate, propertyDrawerToUse); + InspectorUtils.GatherInspectorContent(m_PropertyDrawerList, outputVisualElement, inspectable, TriggerInspectorUpdate, m_AllActivePropertyDrawers, propertyDrawerToUse); } internal void HandleGraphChanges() @@ -222,11 +229,12 @@ void TriggerInspectorUpdate() // which for SG, is a representation of the settings in GraphData protected virtual void ShowGraphSettings_Internal(VisualElement contentContainer) { + contentContainer.Clear(); + var graphEditorView = ParentView.GetFirstAncestorOfType(); if (graphEditorView == null) return; - contentContainer.Clear(); DrawInspectable(contentContainer, (IInspectable)ParentView, m_graphSettingsPropertyDrawer); contentContainer.MarkDirtyRepaint(); } @@ -239,6 +247,7 @@ internal static void GatherInspectorContent( VisualElement outputVisualElement, IInspectable inspectable, Action propertyChangeCallback, + List allPropertyDrawerInstances, IPropertyDrawer propertyDrawerToUse = null) { var dataObject = inspectable.GetObjectToInspect(); @@ -257,16 +266,23 @@ internal static void GatherInspectorContent( var propertyType = propertyInfo.GetGetMethod(true).Invoke(inspectable, new object[] { }).GetType(); - if (IsPropertyTypeHandled(propertyDrawerList, propertyType, out var propertyDrawerTypeToUse)) + var propertyDrawerInstance = propertyDrawerToUse; + if (propertyDrawerInstance == null) + { + if (IsPropertyTypeHandled(propertyDrawerList, propertyType, out var propertyDrawerTypeToUse)) + propertyDrawerInstance = (IPropertyDrawer)Activator.CreateInstance(propertyDrawerTypeToUse); + } + + if (propertyDrawerInstance != null) { - var propertyDrawerInstance = propertyDrawerToUse ?? - (IPropertyDrawer)Activator.CreateInstance(propertyDrawerTypeToUse); // Assign the inspector update delegate so any property drawer can trigger an inspector update if it needs it propertyDrawerInstance.inspectorUpdateDelegate = propertyChangeCallback; // Supply any required data to this particular kind of property drawer inspectable.SupplyDataToPropertyDrawer(propertyDrawerInstance, propertyChangeCallback); var propertyGUI = propertyDrawerInstance.DrawProperty(propertyInfo, dataObject, attribute); outputVisualElement.Add(propertyGUI); + if (allPropertyDrawerInstances != null) + allPropertyDrawerInstances.Add(propertyDrawerInstance); } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs index fd57efc6d23..38558fe06ff 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs @@ -82,5 +82,11 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute, out var propertyVisualElement); } + + internal virtual void DisposePropertyDrawer() + { + } + + void IPropertyDrawer.DisposePropertyDrawer() { DisposePropertyDrawer(); } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/BoolPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/BoolPropertyDrawer.cs index 67622f49b43..1988b40d113 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/BoolPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/BoolPropertyDrawer.cs @@ -51,5 +51,7 @@ public VisualElement DrawProperty( attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ColorPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ColorPropertyDrawer.cs index 490ec11ee9e..ffde2e0aa0a 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ColorPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ColorPropertyDrawer.cs @@ -44,5 +44,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CubemapPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CubemapPropertyDrawer.cs index f3c9d0ea9dc..33d135166b8 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CubemapPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CubemapPropertyDrawer.cs @@ -45,5 +45,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs index 22cdd5b5643..2aa004fc484 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs @@ -55,5 +55,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/DropdownPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/DropdownPropertyDrawer.cs index 806229b30e5..363a6cfb7ba 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/DropdownPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/DropdownPropertyDrawer.cs @@ -45,5 +45,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var textArrayField); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/EnumPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/EnumPropertyDrawer.cs index fdcf7c715a1..5cade065e88 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/EnumPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/EnumPropertyDrawer.cs @@ -50,5 +50,7 @@ public VisualElement DrawProperty( (Enum)attribute.defaultValue, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/FloatPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/FloatPropertyDrawer.cs index f32c86fbb39..1b103f716dd 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/FloatPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/FloatPropertyDrawer.cs @@ -45,5 +45,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GradientPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GradientPropertyDrawer.cs index c76497386ce..6225b8a306d 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GradientPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GradientPropertyDrawer.cs @@ -46,5 +46,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GraphDataPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GraphDataPropertyDrawer.cs index 10dffae3421..29f12b50e11 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GraphDataPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/GraphDataPropertyDrawer.cs @@ -206,5 +206,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject { return this.CreateGUI((GraphData)actualObject); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/IntegerPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/IntegerPropertyDrawer.cs index fe6159ded8f..20fdc5070cf 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/IntegerPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/IntegerPropertyDrawer.cs @@ -46,5 +46,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/MatrixPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/MatrixPropertyDrawer.cs index 451aa23b5d5..09272f11b8e 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/MatrixPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/MatrixPropertyDrawer.cs @@ -368,5 +368,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SampleVirtualTextureNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SampleVirtualTextureNodePropertyDrawer.cs index 29769afafd6..8914625c4e9 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SampleVirtualTextureNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SampleVirtualTextureNodePropertyDrawer.cs @@ -141,5 +141,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs index b1a41bf18ff..150bc69d6d8 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SamplerStateNodePropertyDrawer.cs @@ -7,7 +7,7 @@ namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers { [SGPropertyDrawer(typeof(SamplerStateNode))] - class SamplerStateNodeNodePropertyDrawer : AbstractMaterialNodePropertyDrawer + class SamplerStateNodePropertyDrawer : AbstractMaterialNodePropertyDrawer { internal override void AddCustomNodeProperties(VisualElement parentElement, AbstractMaterialNode nodeBase, Action setNodesAsDirtyCallback, Action updateNodeViewsCallback) { diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index 09f14a11953..b66dc59a9c8 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -159,6 +159,8 @@ public VisualElement DrawProperty( return propertySheet; } + void IPropertyDrawer.DisposePropertyDrawer() { } + void BuildPropertyNameLabel(PropertySheet propertySheet) { string prefix; diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs index adb25c6a3d2..59fca0d195c 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs @@ -48,5 +48,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TextPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TextPropertyDrawer.cs index d3a1f941252..3e144cab545 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TextPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TextPropertyDrawer.cs @@ -49,5 +49,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject (string)propertyInfo.GetValue(actualObject), attribute.labelName); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DArrayPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DArrayPropertyDrawer.cs index 75cd5369761..27231b4d54f 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DArrayPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DArrayPropertyDrawer.cs @@ -45,5 +45,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DPropertyDrawer.cs index 27c12373e22..4443557c112 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture2DPropertyDrawer.cs @@ -45,5 +45,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture3DPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture3DPropertyDrawer.cs index ea2bb0cbb3f..bc72eab5296 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture3DPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Texture3DPropertyDrawer.cs @@ -45,5 +45,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ToggleDataPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ToggleDataPropertyDrawer.cs index fd8a7e2871c..00db2f4da52 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ToggleDataPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ToggleDataPropertyDrawer.cs @@ -52,5 +52,7 @@ public VisualElement DrawProperty( attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TransformNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TransformNodePropertyDrawer.cs new file mode 100644 index 00000000000..22f4c687c69 --- /dev/null +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TransformNodePropertyDrawer.cs @@ -0,0 +1,61 @@ +using System; +using UnityEditor.UIElements; +using UnityEditor.Graphing; +using UnityEditor.Graphing.Util; +using UnityEngine.UIElements; +using UnityEditor.ShaderGraph.Internal; + +namespace UnityEditor.ShaderGraph.Drawing.Inspector.PropertyDrawers +{ + [SGPropertyDrawer(typeof(TransformNode))] + class TransformNodePropertyDrawer : AbstractMaterialNodePropertyDrawer + { + TransformNode node; + PropertyRow normalizePropRow; + + void UpdateVisibility() + { + normalizePropRow.visible = (node.sgVersion >= 2) && (node.conversionType != ConversionType.Position); + } + + internal override void AddCustomNodeProperties(VisualElement parentElement, AbstractMaterialNode nodeBase, Action setNodesAsDirtyCallback, Action updateNodeViewsCallback) + { + node = nodeBase as TransformNode; + + var normalizeControl = new Toggle(); + normalizeControl.value = node.normalize; + + normalizePropRow = new PropertyRow(new Label("Normalize Output")); + normalizePropRow.Add(normalizeControl, (field) => + { + field.RegisterValueChangedCallback(evt => + { + if (evt.newValue.Equals(node.normalize)) + return; + + setNodesAsDirtyCallback?.Invoke(); + node.owner.owner.RegisterCompleteObjectUndo("Change normalize"); + node.normalize = evt.newValue; + updateNodeViewsCallback?.Invoke(); + node.Dirty(ModificationScope.Graph); + }); + }); + parentElement.Add(normalizePropRow); + + UpdateVisibility(); + + node.RegisterCallback(OnNodeModified); + } + + // when node is modified we want to update the visibility + void OnNodeModified(AbstractMaterialNode node, ModificationScope scope) + { + UpdateVisibility(); + } + + internal override void DisposePropertyDrawer() + { + node.UnregisterCallback(OnNodeModified); + } + } +} diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TransformNodePropertyDrawer.cs.meta b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TransformNodePropertyDrawer.cs.meta new file mode 100644 index 00000000000..edbbe89c5c4 --- /dev/null +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/TransformNodePropertyDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 83fc180327d27574e82b361da1ea2d11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector2PropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector2PropertyDrawer.cs index 2e2b19094d7..88245df4b39 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector2PropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector2PropertyDrawer.cs @@ -100,5 +100,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector3PropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector3PropertyDrawer.cs index e13b5509f8d..660a3933a56 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector3PropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector3PropertyDrawer.cs @@ -101,5 +101,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector4PropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector4PropertyDrawer.cs index 480785967b0..fc589eac6fe 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector4PropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/Vector4PropertyDrawer.cs @@ -100,5 +100,7 @@ public VisualElement DrawProperty(PropertyInfo propertyInfo, object actualObject attribute.labelName, out var propertyVisualElement); } + + void IPropertyDrawer.DisposePropertyDrawer() { } } } diff --git a/com.unity.shadergraph/Editor/Generation/Processors/ShaderStringBuilder.cs b/com.unity.shadergraph/Editor/Generation/Processors/ShaderStringBuilder.cs index b0e5dadce02..8c090de80e1 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/ShaderStringBuilder.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/ShaderStringBuilder.cs @@ -89,6 +89,15 @@ public void AppendLine(string value) AppendNewLine(); } + public void AddLine(string v0) { TryAppendIndentation(); Append(v0); AppendNewLine(); } + public void AddLine(string v0, string v1) { TryAppendIndentation(); Append(v0); Append(v1); AppendNewLine(); } + public void AddLine(string v0, string v1, string v2) { TryAppendIndentation(); Append(v0); Append(v1); Append(v2); AppendNewLine(); } + public void AddLine(string v0, string v1, string v2, string v3) { TryAppendIndentation(); Append(v0); Append(v1); Append(v2); Append(v3); AppendNewLine(); } + public void AddLine(string v0, string v1, string v2, string v3, string v4) { TryAppendIndentation(); Append(v0); Append(v1); Append(v2); Append(v3); Append(v4); AppendNewLine(); } + public void AddLine(string v0, string v1, string v2, string v3, string v4, string v5) { TryAppendIndentation(); Append(v0); Append(v1); Append(v2); Append(v3); Append(v4); Append(v5); AppendNewLine(); } + public void AddLine(string v0, string v1, string v2, string v3, string v4, string v5, string v6) { TryAppendIndentation(); Append(v0); Append(v1); Append(v2); Append(v3); Append(v4); Append(v5); Append(v6); AppendNewLine(); } + public void AddLine(string v0, string v1, string v2, string v3, string v4, string v5, string v6, string v7) { TryAppendIndentation(); Append(v0); Append(v1); Append(v2); Append(v3); Append(v4); Append(v5); Append(v6); Append(v7); AppendNewLine(); } + [StringFormatMethod("formatString")] public void AppendLine(string formatString, params object[] args) {