From 15c68055d4f89d445dbd5ac68d883a55dff3f7b6 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Wed, 4 Nov 2020 10:13:55 -0800 Subject: [PATCH 01/28] Add ST to texture params --- .../Editor/Data/Graphs/Texture2DShaderProperty.cs | 3 ++- .../Editor/Data/Nodes/Utility/SubGraphNode.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs index 143e8ab2ad8..4336be254d6 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs @@ -40,11 +40,12 @@ internal override void ForeachHLSLProperty(Action action) action(new HLSLProperty(HLSLType._Texture2D, referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._float4, referenceName + "_TexelSize", decl)); + action(new HLSLProperty(HLSLType._float4, referenceName + "_ST", decl)); } internal override string GetPropertyAsArgumentString() { - return $"TEXTURE2D_PARAM({referenceName}, sampler{referenceName}), {concretePrecision.ToShaderString()}4 {referenceName}_TexelSize"; + return $"TEXTURE2D_PARAM({referenceName}, sampler{referenceName}), {concretePrecision.ToShaderString()}4 {referenceName}_TexelSize, {concretePrecision.ToShaderString()}4 {referenceName}_ST"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs index 4143e7baa8f..c85612e2262 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs @@ -217,7 +217,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo switch (prop) { case Texture2DShaderProperty texture2DProp: - arguments.Add(string.Format("TEXTURE2D_ARGS({0}, sampler{0}), {0}_TexelSize", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); + arguments.Add(string.Format("TEXTURE2D_ARGS({0}, sampler{0}), {0}_TexelSize, {0}_ST", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); break; case Texture2DArrayShaderProperty texture2DArrayProp: arguments.Add(string.Format("TEXTURE2D_ARRAY_ARGS({0}, sampler{0})", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); From c76e53b911a0f87a516a51895fc0a5b96856c190 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 9 Nov 2020 15:26:07 -0800 Subject: [PATCH 02/28] Working with Universal / Texture2D (but not CFN yet) --- .../ShaderLibrary/Texture.hlsl | 78 +++++++++++++++++++ .../ShaderLibrary/Texture.hlsl.meta | 10 +++ .../ShaderGraph/Targets/UniversalTarget.cs | 2 + .../Data/Graphs/AbstractShaderProperty.cs | 5 ++ .../Data/Graphs/Texture2DInputMaterialSlot.cs | 12 +-- .../Data/Graphs/Texture2DShaderProperty.cs | 27 ++++++- .../Editor/Data/Nodes/Input/PropertyNode.cs | 31 ++++---- .../Input/Texture/SampleTexture2DNode.cs | 4 +- .../Nodes/Input/Texture/Texture2DAssetNode.cs | 23 +++++- .../Editor/Data/Nodes/Utility/SubGraphNode.cs | 19 +++-- .../Editor/Data/Util/SlotValueTypeUtil.cs | 2 +- .../Generation/Targets/PreviewTarget.cs | 1 + .../Importers/ShaderSubGraphImporter.cs | 5 +- 13 files changed, 184 insertions(+), 35 deletions(-) create mode 100644 com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl create mode 100644 com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl.meta diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl new file mode 100644 index 00000000000..493252a4bbb --- /dev/null +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -0,0 +1,78 @@ +#ifndef UNITY_TEXTURE_INCLUDED +#define UNITY_TEXTURE_INCLUDED + +struct UnityTexture2D +{ + TEXTURE2D(tex); + SAMPLER(texSampler); + float4 texelSize; + float4 scaleTranslate; +}; + +UnityTexture2D UnityBuildTexture2DStruct(TEXTURE2D_PARAM(tex, texSampler), float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +{ + UnityTexture2D result; + result.tex = tex; + ASSIGN_SAMPLER(result.texSampler, texSampler); + result.texelSize = texelSize; + result.scaleTranslate = scaleTranslate; + return result; +} + +struct UnityTexture2DArray +{ + TEXTURE2D_ARRAY(tex); + SAMPLER(texSampler); +// float4 texelSize; // ?? are these valid for Texture2DArrays? +// float4 scaleTranslate; // ?? +}; + +UnityTexture2DArray UnityBuildTexture2DArrayStruct(TEXTURE2D_ARRAY_PARAM(tex, texSampler)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +{ + UnityTexture2DArray result; + result.tex = tex; + ASSIGN_SAMPLER(result.texSampler, texSampler); +// result.texelSize = texelSize; +// result.scaleTranslate = scaleTranslate; + return result; +} + + +struct UnityTextureCube +{ + TEXTURECUBE(tex); + SAMPLER(texSampler); + // float4 texelSize; // ?? are these valid for Texture2DArrays? + // float4 scaleTranslate; // ?? +}; + +UnityTextureCube UnityBuildTextureCubeStruct(TEXTURECUBE_PARAM(tex, texSampler)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +{ + UnityTextureCube result; + result.tex = tex; + ASSIGN_SAMPLER(result.texSampler, texSampler); + // result.texelSize = texelSize; + // result.scaleTranslate = scaleTranslate; + return result; +} + + +struct UnityTexture3D +{ + TEXTURE3D(tex); + SAMPLER(texSampler); + // float4 texelSize; // ?? are these valid for Texture2DArrays? + // float4 scaleTranslate; // ?? +}; + +UnityTexture3D UnityBuildTexture3DStruct(TEXTURE3D_PARAM(tex, texSampler)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +{ + UnityTexture3D result; + result.tex = tex; + ASSIGN_SAMPLER(result.texSampler, texSampler); + // result.texelSize = texelSize; + // result.scaleTranslate = scaleTranslate; + return result; +} + +#endif // UNITY_TEXTURE_INCLUDED diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl.meta b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl.meta new file mode 100644 index 00000000000..f6ca2061fcc --- /dev/null +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 79062f3c36657da4e9a366000411cf78 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs b/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs index d8f8c8bcca6..fe97b1952c2 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalTarget.cs @@ -599,6 +599,7 @@ static class CorePragmas static class CoreIncludes { const string kColor = "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"; + const string kTexture = "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"; const string kCore = "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"; const string kLighting = "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"; const string kGraphFunctions = "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"; @@ -612,6 +613,7 @@ static class CoreIncludes public static readonly IncludeCollection CorePregraph = new IncludeCollection { { kColor, IncludeLocation.Pregraph }, + { kTexture, IncludeLocation.Pregraph }, { kCore, IncludeLocation.Pregraph }, { kLighting, IncludeLocation.Pregraph }, { kTextureStack, IncludeLocation.Pregraph }, // TODO: put this on a conditional diff --git a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs index 4f93cca6e30..af78f2dcb1a 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs @@ -22,6 +22,11 @@ public bool gpuInstanced set { } } + internal virtual string GetHLSLVariableName() + { + return referenceName; + } + // NOTE: this does not tell you the HLSLDeclaration of the entire property... // instead, it tells you what the DEFAULT HLSL Declaration would be, IF the property makes use of the default // to check ACTUAL HLSL Declaration types, enumerate the HLSL Properties and check their HLSLDeclarations... diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs index 6f82ed98bac..4946d42988f 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs @@ -50,21 +50,21 @@ public override VisualElement InstantiateControl() public override string GetDefaultValue(GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return matOwner.GetVariableNameForSlot(id); + return nodeOwner.GetVariableNameForSlot(id) + "_struct"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); var prop = new Texture2DShaderProperty(); - prop.overrideReferenceName = matOwner.GetVariableNameForSlot(id); + prop.overrideReferenceName = nodeOwner.GetVariableNameForSlot(id); prop.modifiable = false; prop.generatePropertyBlock = true; prop.value.texture = texture; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs index 4336be254d6..441a3478320 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs @@ -41,11 +41,36 @@ internal override void ForeachHLSLProperty(Action action) action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._float4, referenceName + "_TexelSize", decl)); action(new HLSLProperty(HLSLType._float4, referenceName + "_ST", decl)); + + // add struct macro + Action structDecl = (builder) => + { + builder.AppendIndentation(); + builder.Append("#define "); + builder.Append(referenceName); + builder.Append("_struct UnityBuildTexture2DStruct(TEXTURE2D_ARGS("); + builder.Append(referenceName); + builder.Append(", sampler"); builder.Append(referenceName); + builder.Append("), "); + builder.Append(referenceName); builder.Append("_TexelSize, "); + builder.Append(referenceName); builder.Append("_ST)"); + builder.AppendNewLine(); + }; + + action(new HLSLProperty(HLSLType._CUSTOM, referenceName + "_struct", HLSLDeclaration.Global, concretePrecision) + { + customDeclaration = structDecl + }); } internal override string GetPropertyAsArgumentString() { - return $"TEXTURE2D_PARAM({referenceName}, sampler{referenceName}), {concretePrecision.ToShaderString()}4 {referenceName}_TexelSize, {concretePrecision.ToShaderString()}4 {referenceName}_ST"; + return "UnityTexture2D " + referenceName + "_struct"; + } + + internal override string GetHLSLVariableName() + { + return referenceName + "_struct"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs index 3ccba73e770..633fcf000fd 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs @@ -141,26 +141,26 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo switch (property.propertyType) { case PropertyType.Boolean: - sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.Float: - sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.Vector2: - sb.AppendLine($"$precision2 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision2 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.Vector3: - sb.AppendLine($"$precision3 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision3 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.Vector4: - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.Color: switch (property.sgVersion) { case 0: case 2: - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case 1: case 3: @@ -168,11 +168,11 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo //for consistency with other places in the editor, we assume HDR colors are in linear space, and correct for gamma space here if ((property as ColorShaderProperty).colorMode == ColorMode.HDR) { - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? LinearToSRGB({property.referenceName}) : {property.referenceName};"); + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? LinearToSRGB({property.GetHLSLVariableName()}) : {property.GetHLSLVariableName()};"); } else { - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); } break; default: @@ -180,29 +180,28 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo } break; case PropertyType.Matrix2: - sb.AppendLine($"$precision2x2 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision2x2 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.Matrix3: - sb.AppendLine($"$precision3x3 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision3x3 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.Matrix4: - sb.AppendLine($"$precision4x4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"$precision4x4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.SamplerState: - sb.AppendLine($"SamplerState {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"SamplerState {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; case PropertyType.Gradient: if(generationMode == GenerationMode.Preview) - sb.AppendLine($"Gradient {GetVariableNameForSlot(OutputSlotId)} = {GradientUtil.GetGradientForPreview(property.referenceName)};"); + sb.AppendLine($"Gradient {GetVariableNameForSlot(OutputSlotId)} = {GradientUtil.GetGradientForPreview(property.GetHLSLVariableName())};"); else - sb.AppendLine($"Gradient {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + sb.AppendLine($"Gradient {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); break; } } public override string GetVariableNameForSlot(int slotId) { - // TODO: I don't like this exception list being buried in PropertyNode.cs, should be something on the ShaderProperty themselves... if (!(property is Texture2DShaderProperty) && !(property is Texture2DArrayShaderProperty) && @@ -211,7 +210,7 @@ public override string GetVariableNameForSlot(int slotId) !(property is VirtualTextureShaderProperty)) return base.GetVariableNameForSlot(slotId); - return property.referenceName; + return property.GetHLSLVariableName(); } protected override void CalculateNodeHasError() diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs index 7b49cc78a44..b4b0bc5432f 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs @@ -109,10 +109,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(TextureInputId, generationMode); - var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D({1}, {2}, {3});" + var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D({1}.tex, {2}, {3});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : "sampler" + id + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".texSampler" , uvName); sb.AppendLine(result); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs index 6a669a3c6b4..98fadaf847b 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs @@ -42,11 +42,30 @@ public Texture texture } } + string GetTexturePropertyName() + { + return string.Format("_{0}_texture", GetVariableNameForNode()); + } + + string GetTextureVariableName() + { + return string.Format("_{0}_texture_struct", GetVariableNameForNode()); + } + + public override string GetVariableNameForSlot(int slotId) + { + if (slotId == OutputSlotId) + return GetTextureVariableName(); + else + return base.GetVariableNameForSlot(slotId); + } + public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) { properties.AddShaderProperty(new Texture2DShaderProperty() { - overrideReferenceName = GetVariableNameForSlot(OutputSlotId), + // NOTE : this changes (hidden) shader property names... which could cause Material changes + overrideReferenceName = GetTexturePropertyName(), generatePropertyBlock = true, value = m_Texture, modifiable = false @@ -57,7 +76,7 @@ public override void CollectPreviewMaterialProperties(List prop { properties.Add(new PreviewProperty(PropertyType.Texture2D) { - name = GetVariableNameForSlot(OutputSlotId), + name = GetTexturePropertyName(), textureValue = texture, texture2DDefaultType = Texture2DShaderProperty.DefaultType.White }); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs index c85612e2262..c5fae6b3a64 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs @@ -216,9 +216,6 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo switch (prop) { - case Texture2DShaderProperty texture2DProp: - arguments.Add(string.Format("TEXTURE2D_ARGS({0}, sampler{0}), {0}_TexelSize, {0}_ST", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); - break; case Texture2DArrayShaderProperty texture2DArrayProp: arguments.Add(string.Format("TEXTURE2D_ARRAY_ARGS({0}, sampler{0})", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); break; @@ -229,7 +226,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo arguments.Add(string.Format("TEXTURECUBE_ARGS({0}, sampler{0})", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); break; default: - arguments.Add(string.Format("{0}", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); + arguments.Add(GetSlotValue(inSlotId, generationMode, prop.concretePrecision)); break; } } @@ -247,7 +244,19 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo arguments.Add(feedbackVar); } - sb.AppendLine("{0}({1});", asset.functionName, arguments.Aggregate((current, next) => string.Format("{0}, {1}", current, next))); + sb.AppendIndentation(); + sb.Append(asset.functionName); + sb.Append("("); + bool firstArg = true; + foreach (var arg in arguments) + { + if (!firstArg) + sb.Append(", "); + firstArg = false; + sb.Append(arg); + } + sb.Append(");"); + sb.AppendNewLine(); } public void OnEnable() diff --git a/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs b/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs index 37d367267cd..b7d438b435d 100644 --- a/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs @@ -142,7 +142,7 @@ public static string ToShaderString(this ConcreteSlotValueType type, string prec case ConcreteSlotValueType.Matrix2: return precisionToken + "2x2"; case ConcreteSlotValueType.Texture2D: - return "Texture2D"; + return "UnityTexture2D"; case ConcreteSlotValueType.Texture2DArray: return "Texture2DArray"; case ConcreteSlotValueType.Texture3D: diff --git a/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs b/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs index d5cc38bd4ed..1ffd2fd9e4b 100644 --- a/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs +++ b/com.unity.shadergraph/Editor/Generation/Targets/PreviewTarget.cs @@ -87,6 +87,7 @@ static class Passes { "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl", IncludeLocation.Pregraph }, // TODO: put this on a conditional { "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl", IncludeLocation.Pregraph }, { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl", IncludeLocation.Pregraph }, + { "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl", IncludeLocation.Pregraph }, { "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl", IncludeLocation.Pregraph }, { "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl", IncludeLocation.Pregraph }, { "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariables.hlsl", IncludeLocation.Pregraph }, diff --git a/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs b/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs index 81e2d2626f7..73b19f28aff 100644 --- a/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs +++ b/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs @@ -236,6 +236,7 @@ static void ProcessSubGraph(SubGraphAsset asset, GraphData graph) } } + // provide top level subgraph function registry.ProvideFunction(asset.functionName, sb => { GenerationUtils.GenerateSurfaceInputStruct(sb, asset.requirements, asset.inputStructName); @@ -246,14 +247,14 @@ static void ProcessSubGraph(SubGraphAsset asset, GraphData graph) foreach (var prop in graph.properties) { prop.ValidateConcretePrecision(asset.graphPrecision); - arguments.Add(string.Format("{0}", prop.GetPropertyAsArgumentString())); + arguments.Add(prop.GetPropertyAsArgumentString()); } // now pass surface inputs arguments.Add(string.Format("{0} IN", asset.inputStructName)); // Now generate outputs - foreach (var output in outputSlots) + foreach (MaterialSlot output in outputSlots) arguments.Add($"out {output.concreteValueType.ToShaderString(asset.outputPrecision)} {output.shaderOutputName}_{output.id}"); // Vt Feedback arguments From 464c730d69ea802072199f5d0fb4708a30d30233 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 9 Nov 2020 18:56:59 -0800 Subject: [PATCH 03/28] CustomFunctionNode Texture2D working, allows full bare/non-bare selection of types, warns when using bare output types --- .../Editor/Data/Graphs/CubemapMaterialSlot.cs | 9 + .../Editor/Data/Graphs/MaterialSlot.cs | 7 + .../Graphs/Texture2DArrayInputMaterialSlot.cs | 3 + .../Data/Graphs/Texture2DArrayMaterialSlot.cs | 18 +- .../Data/Graphs/Texture2DInputMaterialSlot.cs | 3 + .../Data/Graphs/Texture2DMaterialSlot.cs | 25 ++- .../Data/Graphs/Texture3DInputMaterialSlot.cs | 3 + .../Data/Graphs/Texture3DMaterialSlot.cs | 17 +- .../Editor/Data/Nodes/SlotValue.cs | 59 ++++- .../Data/Nodes/Utility/CustomFunctionNode.cs | 205 ++++++++++++------ .../CustomFunctionNodePropertyDrawer.cs | 9 +- .../SubGraphOutputNodePropertyDrawer.cs | 2 +- .../Drawing/Views/ReorderableSlotListView.cs | 66 +++--- 13 files changed, 322 insertions(+), 104 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs index 5b773b3ec03..cf050fb11a1 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs @@ -1,5 +1,6 @@ using System; using UnityEditor.Graphing; +using UnityEngine; namespace UnityEditor.ShaderGraph { @@ -19,6 +20,14 @@ public CubemapMaterialSlot( : base(slotId, displayName, shaderOutputName, slotType, stageCapability, hidden) {} + [SerializeField] + internal bool m_BareTexture = false; + internal override bool bareTexture + { + get { return m_BareTexture; } + set { m_BareTexture = value; } + } + public override SlotValueType valueType { get { return SlotValueType.Cubemap; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Cubemap; } } public override bool isDefaultValue => true; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs index f0f26e1ed83..edc601caf41 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs @@ -291,6 +291,11 @@ public virtual void GetPreviewProperties(List properties, strin properties.Add(default(PreviewProperty)); } + public virtual string GetHLSLVariableType() + { + return concreteValueType.ToShaderString(); + } + public abstract void CopyValuesFrom(MaterialSlot foundSlot); public bool Equals(MaterialSlot other) @@ -314,6 +319,8 @@ public override int GetHashCode() } } + internal virtual bool bareTexture { get { return false; } set { } } + public virtual void CopyDefaultValue(MaterialSlot other) { m_Id = other.m_Id; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs index 843b30983d4..ae6b35b4e85 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs @@ -76,7 +76,10 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) { var slot = foundSlot as Texture2DArrayInputMaterialSlot; if (slot != null) + { m_TextureArray = slot.m_TextureArray; + m_BareTexture = slot.m_BareTexture; + } } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs index b730cec9dc3..39465c1c3a0 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs @@ -1,5 +1,6 @@ using System; using UnityEditor.Graphing; +using UnityEngine; namespace UnityEditor.ShaderGraph { @@ -19,6 +20,14 @@ public Texture2DArrayMaterialSlot( : base(slotId, displayName, shaderOutputName, slotType, shaderStageCapability, hidden) {} + [SerializeField] + internal bool m_BareTexture = false; + internal override bool bareTexture + { + get { return m_BareTexture; } + set { m_BareTexture = value; } + } + public override SlotValueType valueType { get { return SlotValueType.Texture2DArray; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Texture2DArray; } } public override bool isDefaultValue => true; @@ -27,7 +36,12 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation {} public override void CopyValuesFrom(MaterialSlot foundSlot) - {} - + { + var slot = foundSlot as Texture2DArrayMaterialSlot; + if (slot != null) + { + m_BareTexture = slot.m_BareTexture; + } + } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs index 4946d42988f..7f55c45eac7 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs @@ -87,7 +87,10 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) { var slot = foundSlot as Texture2DInputMaterialSlot; if (slot != null) + { m_Texture = slot.m_Texture; + m_BareTexture = slot.m_BareTexture; + } } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs index c4296afe354..98de4403de1 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs @@ -1,5 +1,6 @@ using System; using UnityEditor.Graphing; +using UnityEngine; namespace UnityEditor.ShaderGraph { @@ -19,6 +20,22 @@ public Texture2DMaterialSlot( : base(slotId, displayName, shaderOutputName, slotType, stageCapability, hidden) {} + [SerializeField] + internal bool m_BareTexture = false; + internal override bool bareTexture + { + get { return m_BareTexture; } + set { m_BareTexture = value; } + } + + public override string GetHLSLVariableType() + { + if (m_BareTexture) + return "Texture2D"; + else + return concreteValueType.ToShaderString(); + } + public override SlotValueType valueType { get { return SlotValueType.Texture2D; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Texture2D; } } public override bool isDefaultValue => true; @@ -27,6 +44,12 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation {} public override void CopyValuesFrom(MaterialSlot foundSlot) - {} + { + var slot = foundSlot as Texture2DMaterialSlot; + if (slot != null) + { + m_BareTexture = slot.m_BareTexture; + } + } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs index 8533b7319bd..e328eeec699 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs @@ -76,7 +76,10 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) { var slot = foundSlot as Texture3DInputMaterialSlot; if (slot != null) + { m_Texture = slot.m_Texture; + m_BareTexture = slot.m_BareTexture; + } } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs index a9b04c0bbab..4167cb3b966 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs @@ -1,5 +1,6 @@ using System; using UnityEditor.Graphing; +using UnityEngine; namespace UnityEditor.ShaderGraph { @@ -19,6 +20,14 @@ public Texture3DMaterialSlot( : base(slotId, displayName, shaderOutputName, slotType, shaderStageCapability, hidden) {} + [SerializeField] + internal bool m_BareTexture = false; + internal override bool bareTexture + { + get { return m_BareTexture; } + set { m_BareTexture = value; } + } + public override SlotValueType valueType { get { return SlotValueType.Texture3D; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Texture3D; } } public override bool isDefaultValue => true; @@ -27,6 +36,12 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation {} public override void CopyValuesFrom(MaterialSlot foundSlot) - {} + { + var slot = foundSlot as Texture3DMaterialSlot; + if (slot != null) + { + m_BareTexture = slot.m_BareTexture; + } + } } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/SlotValue.cs b/com.unity.shadergraph/Editor/Data/Nodes/SlotValue.cs index a7014d16e90..d0b6f73675d 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/SlotValue.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/SlotValue.cs @@ -63,14 +63,67 @@ enum ConcreteSlotValueTypePopupName Vector2 = ConcreteSlotValueType.Vector2, Float = ConcreteSlotValueType.Vector1, // This is currently the only renaming we need - rename Vector1 to Float Boolean = ConcreteSlotValueType.Boolean, - VirtualTexture = ConcreteSlotValueType.VirtualTexture + VirtualTexture = ConcreteSlotValueType.VirtualTexture, + + BareTexture2D = 1000 + ConcreteSlotValueType.Texture2D, + BareTexture2DArray = 1000 + ConcreteSlotValueType.Texture2DArray, + BareTexture3D = 1000 + ConcreteSlotValueType.Texture3D, + BareCubemap = 1000 + ConcreteSlotValueType.Cubemap, } static class SlotValueHelper { - public static bool AllowedAsSubgraphOutput(this ConcreteSlotValueType type) + public static ConcreteSlotValueTypePopupName ToConcreteSlotValueTypePopupName(this ConcreteSlotValueType slotType, bool isBareTexture) + { + ConcreteSlotValueTypePopupName result = (ConcreteSlotValueTypePopupName)slotType; + switch (slotType) + { + case ConcreteSlotValueType.Texture2D: + if (isBareTexture) + result = ConcreteSlotValueTypePopupName.BareTexture2D; + break; + case ConcreteSlotValueType.Texture2DArray: + if (isBareTexture) + result = ConcreteSlotValueTypePopupName.BareTexture2DArray; + break; + case ConcreteSlotValueType.Texture3D: + if (isBareTexture) + result = ConcreteSlotValueTypePopupName.BareTexture3D; + break; + case ConcreteSlotValueType.Cubemap: + if (isBareTexture) + result = ConcreteSlotValueTypePopupName.BareCubemap; + break; + } + return result; + } + + public static ConcreteSlotValueType ToConcreteSlotValueType(this ConcreteSlotValueTypePopupName popup, out bool isBareTexture) + { + switch (popup) + { + case ConcreteSlotValueTypePopupName.BareTexture2D: + isBareTexture = true; + return ConcreteSlotValueType.Texture2D; + case ConcreteSlotValueTypePopupName.BareTexture2DArray: + isBareTexture = true; + return ConcreteSlotValueType.Texture2DArray; + case ConcreteSlotValueTypePopupName.BareTexture3D: + isBareTexture = true; + return ConcreteSlotValueType.Texture3D; + case ConcreteSlotValueTypePopupName.BareCubemap: + isBareTexture = true; + return ConcreteSlotValueType.Cubemap; + }; + + isBareTexture = false; + return (ConcreteSlotValueType) popup; + } + + public static bool AllowedAsSubgraphOutput(this ConcreteSlotValueTypePopupName type) { - return type != ConcreteSlotValueType.VirtualTexture; + // virtual textures and bare types disallowed + return (type < ConcreteSlotValueTypePopupName.VirtualTexture); } public static int GetChannelCount(this ConcreteSlotValueType type) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs index 6b02f2ef11e..71ed43f8353 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs @@ -7,6 +7,7 @@ using UnityEditor.Rendering; using UnityEngine.UIElements; using UnityEditor.ShaderGraph.Drawing; +using System.Text; namespace UnityEditor.ShaderGraph { @@ -14,6 +15,10 @@ namespace UnityEditor.ShaderGraph [Title("Utility", "Custom Function")] class CustomFunctionNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction { + // 0 original version + // 1 differentiate between UnityTexture2D and Texture2D + public override int latestVersion => 1; + [Serializable] public class MinimalCustomFunctionNode : IHasDependencies { @@ -103,50 +108,74 @@ public string functionBody public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { - List slots = new List(); - GetOutputSlots(slots); - - if(!IsValidFunction()) + using (var inputSlots = PooledList.Get()) + using (var outputSlots = PooledList.Get()) { - if(generationMode == GenerationMode.Preview && slots.Count != 0) + GetInputSlots(inputSlots); + GetOutputSlots(outputSlots); + + if (!IsValidFunction()) + { + // invalid functions generate special preview code.. (why?) + if (generationMode == GenerationMode.Preview && outputSlots.Count != 0) + { + outputSlots.OrderBy(s => s.id); + var hlslVariableType = outputSlots[0].concreteValueType.ToShaderString(); + sb.AppendLine("{0} {1};", + hlslVariableType, + GetVariableNameForSlot(outputSlots[0].id)); + } + return; + } + + // declare output variables + foreach (var argument in outputSlots) { - slots.OrderBy(s => s.id); sb.AppendLine("{0} {1};", - slots[0].concreteValueType.ToShaderString(), - GetVariableNameForSlot(slots[0].id)); + argument.concreteValueType.ToShaderString(), + GetVariableNameForSlot(argument.id)); } - return; - } - foreach (var argument in slots) - sb.AppendLine("{0} {1};", - argument.concreteValueType.ToShaderString(), - GetVariableNameForSlot(argument.id)); + // call function + sb.AppendIndentation(); + sb.Append(functionName); + sb.Append("_$precision("); + bool first = true; - string call = $"{functionName}_$precision("; - bool first = true; + foreach (var argument in inputSlots) + { + if (!first) + sb.Append(", "); + first = false; - slots.Clear(); - GetInputSlots(slots); - foreach (var argument in slots) - { - if (!first) - call += ", "; - first = false; - call += SlotInputValue(argument, generationMode); - } + sb.Append(SlotInputValue(argument, generationMode)); // TODO: need to differentiate Texture2D from UnityTexture2D - slots.Clear(); - GetOutputSlots(slots); - foreach (var argument in slots) - { - if (!first) - call += ", "; - first = false; - call += GetVariableNameForSlot(argument.id); + // fixup input for Bare texture types + if (argument.bareTexture) + sb.Append(".tex"); + } + + foreach (var argument in outputSlots) + { + if (!first) + sb.Append(", "); + first = false; + sb.Append(GetVariableNameForSlot(argument.id)); + + if (argument.bareTexture) + sb.Append(".tex"); + } + sb.Append(");"); + sb.AppendNewLine(); + + foreach (var output in outputSlots) + { + if (output.bareTexture) + { + // fill in other values - sampler state, etc ?? + } + } } - call += ");"; - sb.AppendLine(call); } public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode generationMode) @@ -182,7 +211,7 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener case HlslSourceType.String: registry.ProvideFunction(functionName, builder => { - builder.AppendLine(GetFunctionHeader()); + GetFunctionHeader(builder); using (builder.BlockScope()) { builder.AppendLines(functionBody); @@ -194,32 +223,43 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener } } - string GetFunctionHeader() + void GetFunctionHeader(ShaderStringBuilder sb) { - string header = $"void {functionName}_$precision("; - var first = true; - List slots = new List(); - - GetInputSlots(slots); - foreach (var argument in slots) + using (var inputSlots = PooledList.Get()) + using (var outputSlots = PooledList.Get()) { - if (!first) - header += ", "; - first = false; - header += $"{argument.concreteValueType.ToShaderString()} {argument.shaderOutputName}"; - } + GetInputSlots(inputSlots); + GetOutputSlots(outputSlots); - slots.Clear(); - GetOutputSlots(slots); - foreach (var argument in slots) - { - if (!first) - header += ", "; - first = false; - header += $"out {argument.concreteValueType.ToShaderString()} {argument.shaderOutputName}"; + sb.Append("void "); + sb.Append(functionName); + sb.Append("_$precision("); + + var first = true; + + foreach (var argument in inputSlots) + { + if (!first) + sb.Append(", "); + first = false; + sb.Append(argument.GetHLSLVariableType()); + sb.Append(" "); + sb.Append(argument.shaderOutputName); + } + + foreach (var argument in outputSlots) + { + if (!first) + sb.Append(", "); + first = false; + sb.Append("out "); + sb.Append(argument.GetHLSLVariableType()); + sb.Append(" "); + sb.Append(argument.shaderOutputName); + } + + sb.Append(")"); } - header += ")"; - return header; } string SlotInputValue(MaterialSlot port, GenerationMode generationMode) @@ -268,16 +308,34 @@ static bool IsValidFunction(HlslSourceType sourceType, string functionName, stri void ValidateSlotName() { - List slots = new List(); - GetSlots(slots); + using (var slots = PooledList.Get()) + { + GetSlots(slots); + foreach (var slot in slots) + { + // check for bad slot names + var error = NodeUtils.ValidateSlotName(slot.RawDisplayName(), out string errorMessage); + if (error) + { + owner.AddValidationError(objectId, errorMessage); + break; + } + } + } + } - foreach (var slot in slots) + void ValidateBareTextureSlots() + { + using (var outputSlots = PooledList.Get()) { - var error = NodeUtils.ValidateSlotName(slot.RawDisplayName(), out string errorMessage); - if (error) + GetOutputSlots(outputSlots); + foreach (var slot in outputSlots) { - owner.AddValidationError(objectId, errorMessage); - break; + if (slot.bareTexture) + { + owner.AddValidationError(objectId, "This node uses Bare Texture outputs, which may not work when fed to other nodes. Please convert the node to use full Texture2D struct-based outputs (see UnityTexture2D in com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl)", ShaderCompilerMessageSeverity.Warning); + break; + } } } } @@ -308,6 +366,7 @@ public override void ValidateNode() owner.AddValidationError(objectId, k_MissingOutputSlot, ShaderCompilerMessageSeverity.Warning); } ValidateSlotName(); + ValidateBareTextureSlots(); base.ValidateNode(); } @@ -351,5 +410,21 @@ public override void OnAfterDeserialize() base.OnAfterDeserialize(); functionSource = UpgradeFunctionSource(functionSource); } + + public override void OnAfterMultiDeserialize(string json) + { + if (sgVersion < 1) + { + // any Texture2D slots used prior to version 1 should be flagged as "bare" so we can + // generate backwards compatible code + var slots = new List(); + GetSlots(slots); + foreach (var slot in slots) + { + slot.bareTexture = true; + } + ChangeVersion(1); + } + } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs index 52ebf2a4127..a807fe2bd62 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/CustomFunctionNodePropertyDrawer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using UnityEditor.Graphing; using UnityEditor.ShaderGraph; @@ -16,16 +16,19 @@ VisualElement CreateGUI(CustomFunctionNode node, InspectableAttribute attribute, out VisualElement propertyVisualElement) { var propertySheet = new PropertySheet(PropertyDrawerUtils.CreateLabel($"{node.name} Node", 0, FontStyle.Bold)); - var inputListView = new ReorderableSlotListView(node, SlotType.Input); + + var inputListView = new ReorderableSlotListView(node, SlotType.Input, true); inputListView.OnAddCallback += list => inspectorUpdateDelegate(); inputListView.OnRemoveCallback += list => inspectorUpdateDelegate(); inputListView.OnListRecreatedCallback += () => inspectorUpdateDelegate(); propertySheet.Add(inputListView); - var outputListView = new ReorderableSlotListView(node, SlotType.Output); + + var outputListView = new ReorderableSlotListView(node, SlotType.Output, true); outputListView.OnAddCallback += list => inspectorUpdateDelegate(); outputListView.OnRemoveCallback += list => inspectorUpdateDelegate(); outputListView.OnListRecreatedCallback += () => inspectorUpdateDelegate(); propertySheet.Add(outputListView); + propertySheet.Add(new HlslFunctionView(node)); propertyVisualElement = propertySheet; return propertySheet; diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs index f6efeb5255d..6747decdbac 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/SubGraphOutputNodePropertyDrawer.cs @@ -16,7 +16,7 @@ VisualElement CreateGUI(SubGraphOutputNode node, InspectableAttribute attribute, out VisualElement propertyVisualElement) { var propertySheet = new PropertySheet(PropertyDrawerUtils.CreateLabel($"{node.name} Node", 0, FontStyle.Bold)); - var inputListView = new ReorderableSlotListView(node, SlotType.Input); + var inputListView = new ReorderableSlotListView(node, SlotType.Input, false); inputListView.OnAddCallback += list => inspectorUpdateDelegate(); inputListView.OnRemoveCallback += list => inspectorUpdateDelegate(); inputListView.OnListRecreatedCallback += () => inspectorUpdateDelegate(); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs b/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs index 09ac609a6eb..dd14e5f7bd3 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs @@ -16,6 +16,7 @@ internal class ReorderableSlotListView : VisualElement IMGUIContainer m_Container; AbstractMaterialNode m_Node; ReorderableList m_ReorderableList; + bool m_AllowBareTextures; internal delegate void ListRecreatedDelegate(); ListRecreatedDelegate m_OnListRecreatedCallback = new ListRecreatedDelegate(() => { }); @@ -40,10 +41,11 @@ public ListRecreatedDelegate OnListRecreatedCallback set => m_OnListRecreatedCallback = value; } - public Func AllowedTypeCallback; + public Func AllowedTypeCallback; - internal ReorderableSlotListView(AbstractMaterialNode node, SlotType slotType) + internal ReorderableSlotListView(AbstractMaterialNode node, SlotType slotType, bool allowBareTextures) { + m_AllowBareTextures = allowBareTextures; styleSheets.Add(Resources.Load("Styles/ReorderableSlotListView")); m_Node = node; m_SlotType = slotType; @@ -104,13 +106,24 @@ private void AddCallbacks() var displayName = EditorGUI.DelayedTextField( new Rect(rect.x, rect.y, rect.width / 2, EditorGUIUtility.singleLineHeight), oldSlot.RawDisplayName(), EditorStyles.label); - var concreteValueType = (ConcreteSlotValueType) EditorGUI.EnumPopup( + ConcreteSlotValueTypePopupName concreteValueTypePopupOrig = + oldSlot.concreteValueType.ToConcreteSlotValueTypePopupName(oldSlot.bareTexture); + + ConcreteSlotValueTypePopupName concreteValueTypePopupNew = (ConcreteSlotValueTypePopupName)EditorGUI.EnumPopup( new Rect(rect.x + rect.width / 2, rect.y, rect.width - rect.width / 2, EditorGUIUtility.singleLineHeight), GUIContent.none, - (ConcreteSlotValueTypePopupName)oldSlot.concreteValueType, // Force ConcreteSlotValueTypePopupName enum which match ConcreteSlotValueType to provide a friendly named in Popup - e => (AllowedTypeCallback == null) ? true : AllowedTypeCallback((ConcreteSlotValueType) e)); + concreteValueTypePopupOrig, + e => + { + ConcreteSlotValueTypePopupName csvtpn = (ConcreteSlotValueTypePopupName) e; + csvtpn.ToConcreteSlotValueType(out bool isBareTexture); + if (isBareTexture && !m_AllowBareTextures) + return false; + return AllowedTypeCallback?.Invoke(csvtpn) ?? true; + } + ); - if(EditorGUI.EndChangeCheck()) + if (EditorGUI.EndChangeCheck()) { m_Node.owner.owner.RegisterCompleteObjectUndo("Modify Port"); @@ -127,38 +140,35 @@ private void AddCallbacks() } } + bool isBareTexture; + ConcreteSlotValueType concreteValueType = concreteValueTypePopupNew.ToConcreteSlotValueType(out isBareTexture); + // Because the type may have changed, we can't (always) just modify the existing slot. So create a new one and replace it. var newSlot = MaterialSlot.CreateMaterialSlot(concreteValueType.ToSlotValueType(), oldSlot.id, displayName, displayName, m_SlotType, Vector4.zero); newSlot.CopyValuesFrom(oldSlot); m_Node.AddSlot(newSlot, false); + newSlot.bareTexture = isBareTexture; - // Need to get all current slots as everything after the edited slot in the list must be added again - List slots = new List(); - if(m_SlotType == SlotType.Input) - m_Node.GetInputSlots(slots); - else - m_Node.GetOutputSlots(slots); - - // Iterate all the slots - foreach (MaterialSlot slot in slots) + List orderedSlotIds = new List(); + if (m_SlotType == SlotType.Input) { - // Because the list doesnt match the slot IDs (reordering) - // Need to get the index in the list of every slot - int listIndex = 0; - for(int i = 0; i < m_ReorderableList.list.Count; i++) - { - if((int)m_ReorderableList.list[i] == slot.id) - listIndex = i; - } + orderedSlotIds.AddRange(m_ReorderableList.list.OfType()); - // Then for everything after the edited slot - if(listIndex <= index) - continue; + List slots = new List(); + m_Node.GetOutputSlots(slots); + orderedSlotIds.AddRange(slots.Select(s => s.id)); + } + else + { + List slots = new List(); + m_Node.GetInputSlots(slots); + orderedSlotIds.AddRange(slots.Select(s => s.id)); - // Remove and re-add - m_Node.AddSlot(slot, false); + orderedSlotIds.AddRange(m_ReorderableList.list.OfType()); } + m_Node.SetSlotOrder(orderedSlotIds); + RecreateList(); m_Node.ValidateNode(); } From 6def4787279999a0e787058869e128188959f577 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 10 Nov 2020 07:45:25 -0800 Subject: [PATCH 04/28] Started on Cubemap/Array/3D --- .../Data/Graphs/CubemapShaderProperty.cs | 27 ++++++++++++++++++- .../Graphs/Texture2DArrayShaderProperty.cs | 27 ++++++++++++++++++- .../Data/Graphs/Texture3DShaderProperty.cs | 27 ++++++++++++++++++- 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs index ab9097f5b70..67231248b96 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs @@ -34,11 +34,36 @@ internal override void ForeachHLSLProperty(Action action) { action(new HLSLProperty(HLSLType._TextureCube, referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); + + // add struct macro + Action structDecl = (builder) => + { + builder.AppendIndentation(); + builder.Append("#define "); + builder.Append(referenceName); + builder.Append("_struct UnityBuildTextureCubeStruct(TEXTURECUBE_ARGS("); + builder.Append(referenceName); + builder.Append(", sampler"); builder.Append(referenceName); + builder.Append("))"); + // builder.Append(referenceName); builder.Append("_TexelSize, "); + // builder.Append(referenceName); builder.Append("_ST)"); + builder.AppendNewLine(); + }; + + action(new HLSLProperty(HLSLType._CUSTOM, referenceName + "_struct", HLSLDeclaration.Global, concretePrecision) + { + customDeclaration = structDecl + }); } internal override string GetPropertyAsArgumentString() { - return $"TEXTURECUBE_PARAM({referenceName}, sampler{referenceName})"; + return "UnityTextureCube " + referenceName + "_struct"; + } + + internal override string GetHLSLVariableName() + { + return referenceName + "_struct"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs index 9e39162395a..1e68bb3dd7b 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs @@ -32,11 +32,36 @@ internal override void ForeachHLSLProperty(Action action) { action(new HLSLProperty(HLSLType._Texture2DArray, referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); + + // add struct macro + Action structDecl = (builder) => + { + builder.AppendIndentation(); + builder.Append("#define "); + builder.Append(referenceName); + builder.Append("_struct UnityBuildTexture2DArrayStruct(TEXTURE2D_ARRAY_ARGS("); + builder.Append(referenceName); + builder.Append(", sampler"); builder.Append(referenceName); + builder.Append("))"); + // builder.Append(referenceName); builder.Append("_TexelSize, "); + // builder.Append(referenceName); builder.Append("_ST)"); + builder.AppendNewLine(); + }; + + action(new HLSLProperty(HLSLType._CUSTOM, referenceName + "_struct", HLSLDeclaration.Global, concretePrecision) + { + customDeclaration = structDecl + }); } internal override string GetPropertyAsArgumentString() { - return $"TEXTURE2D_ARRAY_PARAM({referenceName}, sampler{referenceName})"; + return "UnityTexture2DArray " + referenceName + "_struct"; + } + + internal override string GetHLSLVariableName() + { + return referenceName + "_struct"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs index c61dc08a21f..86455363c65 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs @@ -32,11 +32,36 @@ internal override void ForeachHLSLProperty(Action action) { action(new HLSLProperty(HLSLType._Texture3D, referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); + + // add struct macro + Action structDecl = (builder) => + { + builder.AppendIndentation(); + builder.Append("#define "); + builder.Append(referenceName); + builder.Append("_struct UnityBuildTexture3DStruct(TEXTURE3D_ARGS("); + builder.Append(referenceName); + builder.Append(", sampler"); builder.Append(referenceName); + builder.Append("))"); +// builder.Append(referenceName); builder.Append("_TexelSize, "); +// builder.Append(referenceName); builder.Append("_ST)"); + builder.AppendNewLine(); + }; + + action(new HLSLProperty(HLSLType._CUSTOM, referenceName + "_struct", HLSLDeclaration.Global, concretePrecision) + { + customDeclaration = structDecl + }); } internal override string GetPropertyAsArgumentString() { - return $"TEXTURE3D_PARAM({referenceName}, sampler{referenceName})"; + return "UnityTexture3D " + referenceName + "_struct"; + } + + internal override string GetHLSLVariableName() + { + return referenceName + "_struct"; } [SerializeField] From 7564cec7a1543bf2494001579ba1639ab617732a Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 10 Nov 2020 10:32:56 -0800 Subject: [PATCH 05/28] Partial fixes fore 3d/array/cubemap --- .../Data/Graphs/CubemapInputMaterialSlot.cs | 15 +++++++++------ .../Editor/Data/Graphs/CubemapMaterialSlot.cs | 8 ++++++++ .../Graphs/Texture2DArrayInputMaterialSlot.cs | 12 ++++++------ .../Data/Graphs/Texture3DInputMaterialSlot.cs | 12 ++++++------ .../Editor/Data/Util/SlotValueTypeUtil.cs | 6 +++--- 5 files changed, 32 insertions(+), 21 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs index 6b3d36726c9..6c084d82a67 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs @@ -42,21 +42,21 @@ public override VisualElement InstantiateControl() public override string GetDefaultValue(GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return matOwner.GetVariableNameForSlot(id); + return nodeOwner.GetVariableNameForSlot(id) + "_struct"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); var prop = new CubemapShaderProperty(); - prop.overrideReferenceName = matOwner.GetVariableNameForSlot(id); + prop.overrideReferenceName = nodeOwner.GetVariableNameForSlot(id); prop.modifiable = false; prop.generatePropertyBlock = true; prop.value.cubemap = cubemap; @@ -77,7 +77,10 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) { var slot = foundSlot as CubemapInputMaterialSlot; if (slot != null) + { m_Cubemap = slot.m_Cubemap; + m_BareTexture = slot.m_BareTexture; + } } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs index cf050fb11a1..c286e2ddaf1 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs @@ -28,6 +28,14 @@ internal override bool bareTexture set { m_BareTexture = value; } } + public override string GetHLSLVariableType() + { + if (m_BareTexture) + return "TextureCube"; + else + return concreteValueType.ToShaderString(); + } + public override SlotValueType valueType { get { return SlotValueType.Cubemap; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Cubemap; } } public override bool isDefaultValue => true; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs index ae6b35b4e85..589e53809c7 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs @@ -41,21 +41,21 @@ public override VisualElement InstantiateControl() public override string GetDefaultValue(GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return matOwner.GetVariableNameForSlot(id); + return nodeOwner.GetVariableNameForSlot(id) + "_struct"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); var prop = new Texture2DArrayShaderProperty(); - prop.overrideReferenceName = matOwner.GetVariableNameForSlot(id); + prop.overrideReferenceName = nodeOwner.GetVariableNameForSlot(id); prop.modifiable = false; prop.generatePropertyBlock = true; prop.value.textureArray = textureArray; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs index e328eeec699..8cb730a5c41 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs @@ -41,21 +41,21 @@ public override VisualElement InstantiateControl() public override string GetDefaultValue(GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return matOwner.GetVariableNameForSlot(id); + return nodeOwner.GetVariableNameForSlot(id) + "_struct"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); var prop = new Texture3DShaderProperty(); - prop.overrideReferenceName = matOwner.GetVariableNameForSlot(id); + prop.overrideReferenceName = nodeOwner.GetVariableNameForSlot(id); prop.modifiable = false; prop.generatePropertyBlock = true; prop.value.texture = texture; diff --git a/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs b/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs index b7d438b435d..5f082659657 100644 --- a/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs @@ -144,11 +144,11 @@ public static string ToShaderString(this ConcreteSlotValueType type, string prec case ConcreteSlotValueType.Texture2D: return "UnityTexture2D"; case ConcreteSlotValueType.Texture2DArray: - return "Texture2DArray"; + return "UnityTexture2DArray"; case ConcreteSlotValueType.Texture3D: - return "Texture3D"; + return "UnityTexture3D"; case ConcreteSlotValueType.Cubemap: - return "TextureCube"; + return "UnityTextureCube"; case ConcreteSlotValueType.Gradient: return "Gradient"; case ConcreteSlotValueType.Vector4: From 6d95d2bf39a2ea963fd1ddba405ad4a56dab6690 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 10 Nov 2020 14:21:47 -0800 Subject: [PATCH 06/28] Fix for texelSize node --- .../Editor/Data/Nodes/Input/Texture/TexelSizeNode.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TexelSizeNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TexelSizeNode.cs index 88605fb24ab..0f3281b3fcf 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TexelSizeNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/TexelSizeNode.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using UnityEngine; using UnityEditor.Graphing; using UnityEditor.ShaderGraph.Drawing.Controls; @@ -37,8 +37,8 @@ public sealed override void UpdateNodeAfterDeserialization() // Node generations public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { - sb.AppendLine(string.Format("$precision {0} = {1}_TexelSize.z;", GetVariableNameForSlot(OutputSlotWId), GetSlotValue(TextureInputId, generationMode))); - sb.AppendLine(string.Format("$precision {0} = {1}_TexelSize.w;", GetVariableNameForSlot(OutputSlotHId), GetSlotValue(TextureInputId, generationMode))); + sb.AppendLine(string.Format("$precision {0} = {1}.texelSize.z;", GetVariableNameForSlot(OutputSlotWId), GetSlotValue(TextureInputId, generationMode))); + sb.AppendLine(string.Format("$precision {0} = {1}.texelSize.w;", GetVariableNameForSlot(OutputSlotHId), GetSlotValue(TextureInputId, generationMode))); } public bool RequiresMeshUV(UVChannel channel, ShaderStageCapability stageCapability) From a1acbb37c29a284ea9a3ebf3b550299094eac3b7 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 10 Nov 2020 15:06:09 -0800 Subject: [PATCH 07/28] Texture2D nodes all working --- .../Artistic/Normal/NormalFromTextureNode.cs | 9 +++---- .../Input/Texture/SampleTexture2DLODNode.cs | 4 ++-- .../Data/Nodes/UV/ParallaxMappingNode.cs | 4 ++-- .../Nodes/UV/ParallaxOcclusionMappingNode.cs | 2 +- .../Editor/Data/Nodes/UV/TriplanarNode.cs | 24 +++++++++---------- .../Data/Nodes/Utility/CustomFunctionNode.cs | 2 +- .../Editor/Importers/ShaderGraphImporter.cs | 4 ++-- .../Importers/ShaderSubGraphImporter.cs | 2 +- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs index 91d84cfa49d..f38badd5a2c 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs @@ -61,18 +61,19 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo if (edgesSampler.Any()) samplerValue = GetSlotValue(SamplerInputId, generationMode); else - samplerValue = string.Format("sampler{0}", GetSlotValue(TextureInputId, generationMode)); + samplerValue = string.Format("{0}.texSampler", textureValue); sb.AppendLine("{0} {1};", FindOutputSlot(OutputSlotId).concreteValueType.ToShaderString(), GetVariableNameForSlot(OutputSlotId)); - sb.AppendLine("{0}({1}, {2}, {3}, {4}, {5}, {6});", GetFunctionName(), textureValue, samplerValue, uvValue, offsetValue, strengthValue, outputValue); + sb.AppendLine("{0}({1}.tex, {2}, {3}, {4}, {5}, {6});", GetFunctionName(), textureValue, samplerValue, uvValue, offsetValue, strengthValue, outputValue); } public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode generationMode) { registry.ProvideFunction(GetFunctionName(), s => { - s.AppendLine("void {0}({1} Texture, {2} Sampler, {3} UV, {4} Offset, {5} Strength, out {6} Out)", GetFunctionName(), - FindInputSlot(TextureInputId).concreteValueType.ToShaderString(), + s.AppendLine("void {0}({1} Texture, {2} Sampler, {3} UV, {4} Offset, {5} Strength, out {6} Out)", + GetFunctionName(), + "Texture2D", FindInputSlot(SamplerInputId).concreteValueType.ToShaderString(), FindInputSlot(UVInputId).concreteValueType.ToShaderString(), FindInputSlot(OffsetInputId).concreteValueType.ToShaderString(), diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs index 5bf5af3b4e9..00ead689688 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs @@ -117,10 +117,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene } sb.AppendLine("#else"); { - var result = string.Format(" $precision4 {0} = SAMPLE_TEXTURE2D_LOD({1}, {2}, {3}, {4});" + var result = string.Format(" $precision4 {0} = SAMPLE_TEXTURE2D_LOD({1}.tex, {2}, {3}, {4});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler" , uvName , lodSlot); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs index 73137640e6b..225ae733df4 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs @@ -78,9 +78,9 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo var amplitude = GetSlotValue(kAmplitudeSlotId, generationMode); var uvs = GetSlotValue(kUVsSlotId, generationMode); - sb.AppendLines(String.Format(@"$precision2 {5} = {4} + ParallaxMapping({0}, {1}, IN.{2}, {3} * 0.01, {4});", + sb.AppendLines(String.Format(@"$precision2 {5} = {4} + ParallaxMapping({0}.tex, {1}, IN.{2}, {3} * 0.01, {4});", heightmap, - edgesSampler.Any() ? GetSlotValue(kHeightmapSamplerSlotId, generationMode) : "sampler" + heightmap, + edgesSampler.Any() ? GetSlotValue(kHeightmapSamplerSlotId, generationMode) : heightmap + ".texSampler", CoordinateSpace.Tangent.ToVariableName(InterpolatorType.ViewDirection), amplitude, // cm in the interface so we multiply by 0.01 in the shader to convert in meter uvs, diff --git a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs index e13b123c939..2690ad90e1a 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs @@ -161,7 +161,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLines($@" $precision {tmpOutHeight}; -$precision2 {GetVariableNameForSlot(kParallaxUVsOutputSlotId)} = {uvs} + ParallaxOcclusionMapping{GetVariableNameForNode()}({lod}, {lodThreshold}, {steps}, {tmpViewDirUV}, {tmpPOMParam}, {tmpOutHeight}, TEXTURE2D_ARGS({heightmap}, {sampler})); +$precision2 {GetVariableNameForSlot(kParallaxUVsOutputSlotId)} = {uvs} + ParallaxOcclusionMapping{GetVariableNameForNode()}({lod}, {lodThreshold}, {steps}, {tmpViewDirUV}, {tmpPOMParam}, {tmpOutHeight}, TEXTURE2D_ARGS({heightmap}.tex, {sampler})); $precision {GetVariableNameForSlot(kPixelDepthOffsetOutputSlotId)} = ({tmpMaxHeight} - {tmpOutHeight} * {tmpMaxHeight}) / max({tmpNdotV}, 0.0001); "); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs index 0c72358ee20..60d02070e51 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs @@ -98,20 +98,20 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene , GetSlotValue(BlendInputId, generationMode)); sb.AppendLine("{0}_Blend /= ({0}_Blend.x + {0}_Blend.y + {0}_Blend.z ).xxx;", GetVariableNameForNode()); - sb.AppendLine("$precision3 {0}_X = UnpackNormal(SAMPLE_TEXTURE2D({1}, {2}, {0}_UV.zy));" + sb.AppendLine("$precision3 {0}_X = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.zy));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler" + id); - sb.AppendLine("$precision3 {0}_Y = UnpackNormal(SAMPLE_TEXTURE2D({1}, {2}, {0}_UV.xz));" + sb.AppendLine("$precision3 {0}_Y = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xz));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); - sb.AppendLine("$precision3 {0}_Z = UnpackNormal(SAMPLE_TEXTURE2D({1}, {2}, {0}_UV.xy));" + sb.AppendLine("$precision3 {0}_Z = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xy));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); sb.AppendLine("{0}_X = $precision3({0}_X.xy + {1}.zy, abs({0}_X.z) * {1}.x);" , GetVariableNameForNode() @@ -148,20 +148,20 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene , GetSlotValue(NormalInputId, generationMode) , GetSlotValue(BlendInputId, generationMode)); sb.AppendLine("{0}_Blend /= dot({0}_Blend, 1.0);", GetVariableNameForNode()); - sb.AppendLine("$precision4 {0}_X = SAMPLE_TEXTURE2D({1}, {2}, {0}_UV.zy);" + sb.AppendLine("$precision4 {0}_X = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.zy);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); - sb.AppendLine("$precision4 {0}_Y = SAMPLE_TEXTURE2D({1}, {2}, {0}_UV.xz);" + sb.AppendLine("$precision4 {0}_Y = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xz);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); - sb.AppendLine("$precision4 {0}_Z = SAMPLE_TEXTURE2D({1}, {2}, {0}_UV.xy);" + sb.AppendLine("$precision4 {0}_Z = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xy);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); sb.AppendLine("$precision4 {0} = {1}_X * {1}_Blend.x + {1}_Y * {1}_Blend.y + {1}_Z * {1}_Blend.z;" , GetVariableNameForSlot(OutputSlotId) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs index 71ed43f8353..4d97ffd2ebb 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs @@ -333,7 +333,7 @@ void ValidateBareTextureSlots() { if (slot.bareTexture) { - owner.AddValidationError(objectId, "This node uses Bare Texture outputs, which may not work when fed to other nodes. Please convert the node to use full Texture2D struct-based outputs (see UnityTexture2D in com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl)", ShaderCompilerMessageSeverity.Warning); + owner.AddValidationError(objectId, "This node uses Bare Texture outputs, which may not work when fed to other nodes. Please convert the node to use full struct-based outputs (see UnityTexture structs in com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl)", ShaderCompilerMessageSeverity.Warning); break; } } diff --git a/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs b/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs index 465d3945ff1..ebb44b107ef 100644 --- a/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs +++ b/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs @@ -24,9 +24,9 @@ namespace UnityEditor.ShaderGraph // sure that all shader graphs get re-imported. Re-importing is required, // because the shader graph codegen is different for V2. // This ifdef can be removed once V2 is the only option. - [ScriptedImporter(108, Extension, -902)] + [ScriptedImporter(109, Extension, -902)] #else - [ScriptedImporter(40, Extension, -902)] + [ScriptedImporter(41, Extension, -902)] #endif class ShaderGraphImporter : ScriptedImporter diff --git a/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs b/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs index 73b19f28aff..e4b5cfa660e 100644 --- a/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs +++ b/com.unity.shadergraph/Editor/Importers/ShaderSubGraphImporter.cs @@ -18,7 +18,7 @@ namespace UnityEditor.ShaderGraph { [ExcludeFromPreset] - [ScriptedImporter(16, Extension, -905)] + [ScriptedImporter(17, Extension, -905)] class ShaderSubGraphImporter : ScriptedImporter { public const string Extension = "shadersubgraph"; From 5529870d3f458cfcd0b48e05ac703fd10ef48b89 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 10 Nov 2020 17:13:21 -0800 Subject: [PATCH 08/28] Fixes for cubemap nodes, Texture2DArray nodes, Texture3d nodes --- .../Nodes/Input/Texture/CubemapAssetNode.cs | 23 +++++++++++++++++-- .../Nodes/Input/Texture/SampleCubemapNode.cs | 4 ++-- .../Input/Texture/SampleRawCubemapNode.cs | 4 ++-- .../Input/Texture/SampleTexture2DArrayNode.cs | 4 ++-- .../Input/Texture/SampleTexture3DNode.cs | 4 ++-- .../Input/Texture/Texture2DArrayAssetNode.cs | 22 ++++++++++++++++-- .../Nodes/Input/Texture/Texture3DAssetNode.cs | 22 ++++++++++++++++-- .../Editor/Data/Nodes/Utility/SubGraphNode.cs | 16 +------------ 8 files changed, 70 insertions(+), 29 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs index a661344d62f..7924caddc94 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs @@ -42,11 +42,30 @@ public Cubemap cubemap } } + string GetTexturePropertyName() + { + return base.GetVariableNameForSlot(OutputSlotId); + } + + string GetTextureVariableName() + { + return GetTexturePropertyName() + "_struct"; + } + + public override string GetVariableNameForSlot(int slotId) + { + if (slotId == OutputSlotId) + return GetTextureVariableName(); + else + return base.GetVariableNameForSlot(slotId); + } + public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) { properties.AddShaderProperty(new CubemapShaderProperty() { - overrideReferenceName = GetVariableNameForSlot(OutputSlotId), + // NOTE : this changes (hidden) shader property names... which could cause Material changes + overrideReferenceName = GetTexturePropertyName(), generatePropertyBlock = true, value = m_Cubemap, modifiable = false @@ -57,7 +76,7 @@ public override void CollectPreviewMaterialProperties(List prop { properties.Add(new PreviewProperty(PropertyType.Cubemap) { - name = GetVariableNameForSlot(OutputSlotId), + name = GetTexturePropertyName(), cubemapValue = cubemap }); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs index c5d8d99dd42..3472ee17a56 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs @@ -55,10 +55,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(CubemapInputId, generationMode); - string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}, {2}, reflect(-{3}, {4}), {5});" + string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}.tex, {2}, reflect(-{3}, {4}), {5});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler" , GetSlotValue(ViewDirInputId, generationMode) , GetSlotValue(NormalInputId, generationMode) , GetSlotValue(LODInputId, generationMode)); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs index 65c5025421f..96c4ffc2865 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs @@ -51,10 +51,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(CubemapInputId, generationMode); - string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}, {2}, {3}, {4});" + string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}.tex, {2}, {3}, {4});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : "sampler" + id + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler" , GetSlotValue(NormalInputId, generationMode) , GetSlotValue(LODInputId, generationMode)); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs index 9cf55fca464..633e061bca8 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs @@ -63,10 +63,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(TextureInputId, generationMode); - var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D_ARRAY({1}, {2}, {3}, {4});" + var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D_ARRAY({1}.tex, {2}, {3}, {4});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : "sampler" + id + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".texSampler" , uvName , indexName); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs index 61855dca003..2f644eeed1a 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs @@ -46,10 +46,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(TextureInputId, generationMode); - var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE3D({1}, {2}, {3});" + var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE3D({1}.tex, {2}, {3});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : "sampler" + id + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".texSampler" , uvName); sb.AppendLine(result); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs index 12da6c0b8aa..97e0e3f4008 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs @@ -42,11 +42,29 @@ public Texture2DArray texture } } + string GetTexturePropertyName() + { + return base.GetVariableNameForSlot(OutputSlotId); + } + + string GetTextureVariableName() + { + return GetTexturePropertyName() + "_struct"; + } + + public override string GetVariableNameForSlot(int slotId) + { + if (slotId == OutputSlotId) + return GetTextureVariableName(); + else + return base.GetVariableNameForSlot(slotId); + } + public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) { properties.AddShaderProperty(new Texture2DArrayShaderProperty() { - overrideReferenceName = GetVariableNameForSlot(OutputSlotId), + overrideReferenceName = GetTexturePropertyName(), generatePropertyBlock = true, value = m_Texture, modifiable = false @@ -57,7 +75,7 @@ public override void CollectPreviewMaterialProperties(List prop { properties.Add(new PreviewProperty(PropertyType.Texture2DArray) { - name = GetVariableNameForSlot(OutputSlotId), + name = GetTexturePropertyName(), textureValue = texture }); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs index 9deb73dc0a8..aa183a8028c 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs @@ -42,11 +42,29 @@ public Texture3D texture } } + string GetTexturePropertyName() + { + return base.GetVariableNameForSlot(OutputSlotId); + } + + string GetTextureVariableName() + { + return GetTexturePropertyName() + "_struct"; + } + + public override string GetVariableNameForSlot(int slotId) + { + if (slotId == OutputSlotId) + return GetTextureVariableName(); + else + return base.GetVariableNameForSlot(slotId); + } + public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) { properties.AddShaderProperty(new Texture3DShaderProperty() { - overrideReferenceName = GetVariableNameForSlot(OutputSlotId), + overrideReferenceName = GetTexturePropertyName(), generatePropertyBlock = true, value = m_Texture, modifiable = false @@ -57,7 +75,7 @@ public override void CollectPreviewMaterialProperties(List prop { properties.Add(new PreviewProperty(PropertyType.Texture3D) { - name = GetVariableNameForSlot(OutputSlotId), + name = GetTexturePropertyName(), textureValue = texture }); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs index c5fae6b3a64..1a1b69b6d44 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs @@ -214,21 +214,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo prop.ValidateConcretePrecision(asset.graphPrecision); var inSlotId = m_PropertyIds[m_PropertyGuids.IndexOf(prop.guid.ToString())]; - switch (prop) - { - case Texture2DArrayShaderProperty texture2DArrayProp: - arguments.Add(string.Format("TEXTURE2D_ARRAY_ARGS({0}, sampler{0})", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); - break; - case Texture3DShaderProperty texture3DProp: - arguments.Add(string.Format("TEXTURE3D_ARGS({0}, sampler{0})", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); - break; - case CubemapShaderProperty cubemapProp: - arguments.Add(string.Format("TEXTURECUBE_ARGS({0}, sampler{0})", GetSlotValue(inSlotId, generationMode, prop.concretePrecision))); - break; - default: - arguments.Add(GetSlotValue(inSlotId, generationMode, prop.concretePrecision)); - break; - } + arguments.Add(GetSlotValue(inSlotId, generationMode, prop.concretePrecision)); } // pass surface inputs through From 2f57ecbdb568c28f3e1eae85a8c64190ab9254b9 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 10 Nov 2020 17:56:08 -0800 Subject: [PATCH 09/28] Fix for HDRP --- .../Editor/Material/ShaderGraph/Templates/ShaderPass.template | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Templates/ShaderPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Templates/ShaderPass.template index da6db148bac..c5abaa8c21b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Templates/ShaderPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Templates/ShaderPass.template @@ -25,6 +25,7 @@ Pass $splice(GraphKeywords) #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" From 51cd85ab76eacde19382a44997a0ca12111f21b8 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 10 Nov 2020 18:32:46 -0800 Subject: [PATCH 10/28] Fixes for GLES2 --- .../ShaderLibrary/Texture.hlsl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index 493252a4bbb..10649bfbcb5 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -1,10 +1,16 @@ #ifndef UNITY_TEXTURE_INCLUDED #define UNITY_TEXTURE_INCLUDED +#ifdef SHADER_API_GLES + #define SAMPLERDECL(n) +#else + #define SAMPLERDECL(n) SAMPLER(n); +#endif + struct UnityTexture2D { TEXTURE2D(tex); - SAMPLER(texSampler); + SAMPLERDECL(texSampler) float4 texelSize; float4 scaleTranslate; }; @@ -22,7 +28,7 @@ UnityTexture2D UnityBuildTexture2DStruct(TEXTURE2D_PARAM(tex, texSampler), float struct UnityTexture2DArray { TEXTURE2D_ARRAY(tex); - SAMPLER(texSampler); + SAMPLERDECL(texSampler) // float4 texelSize; // ?? are these valid for Texture2DArrays? // float4 scaleTranslate; // ?? }; @@ -41,7 +47,7 @@ UnityTexture2DArray UnityBuildTexture2DArrayStruct(TEXTURE2D_ARRAY_PARAM(tex, te struct UnityTextureCube { TEXTURECUBE(tex); - SAMPLER(texSampler); + SAMPLERDECL(texSampler) // float4 texelSize; // ?? are these valid for Texture2DArrays? // float4 scaleTranslate; // ?? }; @@ -60,7 +66,7 @@ UnityTextureCube UnityBuildTextureCubeStruct(TEXTURECUBE_PARAM(tex, texSampler)) struct UnityTexture3D { TEXTURE3D(tex); - SAMPLER(texSampler); + SAMPLERDECL(texSampler) // float4 texelSize; // ?? are these valid for Texture2DArrays? // float4 scaleTranslate; // ?? }; @@ -75,4 +81,6 @@ UnityTexture3D UnityBuildTexture3DStruct(TEXTURE3D_PARAM(tex, texSampler)) //, f return result; } +#undef SAMPLERDECL + #endif // UNITY_TEXTURE_INCLUDED From 59fd40d151d2d8f602717727ad0988e1cc95a561 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Wed, 11 Nov 2020 09:54:41 -0800 Subject: [PATCH 11/28] Fixes for NormalFromTextureNode, Texture2dAssetNode --- .../ShaderLibrary/Texture.hlsl | 45 +++++++++++++------ .../Artistic/Normal/NormalFromTextureNode.cs | 14 +++--- .../Nodes/Input/Texture/CubemapAssetNode.cs | 1 - .../Nodes/Input/Texture/SampleCubemapNode.cs | 2 +- .../Input/Texture/SampleRawCubemapNode.cs | 2 +- .../Input/Texture/SampleTexture2DArrayNode.cs | 2 +- .../Input/Texture/SampleTexture2DLODNode.cs | 2 +- .../Input/Texture/SampleTexture2DNode.cs | 2 +- .../Input/Texture/SampleTexture3DNode.cs | 2 +- .../Nodes/Input/Texture/Texture2DAssetNode.cs | 5 +-- .../Data/Nodes/UV/ParallaxMappingNode.cs | 2 +- .../Editor/Data/Nodes/UV/TriplanarNode.cs | 12 ++--- 12 files changed, 53 insertions(+), 38 deletions(-) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index 10649bfbcb5..405a46ffe25 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -2,24 +2,43 @@ #define UNITY_TEXTURE_INCLUDED #ifdef SHADER_API_GLES - #define SAMPLERDECL(n) + #define SAMPLERDECL(n) GLES2UnsupportedSamplerState n; #else #define SAMPLERDECL(n) SAMPLER(n); #endif +struct GLES2UnsupportedSamplerState +{ + // if you get an error trying to use this structure, + // then the shader code is trying to use a samplerstate on a GLES2 device, which is not supported + // make sure all of the shader code is properly guarded by using the texture and sampler macros defined in GLES2.hlsl +}; + +struct UnitySamplerState +{ + SAMPLERDECL(samplerstate) +}; + +UnitySamplerState UnityBuildSamplerStateStruct(SAMPLER(samplerstate)) +{ + UnitySamplerState result; + ASSIGN_SAMPLER(result.samplerstate, samplerstate); + return result; +} + struct UnityTexture2D { TEXTURE2D(tex); - SAMPLERDECL(texSampler) + SAMPLERDECL(samplerstate) float4 texelSize; float4 scaleTranslate; }; -UnityTexture2D UnityBuildTexture2DStruct(TEXTURE2D_PARAM(tex, texSampler), float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +UnityTexture2D UnityBuildTexture2DStruct(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) { UnityTexture2D result; result.tex = tex; - ASSIGN_SAMPLER(result.texSampler, texSampler); + ASSIGN_SAMPLER(result.samplerstate, samplerstate); result.texelSize = texelSize; result.scaleTranslate = scaleTranslate; return result; @@ -28,16 +47,16 @@ UnityTexture2D UnityBuildTexture2DStruct(TEXTURE2D_PARAM(tex, texSampler), float struct UnityTexture2DArray { TEXTURE2D_ARRAY(tex); - SAMPLERDECL(texSampler) + SAMPLERDECL(samplerstate) // float4 texelSize; // ?? are these valid for Texture2DArrays? // float4 scaleTranslate; // ?? }; -UnityTexture2DArray UnityBuildTexture2DArrayStruct(TEXTURE2D_ARRAY_PARAM(tex, texSampler)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +UnityTexture2DArray UnityBuildTexture2DArrayStruct(TEXTURE2D_ARRAY_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) { UnityTexture2DArray result; result.tex = tex; - ASSIGN_SAMPLER(result.texSampler, texSampler); + ASSIGN_SAMPLER(result.samplerstate, samplerstate); // result.texelSize = texelSize; // result.scaleTranslate = scaleTranslate; return result; @@ -47,16 +66,16 @@ UnityTexture2DArray UnityBuildTexture2DArrayStruct(TEXTURE2D_ARRAY_PARAM(tex, te struct UnityTextureCube { TEXTURECUBE(tex); - SAMPLERDECL(texSampler) + SAMPLERDECL(samplerstate) // float4 texelSize; // ?? are these valid for Texture2DArrays? // float4 scaleTranslate; // ?? }; -UnityTextureCube UnityBuildTextureCubeStruct(TEXTURECUBE_PARAM(tex, texSampler)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +UnityTextureCube UnityBuildTextureCubeStruct(TEXTURECUBE_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) { UnityTextureCube result; result.tex = tex; - ASSIGN_SAMPLER(result.texSampler, texSampler); + ASSIGN_SAMPLER(result.samplerstate, samplerstate); // result.texelSize = texelSize; // result.scaleTranslate = scaleTranslate; return result; @@ -66,16 +85,16 @@ UnityTextureCube UnityBuildTextureCubeStruct(TEXTURECUBE_PARAM(tex, texSampler)) struct UnityTexture3D { TEXTURE3D(tex); - SAMPLERDECL(texSampler) + SAMPLERDECL(samplerstate) // float4 texelSize; // ?? are these valid for Texture2DArrays? // float4 scaleTranslate; // ?? }; -UnityTexture3D UnityBuildTexture3DStruct(TEXTURE3D_PARAM(tex, texSampler)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +UnityTexture3D UnityBuildTexture3DStruct(TEXTURE3D_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) { UnityTexture3D result; result.tex = tex; - ASSIGN_SAMPLER(result.texSampler, texSampler); + ASSIGN_SAMPLER(result.samplerstate, samplerstate); // result.texelSize = texelSize; // result.scaleTranslate = scaleTranslate; return result; diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs index f38badd5a2c..95df4be12f6 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs @@ -61,20 +61,18 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo if (edgesSampler.Any()) samplerValue = GetSlotValue(SamplerInputId, generationMode); else - samplerValue = string.Format("{0}.texSampler", textureValue); + samplerValue = string.Format("{0}.samplerstate", textureValue); sb.AppendLine("{0} {1};", FindOutputSlot(OutputSlotId).concreteValueType.ToShaderString(), GetVariableNameForSlot(OutputSlotId)); - sb.AppendLine("{0}({1}.tex, {2}, {3}, {4}, {5}, {6});", GetFunctionName(), textureValue, samplerValue, uvValue, offsetValue, strengthValue, outputValue); + sb.AppendLine("{0}(TEXTURE2D_ARGS({1}.tex, {2}), {3}, {4}, {5}, {6});", GetFunctionName(), textureValue, samplerValue, uvValue, offsetValue, strengthValue, outputValue); } public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode generationMode) { registry.ProvideFunction(GetFunctionName(), s => { - s.AppendLine("void {0}({1} Texture, {2} Sampler, {3} UV, {4} Offset, {5} Strength, out {6} Out)", + s.AppendLine("void {0}(TEXTURE2D_PARAM(Texture, Sampler), {1} UV, {2} Offset, {3} Strength, out {4} Out)", GetFunctionName(), - "Texture2D", - FindInputSlot(SamplerInputId).concreteValueType.ToShaderString(), FindInputSlot(UVInputId).concreteValueType.ToShaderString(), FindInputSlot(OffsetInputId).concreteValueType.ToShaderString(), FindInputSlot(StrengthInputId).concreteValueType.ToShaderString(), @@ -85,9 +83,9 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener s.AppendLine("$precision2 offsetU = $precision2(UV.x + Offset, UV.y);"); s.AppendLine("$precision2 offsetV = $precision2(UV.x, UV.y + Offset);"); - s.AppendLine("$precision normalSample = Texture.Sample(Sampler, UV);"); - s.AppendLine("$precision uSample = Texture.Sample(Sampler, offsetU);"); - s.AppendLine("$precision vSample = Texture.Sample(Sampler, offsetV);"); + s.AppendLine("$precision normalSample = SAMPLE_TEXTURE2D(Texture, Sampler, UV);"); + s.AppendLine("$precision uSample = SAMPLE_TEXTURE2D(Texture, Sampler, offsetU);"); + s.AppendLine("$precision vSample = SAMPLE_TEXTURE2D(Texture, Sampler, offsetV);"); s.AppendLine("$precision3 va = $precision3(1, 0, (uSample - normalSample) * Strength);"); s.AppendLine("$precision3 vb = $precision3(0, 1, (vSample - normalSample) * Strength);"); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs index 7924caddc94..f0f11e1ce31 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs @@ -64,7 +64,6 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener { properties.AddShaderProperty(new CubemapShaderProperty() { - // NOTE : this changes (hidden) shader property names... which could cause Material changes overrideReferenceName = GetTexturePropertyName(), generatePropertyBlock = true, value = m_Cubemap, diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs index 3472ee17a56..96be41296b3 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs @@ -58,7 +58,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}.tex, {2}, reflect(-{3}, {4}), {5});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler" + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate" , GetSlotValue(ViewDirInputId, generationMode) , GetSlotValue(NormalInputId, generationMode) , GetSlotValue(LODInputId, generationMode)); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs index 96c4ffc2865..a02b54cb5fd 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs @@ -54,7 +54,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}.tex, {2}, {3}, {4});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler" + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate" , GetSlotValue(NormalInputId, generationMode) , GetSlotValue(LODInputId, generationMode)); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs index 633e061bca8..d7c5ae4a4e5 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs @@ -66,7 +66,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D_ARRAY({1}.tex, {2}, {3}, {4});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".texSampler" + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".samplerstate" , uvName , indexName); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs index 00ead689688..a18f6899e92 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs @@ -120,7 +120,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var result = string.Format(" $precision4 {0} = SAMPLE_TEXTURE2D_LOD({1}.tex, {2}, {3}, {4});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler" + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate" , uvName , lodSlot); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs index b4b0bc5432f..3bea358a41c 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs @@ -112,7 +112,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D({1}.tex, {2}, {3});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".texSampler" + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".samplerstate" , uvName); sb.AppendLine(result); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs index 2f644eeed1a..4256cf0003e 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs @@ -49,7 +49,7 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE3D({1}.tex, {2}, {3});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".texSampler" + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".samplerstate" , uvName); sb.AppendLine(result); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs index 98fadaf847b..4c80fccd8ca 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs @@ -44,12 +44,12 @@ public Texture texture string GetTexturePropertyName() { - return string.Format("_{0}_texture", GetVariableNameForNode()); + return base.GetVariableNameForSlot(OutputSlotId); } string GetTextureVariableName() { - return string.Format("_{0}_texture_struct", GetVariableNameForNode()); + return GetTexturePropertyName() + "_struct"; } public override string GetVariableNameForSlot(int slotId) @@ -64,7 +64,6 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener { properties.AddShaderProperty(new Texture2DShaderProperty() { - // NOTE : this changes (hidden) shader property names... which could cause Material changes overrideReferenceName = GetTexturePropertyName(), generatePropertyBlock = true, value = m_Texture, diff --git a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs index 225ae733df4..76b9ca3aabc 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs @@ -80,7 +80,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLines(String.Format(@"$precision2 {5} = {4} + ParallaxMapping({0}.tex, {1}, IN.{2}, {3} * 0.01, {4});", heightmap, - edgesSampler.Any() ? GetSlotValue(kHeightmapSamplerSlotId, generationMode) : heightmap + ".texSampler", + edgesSampler.Any() ? GetSlotValue(kHeightmapSamplerSlotId, generationMode) : heightmap + ".samplerstate", CoordinateSpace.Tangent.ToVariableName(InterpolatorType.ViewDirection), amplitude, // cm in the interface so we multiply by 0.01 in the shader to convert in meter uvs, diff --git a/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs index 60d02070e51..de0647308b7 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs @@ -101,17 +101,17 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene sb.AppendLine("$precision3 {0}_X = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.zy));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler" + id); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate" + id); sb.AppendLine("$precision3 {0}_Y = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xz));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); sb.AppendLine("$precision3 {0}_Z = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xy));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); sb.AppendLine("{0}_X = $precision3({0}_X.xy + {1}.zy, abs({0}_X.z) * {1}.x);" , GetVariableNameForNode() @@ -151,17 +151,17 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene sb.AppendLine("$precision4 {0}_X = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.zy);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); sb.AppendLine("$precision4 {0}_Y = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xz);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); sb.AppendLine("$precision4 {0}_Z = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xy);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".texSampler"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); sb.AppendLine("$precision4 {0} = {1}_X * {1}_Blend.x + {1}_Y * {1}_Blend.y + {1}_Z * {1}_Blend.z;" , GetVariableNameForSlot(OutputSlotId) From 32c4aed7d12520b025f1b5e6714e441a907508a8 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Thu, 12 Nov 2020 14:27:13 -0800 Subject: [PATCH 12/28] Added SamplerState handling, cleaned up code to remove macro usage --- .../ShaderLibrary/Texture.hlsl | 24 +++++--- .../Data/Graphs/AbstractShaderProperty.cs | 2 +- .../Data/Graphs/CubemapInputMaterialSlot.cs | 4 +- .../Editor/Data/Graphs/CubemapMaterialSlot.cs | 10 ++-- .../Data/Graphs/CubemapShaderProperty.cs | 29 ++------- .../Editor/Data/Graphs/MaterialSlot.cs | 4 +- .../Data/Graphs/SamplerStateMaterialSlot.cs | 30 ++++++++-- .../Data/Graphs/SamplerStateShaderProperty.cs | 12 +++- .../Graphs/Texture2DArrayInputMaterialSlot.cs | 4 +- .../Data/Graphs/Texture2DArrayMaterialSlot.cs | 10 ++-- .../Graphs/Texture2DArrayShaderProperty.cs | 29 ++------- .../Data/Graphs/Texture2DInputMaterialSlot.cs | 4 +- .../Data/Graphs/Texture2DMaterialSlot.cs | 12 ++-- .../Data/Graphs/Texture2DShaderProperty.cs | 29 ++------- .../Data/Graphs/Texture3DInputMaterialSlot.cs | 4 +- .../Data/Graphs/Texture3DMaterialSlot.cs | 10 ++-- .../Data/Graphs/Texture3DShaderProperty.cs | 29 ++------- .../Editor/Data/Nodes/Input/PropertyNode.cs | 59 +++++++++++-------- .../Nodes/Input/Texture/CubemapAssetNode.cs | 2 +- .../Nodes/Input/Texture/SampleCubemapNode.cs | 4 +- .../Input/Texture/SampleTexture2DArrayNode.cs | 4 +- .../Input/Texture/SampleTexture2DNode.cs | 4 +- .../Input/Texture/SampleTexture3DNode.cs | 4 +- .../Nodes/Input/Texture/SamplerStateNode.cs | 17 +++++- .../Input/Texture/Texture2DArrayAssetNode.cs | 2 +- .../Nodes/Input/Texture/Texture2DAssetNode.cs | 2 +- .../Nodes/Input/Texture/Texture3DAssetNode.cs | 2 +- .../Editor/Data/Nodes/SlotValue.cs | 30 ++++++---- .../Data/Nodes/Utility/CustomFunctionNode.cs | 22 ++++--- .../Editor/Data/Util/SlotValueTypeUtil.cs | 2 +- .../Drawing/Views/ReorderableSlotListView.cs | 17 +++--- 31 files changed, 211 insertions(+), 206 deletions(-) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index 405a46ffe25..d901a97426c 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -9,9 +9,6 @@ struct GLES2UnsupportedSamplerState { - // if you get an error trying to use this structure, - // then the shader code is trying to use a samplerstate on a GLES2 device, which is not supported - // make sure all of the shader code is properly guarded by using the texture and sampler macros defined in GLES2.hlsl }; struct UnitySamplerState @@ -19,7 +16,13 @@ struct UnitySamplerState SAMPLERDECL(samplerstate) }; -UnitySamplerState UnityBuildSamplerStateStruct(SAMPLER(samplerstate)) +#ifdef SHADER_API_GLES + #define UnityBuildSamplerStateStruct(n) UnityBuildSamplerStateStructInternal() +#else + #define UnityBuildSamplerStateStruct(n) UnityBuildSamplerStateStructInternal(n) +#endif + +UnitySamplerState UnityBuildSamplerStateStructInternal(SAMPLER(samplerstate)) { UnitySamplerState result; ASSIGN_SAMPLER(result.samplerstate, samplerstate); @@ -34,7 +37,9 @@ struct UnityTexture2D float4 scaleTranslate; }; -UnityTexture2D UnityBuildTexture2DStruct(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +#define UnityBuildTexture2DStruct(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, n##_ST) +#define UnityBuildTexture2DStructNoScale(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler_##n), n##_TexelSize) +UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) { UnityTexture2D result; result.tex = tex; @@ -52,7 +57,8 @@ struct UnityTexture2DArray // float4 scaleTranslate; // ?? }; -UnityTexture2DArray UnityBuildTexture2DArrayStruct(TEXTURE2D_ARRAY_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +#define UnityBuildTexture2DArrayStruct(n) UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_ARGS(n, sampler##n)) +UnityTexture2DArray UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_PARAM(tex, samplerstate)) { UnityTexture2DArray result; result.tex = tex; @@ -71,7 +77,8 @@ struct UnityTextureCube // float4 scaleTranslate; // ?? }; -UnityTextureCube UnityBuildTextureCubeStruct(TEXTURECUBE_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +#define UnityBuildTextureCubeStruct(n) UnityBuildTextureCubeStructInternal(TEXTURECUBE_ARGS(n, sampler##n)) +UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) { UnityTextureCube result; result.tex = tex; @@ -90,7 +97,8 @@ struct UnityTexture3D // float4 scaleTranslate; // ?? }; -UnityTexture3D UnityBuildTexture3DStruct(TEXTURE3D_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +#define UnityBuildTexture3DStruct(n) UnityBuildTexture3DStructInternal(TEXTURE3D_ARGS(n, sampler##n)) +UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) { UnityTexture3D result; result.tex = tex; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs index af78f2dcb1a..d53cf5798e2 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs @@ -22,7 +22,7 @@ public bool gpuInstanced set { } } - internal virtual string GetHLSLVariableName() + internal virtual string GetHLSLVariableName(bool isSubgraphProperty) { return referenceName; } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs index 6c084d82a67..9cd64d04db3 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs @@ -46,7 +46,7 @@ public override string GetDefaultValue(GenerationMode generationMode) if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return nodeOwner.GetVariableNameForSlot(id) + "_struct"; + return $"UnityBuildTextureCubeStruct({nodeOwner.GetVariableNameForSlot(id)})"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) @@ -79,7 +79,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) if (slot != null) { m_Cubemap = slot.m_Cubemap; - m_BareTexture = slot.m_BareTexture; + m_BareResource = slot.m_BareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs index c286e2ddaf1..49c685264e3 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs @@ -21,16 +21,16 @@ public CubemapMaterialSlot( {} [SerializeField] - internal bool m_BareTexture = false; - internal override bool bareTexture + internal bool m_BareResource = false; + internal override bool bareResource { - get { return m_BareTexture; } - set { m_BareTexture = value; } + get { return m_BareResource; } + set { m_BareResource = value; } } public override string GetHLSLVariableType() { - if (m_BareTexture) + if (m_BareResource) return "TextureCube"; else return concreteValueType.ToShaderString(); diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs index 67231248b96..c1574a2e73e 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapShaderProperty.cs @@ -34,36 +34,19 @@ internal override void ForeachHLSLProperty(Action action) { action(new HLSLProperty(HLSLType._TextureCube, referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); - - // add struct macro - Action structDecl = (builder) => - { - builder.AppendIndentation(); - builder.Append("#define "); - builder.Append(referenceName); - builder.Append("_struct UnityBuildTextureCubeStruct(TEXTURECUBE_ARGS("); - builder.Append(referenceName); - builder.Append(", sampler"); builder.Append(referenceName); - builder.Append("))"); - // builder.Append(referenceName); builder.Append("_TexelSize, "); - // builder.Append(referenceName); builder.Append("_ST)"); - builder.AppendNewLine(); - }; - - action(new HLSLProperty(HLSLType._CUSTOM, referenceName + "_struct", HLSLDeclaration.Global, concretePrecision) - { - customDeclaration = structDecl - }); } internal override string GetPropertyAsArgumentString() { - return "UnityTextureCube " + referenceName + "_struct"; + return "UnityTextureCube " + referenceName; } - internal override string GetHLSLVariableName() + internal override string GetHLSLVariableName(bool isSubgraphProperty) { - return referenceName + "_struct"; + if (isSubgraphProperty) + return referenceName; + else + return $"UnityBuildTextureCubeStruct({referenceName})"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs index edc601caf41..c46c7ea34c9 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs @@ -319,7 +319,9 @@ public override int GetHashCode() } } - internal virtual bool bareTexture { get { return false; } set { } } + // this tracks old CustomFunctionNode slots that are expecting the old bare resource inputs + // rather than the new structure-based inputs + internal virtual bool bareResource { get { return false; } set { } } public virtual void CopyDefaultValue(MaterialSlot other) { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs index 75a559d8ef5..a998c60f318 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs @@ -1,5 +1,6 @@ using System; using UnityEditor.Graphing; +using UnityEngine; namespace UnityEditor.ShaderGraph { @@ -21,13 +22,30 @@ public SamplerStateMaterialSlot( { } + [SerializeField] + internal bool m_BareResource = false; + internal override bool bareResource + { + get { return m_BareResource; } + set { m_BareResource = value; } + } + + public override string GetHLSLVariableType() + { + if (m_BareResource) + return "SamplerState"; + else + return concreteValueType.ToShaderString(); + } + public override string GetDefaultValue(GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return $"{matOwner.GetVariableNameForSlot(id)}_Linear_Repeat"; + return "UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat)"; + //return $"{nodeOwner.GetVariableNameForSlot(id)}_Linear_Repeat"; // TODO: ?? } public override SlotValueType valueType { get { return SlotValueType.SamplerState; } } @@ -36,8 +54,8 @@ public override string GetDefaultValue(GenerationMode generationMode) public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) { - var matOwner = owner as AbstractMaterialNode; - if (matOwner == null) + var nodeOwner = owner as AbstractMaterialNode; + if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); properties.AddShaderProperty(new SamplerStateShaderProperty() @@ -47,7 +65,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation filter = TextureSamplerState.FilterMode.Linear, wrap = TextureSamplerState.WrapMode.Repeat }, - overrideReferenceName = $"{matOwner.GetVariableNameForSlot(id)}_Linear_Repeat", + // overrideReferenceName = $"{nodeOwner.GetVariableNameForSlot(id)}_Linear_Repeat", generatePropertyBlock = false, }); } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateShaderProperty.cs index a5ad59d38fc..c255858d461 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateShaderProperty.cs @@ -24,7 +24,7 @@ public override TextureSamplerState value get => base.value; set { - overrideReferenceName = $"{concreteShaderValueType.ToShaderString()}_{value.filter}_{value.wrap}"; + overrideReferenceName = $"SamplerState_{value.filter}_{value.wrap}"; base.value = value; } } @@ -38,7 +38,15 @@ internal override void ForeachHLSLProperty(Action action) internal override string GetPropertyAsArgumentString() { - return $"SamplerState {referenceName}"; + return $"UnitySamplerState {referenceName}"; + } + + internal override string GetHLSLVariableName(bool isSubgraphProperty) + { + if (isSubgraphProperty) + return referenceName; + else + return $"UnityBuildSamplerStateStruct({referenceName})"; } internal override AbstractMaterialNode ToConcreteNode() diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs index 589e53809c7..c3504548ac2 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs @@ -45,7 +45,7 @@ public override string GetDefaultValue(GenerationMode generationMode) if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return nodeOwner.GetVariableNameForSlot(id) + "_struct"; + return $"UnityBuildTexture2DArrayStruct({nodeOwner.GetVariableNameForSlot(id)})"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) @@ -78,7 +78,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) if (slot != null) { m_TextureArray = slot.m_TextureArray; - m_BareTexture = slot.m_BareTexture; + m_BareResource = slot.m_BareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs index 39465c1c3a0..8fcc3a63232 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs @@ -21,11 +21,11 @@ public Texture2DArrayMaterialSlot( {} [SerializeField] - internal bool m_BareTexture = false; - internal override bool bareTexture + internal bool m_BareResource = false; + internal override bool bareResource { - get { return m_BareTexture; } - set { m_BareTexture = value; } + get { return m_BareResource; } + set { m_BareResource = value; } } public override SlotValueType valueType { get { return SlotValueType.Texture2DArray; } } @@ -40,7 +40,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) var slot = foundSlot as Texture2DArrayMaterialSlot; if (slot != null) { - m_BareTexture = slot.m_BareTexture; + m_BareResource = slot.m_BareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs index 1e68bb3dd7b..f458e2b522a 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayShaderProperty.cs @@ -32,36 +32,19 @@ internal override void ForeachHLSLProperty(Action action) { action(new HLSLProperty(HLSLType._Texture2DArray, referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); - - // add struct macro - Action structDecl = (builder) => - { - builder.AppendIndentation(); - builder.Append("#define "); - builder.Append(referenceName); - builder.Append("_struct UnityBuildTexture2DArrayStruct(TEXTURE2D_ARRAY_ARGS("); - builder.Append(referenceName); - builder.Append(", sampler"); builder.Append(referenceName); - builder.Append("))"); - // builder.Append(referenceName); builder.Append("_TexelSize, "); - // builder.Append(referenceName); builder.Append("_ST)"); - builder.AppendNewLine(); - }; - - action(new HLSLProperty(HLSLType._CUSTOM, referenceName + "_struct", HLSLDeclaration.Global, concretePrecision) - { - customDeclaration = structDecl - }); } internal override string GetPropertyAsArgumentString() { - return "UnityTexture2DArray " + referenceName + "_struct"; + return "UnityTexture2DArray " + referenceName; } - internal override string GetHLSLVariableName() + internal override string GetHLSLVariableName(bool isSubgraphProperty) { - return referenceName + "_struct"; + if (isSubgraphProperty) + return referenceName; + else + return $"UnityBuildTexture2DArrayStruct({referenceName})"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs index 7f55c45eac7..5caab6ee5d3 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs @@ -54,7 +54,7 @@ public override string GetDefaultValue(GenerationMode generationMode) if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return nodeOwner.GetVariableNameForSlot(id) + "_struct"; + return $"UnityBuildTexture2DStruct({nodeOwner.GetVariableNameForSlot(id)})"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) @@ -89,7 +89,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) if (slot != null) { m_Texture = slot.m_Texture; - m_BareTexture = slot.m_BareTexture; + m_BareResource = slot.m_BareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs index 98de4403de1..fcb6dc5b59e 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs @@ -21,16 +21,16 @@ public Texture2DMaterialSlot( {} [SerializeField] - internal bool m_BareTexture = false; - internal override bool bareTexture + internal bool m_BareResource = false; + internal override bool bareResource { - get { return m_BareTexture; } - set { m_BareTexture = value; } + get { return m_BareResource; } + set { m_BareResource = value; } } public override string GetHLSLVariableType() { - if (m_BareTexture) + if (m_BareResource) return "Texture2D"; else return concreteValueType.ToShaderString(); @@ -48,7 +48,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) var slot = foundSlot as Texture2DMaterialSlot; if (slot != null) { - m_BareTexture = slot.m_BareTexture; + m_BareResource = slot.m_BareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs index 441a3478320..1437d838368 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs @@ -41,36 +41,19 @@ internal override void ForeachHLSLProperty(Action action) action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._float4, referenceName + "_TexelSize", decl)); action(new HLSLProperty(HLSLType._float4, referenceName + "_ST", decl)); - - // add struct macro - Action structDecl = (builder) => - { - builder.AppendIndentation(); - builder.Append("#define "); - builder.Append(referenceName); - builder.Append("_struct UnityBuildTexture2DStruct(TEXTURE2D_ARGS("); - builder.Append(referenceName); - builder.Append(", sampler"); builder.Append(referenceName); - builder.Append("), "); - builder.Append(referenceName); builder.Append("_TexelSize, "); - builder.Append(referenceName); builder.Append("_ST)"); - builder.AppendNewLine(); - }; - - action(new HLSLProperty(HLSLType._CUSTOM, referenceName + "_struct", HLSLDeclaration.Global, concretePrecision) - { - customDeclaration = structDecl - }); } internal override string GetPropertyAsArgumentString() { - return "UnityTexture2D " + referenceName + "_struct"; + return "UnityTexture2D " + referenceName; } - internal override string GetHLSLVariableName() + internal override string GetHLSLVariableName(bool isSubgraphProperty) { - return referenceName + "_struct"; + if (isSubgraphProperty) + return referenceName; + else + return $"UnityBuildTexture2DStruct({referenceName})"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs index 8cb730a5c41..60019c7fe9b 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs @@ -45,7 +45,7 @@ public override string GetDefaultValue(GenerationMode generationMode) if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return nodeOwner.GetVariableNameForSlot(id) + "_struct"; + return $"UnityBuildTexture3DStruct({nodeOwner.GetVariableNameForSlot(id)})"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) @@ -78,7 +78,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) if (slot != null) { m_Texture = slot.m_Texture; - m_BareTexture = slot.m_BareTexture; + m_BareResource = slot.m_BareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs index 4167cb3b966..12d23d859ec 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs @@ -21,11 +21,11 @@ public Texture3DMaterialSlot( {} [SerializeField] - internal bool m_BareTexture = false; - internal override bool bareTexture + internal bool m_BareResource = false; + internal override bool bareResource { - get { return m_BareTexture; } - set { m_BareTexture = value; } + get { return m_BareResource; } + set { m_BareResource = value; } } public override SlotValueType valueType { get { return SlotValueType.Texture3D; } } @@ -40,7 +40,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) var slot = foundSlot as Texture3DMaterialSlot; if (slot != null) { - m_BareTexture = slot.m_BareTexture; + m_BareResource = slot.m_BareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs index 86455363c65..2e1e09d2f51 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DShaderProperty.cs @@ -32,36 +32,19 @@ internal override void ForeachHLSLProperty(Action action) { action(new HLSLProperty(HLSLType._Texture3D, referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); - - // add struct macro - Action structDecl = (builder) => - { - builder.AppendIndentation(); - builder.Append("#define "); - builder.Append(referenceName); - builder.Append("_struct UnityBuildTexture3DStruct(TEXTURE3D_ARGS("); - builder.Append(referenceName); - builder.Append(", sampler"); builder.Append(referenceName); - builder.Append("))"); -// builder.Append(referenceName); builder.Append("_TexelSize, "); -// builder.Append(referenceName); builder.Append("_ST)"); - builder.AppendNewLine(); - }; - - action(new HLSLProperty(HLSLType._CUSTOM, referenceName + "_struct", HLSLDeclaration.Global, concretePrecision) - { - customDeclaration = structDecl - }); } internal override string GetPropertyAsArgumentString() { - return "UnityTexture3D " + referenceName + "_struct"; + return "UnityTexture3D " + referenceName; } - internal override string GetHLSLVariableName() + internal override string GetHLSLVariableName(bool isSubgraphProperty) { - return referenceName + "_struct"; + if (isSubgraphProperty) + return referenceName; + else + return $"UnityBuildTexture3DStruct({referenceName})"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs index 633fcf000fd..10fd0449e7d 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs @@ -138,29 +138,32 @@ void AddOutputSlot() public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { + // preview is always generating a full shader, even when previewing within a subgraph + bool isGeneratingSubgraph = owner.isSubGraph && (generationMode != GenerationMode.Preview); + switch (property.propertyType) { case PropertyType.Boolean: - sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.Float: - sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.Vector2: - sb.AppendLine($"$precision2 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision2 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.Vector3: - sb.AppendLine($"$precision3 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision3 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.Vector4: - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.Color: switch (property.sgVersion) { case 0: case 2: - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case 1: case 3: @@ -168,11 +171,11 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo //for consistency with other places in the editor, we assume HDR colors are in linear space, and correct for gamma space here if ((property as ColorShaderProperty).colorMode == ColorMode.HDR) { - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? LinearToSRGB({property.GetHLSLVariableName()}) : {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? LinearToSRGB({property.GetHLSLVariableName(isGeneratingSubgraph)}) : {property.GetHLSLVariableName(isGeneratingSubgraph)};"); } else { - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); } break; default: @@ -180,37 +183,47 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo } break; case PropertyType.Matrix2: - sb.AppendLine($"$precision2x2 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision2x2 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.Matrix3: - sb.AppendLine($"$precision3x3 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision3x3 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.Matrix4: - sb.AppendLine($"$precision4x4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"$precision4x4 {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); + break; + case PropertyType.Texture2D: + sb.AppendLine($"UnityTexture2D {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); + break; + case PropertyType.Texture3D: + sb.AppendLine($"UnityTexture3D {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); + break; + case PropertyType.Texture2DArray: + sb.AppendLine($"UnityTexture2DArray {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); + break; + case PropertyType.Cubemap: + sb.AppendLine($"UnityTextureCube {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.SamplerState: - sb.AppendLine($"SamplerState {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"UnitySamplerState {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; case PropertyType.Gradient: if(generationMode == GenerationMode.Preview) - sb.AppendLine($"Gradient {GetVariableNameForSlot(OutputSlotId)} = {GradientUtil.GetGradientForPreview(property.GetHLSLVariableName())};"); + sb.AppendLine($"Gradient {GetVariableNameForSlot(OutputSlotId)} = {GradientUtil.GetGradientForPreview(property.GetHLSLVariableName(isGeneratingSubgraph))};"); else - sb.AppendLine($"Gradient {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName()};"); + sb.AppendLine($"Gradient {GetVariableNameForSlot(OutputSlotId)} = {property.GetHLSLVariableName(isGeneratingSubgraph)};"); break; } } public override string GetVariableNameForSlot(int slotId) { - // TODO: I don't like this exception list being buried in PropertyNode.cs, should be something on the ShaderProperty themselves... - if (!(property is Texture2DShaderProperty) && - !(property is Texture2DArrayShaderProperty) && - !(property is Texture3DShaderProperty) && - !(property is CubemapShaderProperty) && - !(property is VirtualTextureShaderProperty)) - return base.GetVariableNameForSlot(slotId); - - return property.GetHLSLVariableName(); + // TODO: we should switch VirtualTexture away from the macro-based variables and towards using the same approach as Texture2D + switch (property.propertyType) + { + case PropertyType.VirtualTexture: + return property.GetHLSLVariableName(owner.isSubGraph); + } + return base.GetVariableNameForSlot(slotId); } protected override void CalculateNodeHasError() diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs index f0f11e1ce31..042715bda52 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs @@ -49,7 +49,7 @@ string GetTexturePropertyName() string GetTextureVariableName() { - return GetTexturePropertyName() + "_struct"; + return $"UnityBuildTextureCubeStruct({GetTexturePropertyName()})"; } public override string GetVariableNameForSlot(int slotId) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs index 96be41296b3..c62273b7215 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs @@ -55,10 +55,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(CubemapInputId, generationMode); - string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}.tex, {2}, reflect(-{3}, {4}), {5});" + string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}.tex, {2}.samplerstate, reflect(-{3}, {4}), {5});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate" + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id , GetSlotValue(ViewDirInputId, generationMode) , GetSlotValue(NormalInputId, generationMode) , GetSlotValue(LODInputId, generationMode)); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs index d7c5ae4a4e5..5e7d5cbc239 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DArrayNode.cs @@ -63,10 +63,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(TextureInputId, generationMode); - var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D_ARRAY({1}.tex, {2}, {3}, {4});" + var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D_ARRAY({1}.tex, {2}.samplerstate, {3}, {4});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".samplerstate" + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id , uvName , indexName); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs index 3bea358a41c..4df0326c75b 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs @@ -109,10 +109,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(TextureInputId, generationMode); - var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D({1}.tex, {2}, {3});" + var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE2D({1}.tex, {2}.samplerstate, {3});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".samplerstate" + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id , uvName); sb.AppendLine(result); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs index 4256cf0003e..ab7acf45349 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture3DNode.cs @@ -46,10 +46,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(TextureInputId, generationMode); - var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE3D({1}.tex, {2}, {3});" + var result = string.Format("$precision4 {0} = SAMPLE_TEXTURE3D({1}.tex, {2}.samplerstate, {3});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id + ".samplerstate" + , edgesSampler.Any() ? GetSlotValue(SamplerInput, generationMode) : id , uvName); sb.AppendLine(result); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs index 8482b67af56..244555b0376 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs @@ -61,16 +61,26 @@ public sealed override void UpdateNodeAfterDeserialization() RemoveSlotsNameNotMatching(new[] { kOutputSlotId }); } - public override string GetVariableNameForSlot(int slotId) + string GetSamplerStatePropertyName() { return GetVariableNameForNode(); } + string GetSamplerStateVariableName() + { + return $"UnityBuildSamplerStateStruct({GetSamplerStatePropertyName()})"; + } + + public override string GetVariableNameForSlot(int slotId) + { + return GetSamplerStateVariableName(); + } + public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) { properties.AddShaderProperty(new SamplerStateShaderProperty() { - overrideReferenceName = string.Format("{0}_{1}_{2}", NodeUtils.GetHLSLSafeName(name), m_filter, m_wrap), + overrideReferenceName = GetSamplerStatePropertyName(), generatePropertyBlock = false, value = new TextureSamplerState() @@ -83,7 +93,8 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener public override string GetVariableNameForNode() { - return string.Format(@"{0}_{1}_{2}", NodeUtils.GetHLSLSafeName(name), + return string.Format(@"SamplerState_{1}_{2}", // TODO: {0} ?? + NodeUtils.GetHLSLSafeName(name), Enum.GetName(typeof(TextureSamplerState.FilterMode), filter), Enum.GetName(typeof(TextureSamplerState.WrapMode), wrap)); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs index 97e0e3f4008..8a2bc2df30f 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs @@ -49,7 +49,7 @@ string GetTexturePropertyName() string GetTextureVariableName() { - return GetTexturePropertyName() + "_struct"; + return $"UnityBuildTexture2DArrayStruct({GetTexturePropertyName()})"; } public override string GetVariableNameForSlot(int slotId) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs index 4c80fccd8ca..c53fb63fd7f 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs @@ -49,7 +49,7 @@ string GetTexturePropertyName() string GetTextureVariableName() { - return GetTexturePropertyName() + "_struct"; + return $"UnityBuildTexture2DStruct({GetTexturePropertyName()})"; } public override string GetVariableNameForSlot(int slotId) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs index aa183a8028c..a635352ec13 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs @@ -49,7 +49,7 @@ string GetTexturePropertyName() string GetTextureVariableName() { - return GetTexturePropertyName() + "_struct"; + return $"UnityBuildTexture3DStruct({GetTexturePropertyName()})"; } public override string GetVariableNameForSlot(int slotId) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/SlotValue.cs b/com.unity.shadergraph/Editor/Data/Nodes/SlotValue.cs index d0b6f73675d..daef100bed0 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/SlotValue.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/SlotValue.cs @@ -65,6 +65,7 @@ enum ConcreteSlotValueTypePopupName Boolean = ConcreteSlotValueType.Boolean, VirtualTexture = ConcreteSlotValueType.VirtualTexture, + BareSamplerState = 1000 + ConcreteSlotValueType.SamplerState, BareTexture2D = 1000 + ConcreteSlotValueType.Texture2D, BareTexture2DArray = 1000 + ConcreteSlotValueType.Texture2DArray, BareTexture3D = 1000 + ConcreteSlotValueType.Texture3D, @@ -73,50 +74,57 @@ enum ConcreteSlotValueTypePopupName static class SlotValueHelper { - public static ConcreteSlotValueTypePopupName ToConcreteSlotValueTypePopupName(this ConcreteSlotValueType slotType, bool isBareTexture) + public static ConcreteSlotValueTypePopupName ToConcreteSlotValueTypePopupName(this ConcreteSlotValueType slotType, bool isBareResource) { ConcreteSlotValueTypePopupName result = (ConcreteSlotValueTypePopupName)slotType; switch (slotType) { + case ConcreteSlotValueType.SamplerState: + if (isBareResource) + result = ConcreteSlotValueTypePopupName.BareSamplerState; + break; case ConcreteSlotValueType.Texture2D: - if (isBareTexture) + if (isBareResource) result = ConcreteSlotValueTypePopupName.BareTexture2D; break; case ConcreteSlotValueType.Texture2DArray: - if (isBareTexture) + if (isBareResource) result = ConcreteSlotValueTypePopupName.BareTexture2DArray; break; case ConcreteSlotValueType.Texture3D: - if (isBareTexture) + if (isBareResource) result = ConcreteSlotValueTypePopupName.BareTexture3D; break; case ConcreteSlotValueType.Cubemap: - if (isBareTexture) + if (isBareResource) result = ConcreteSlotValueTypePopupName.BareCubemap; break; } return result; } - public static ConcreteSlotValueType ToConcreteSlotValueType(this ConcreteSlotValueTypePopupName popup, out bool isBareTexture) + public static ConcreteSlotValueType ToConcreteSlotValueType(this ConcreteSlotValueTypePopupName popup, out bool isBareResource) { switch (popup) { + case ConcreteSlotValueTypePopupName.BareSamplerState: + isBareResource = true; + return ConcreteSlotValueType.SamplerState; case ConcreteSlotValueTypePopupName.BareTexture2D: - isBareTexture = true; + isBareResource = true; return ConcreteSlotValueType.Texture2D; case ConcreteSlotValueTypePopupName.BareTexture2DArray: - isBareTexture = true; + isBareResource = true; return ConcreteSlotValueType.Texture2DArray; case ConcreteSlotValueTypePopupName.BareTexture3D: - isBareTexture = true; + isBareResource = true; return ConcreteSlotValueType.Texture3D; case ConcreteSlotValueTypePopupName.BareCubemap: - isBareTexture = true; + isBareResource = true; return ConcreteSlotValueType.Cubemap; }; - isBareTexture = false; + isBareResource = false; return (ConcreteSlotValueType) popup; } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs index 4d97ffd2ebb..e60da8bf940 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs @@ -151,8 +151,11 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.Append(SlotInputValue(argument, generationMode)); // TODO: need to differentiate Texture2D from UnityTexture2D // fixup input for Bare texture types - if (argument.bareTexture) - sb.Append(".tex"); + if (argument.bareResource) + if (argument is SamplerStateMaterialSlot) + sb.Append(".samplerstate"); + else + sb.Append(".tex"); } foreach (var argument in outputSlots) @@ -162,15 +165,18 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo first = false; sb.Append(GetVariableNameForSlot(argument.id)); - if (argument.bareTexture) - sb.Append(".tex"); + if (argument.bareResource) + if (argument is SamplerStateMaterialSlot) + sb.Append(".samplerstate"); + else + sb.Append(".tex"); } sb.Append(");"); sb.AppendNewLine(); foreach (var output in outputSlots) { - if (output.bareTexture) + if (output.bareResource) { // fill in other values - sampler state, etc ?? } @@ -331,9 +337,9 @@ void ValidateBareTextureSlots() GetOutputSlots(outputSlots); foreach (var slot in outputSlots) { - if (slot.bareTexture) + if (slot.bareResource) { - owner.AddValidationError(objectId, "This node uses Bare Texture outputs, which may not work when fed to other nodes. Please convert the node to use full struct-based outputs (see UnityTexture structs in com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl)", ShaderCompilerMessageSeverity.Warning); + owner.AddValidationError(objectId, "This node uses Bare Texture or SamplerState outputs, which may not work when fed to other nodes. Please convert the node to use full struct-based outputs (see the structs defined in com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl)", ShaderCompilerMessageSeverity.Warning); break; } } @@ -421,7 +427,7 @@ public override void OnAfterMultiDeserialize(string json) GetSlots(slots); foreach (var slot in slots) { - slot.bareTexture = true; + slot.bareResource = true; } ChangeVersion(1); } diff --git a/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs b/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs index 5f082659657..d0b658da5fc 100644 --- a/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/SlotValueTypeUtil.cs @@ -134,7 +134,7 @@ public static string ToShaderString(this ConcreteSlotValueType type, string prec switch (type) { case ConcreteSlotValueType.SamplerState: - return "SamplerState"; + return "UnitySamplerState"; case ConcreteSlotValueType.Matrix4: return precisionToken + "4x4"; case ConcreteSlotValueType.Matrix3: diff --git a/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs b/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs index dd14e5f7bd3..d4e70cd39e7 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/ReorderableSlotListView.cs @@ -16,7 +16,7 @@ internal class ReorderableSlotListView : VisualElement IMGUIContainer m_Container; AbstractMaterialNode m_Node; ReorderableList m_ReorderableList; - bool m_AllowBareTextures; + bool m_AllowBareResources; internal delegate void ListRecreatedDelegate(); ListRecreatedDelegate m_OnListRecreatedCallback = new ListRecreatedDelegate(() => { }); @@ -43,9 +43,9 @@ public ListRecreatedDelegate OnListRecreatedCallback public Func AllowedTypeCallback; - internal ReorderableSlotListView(AbstractMaterialNode node, SlotType slotType, bool allowBareTextures) + internal ReorderableSlotListView(AbstractMaterialNode node, SlotType slotType, bool allowBareResources) { - m_AllowBareTextures = allowBareTextures; + m_AllowBareResources = allowBareResources; styleSheets.Add(Resources.Load("Styles/ReorderableSlotListView")); m_Node = node; m_SlotType = slotType; @@ -107,7 +107,7 @@ private void AddCallbacks() var displayName = EditorGUI.DelayedTextField( new Rect(rect.x, rect.y, rect.width / 2, EditorGUIUtility.singleLineHeight), oldSlot.RawDisplayName(), EditorStyles.label); ConcreteSlotValueTypePopupName concreteValueTypePopupOrig = - oldSlot.concreteValueType.ToConcreteSlotValueTypePopupName(oldSlot.bareTexture); + oldSlot.concreteValueType.ToConcreteSlotValueTypePopupName(oldSlot.bareResource); ConcreteSlotValueTypePopupName concreteValueTypePopupNew = (ConcreteSlotValueTypePopupName)EditorGUI.EnumPopup( new Rect(rect.x + rect.width / 2, rect.y, rect.width - rect.width / 2, EditorGUIUtility.singleLineHeight), @@ -116,8 +116,8 @@ private void AddCallbacks() e => { ConcreteSlotValueTypePopupName csvtpn = (ConcreteSlotValueTypePopupName) e; - csvtpn.ToConcreteSlotValueType(out bool isBareTexture); - if (isBareTexture && !m_AllowBareTextures) + csvtpn.ToConcreteSlotValueType(out bool isBareResource); + if (isBareResource && !m_AllowBareResources) return false; return AllowedTypeCallback?.Invoke(csvtpn) ?? true; } @@ -140,14 +140,13 @@ private void AddCallbacks() } } - bool isBareTexture; - ConcreteSlotValueType concreteValueType = concreteValueTypePopupNew.ToConcreteSlotValueType(out isBareTexture); + ConcreteSlotValueType concreteValueType = concreteValueTypePopupNew.ToConcreteSlotValueType(out bool isBareResource); // Because the type may have changed, we can't (always) just modify the existing slot. So create a new one and replace it. var newSlot = MaterialSlot.CreateMaterialSlot(concreteValueType.ToSlotValueType(), oldSlot.id, displayName, displayName, m_SlotType, Vector4.zero); newSlot.CopyValuesFrom(oldSlot); m_Node.AddSlot(newSlot, false); - newSlot.bareTexture = isBareTexture; + newSlot.bareResource = isBareResource; List orderedSlotIds = new List(); if (m_SlotType == SlotType.Input) From c6a191f6a74ad3f7fbf825dba9e04cf105876cca Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Thu, 12 Nov 2020 14:37:10 -0800 Subject: [PATCH 13/28] Fix for ParallaxOcclusionMappingNode --- .../Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs index 2690ad90e1a..16c18ca3665 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxOcclusionMappingNode.cs @@ -161,7 +161,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLines($@" $precision {tmpOutHeight}; -$precision2 {GetVariableNameForSlot(kParallaxUVsOutputSlotId)} = {uvs} + ParallaxOcclusionMapping{GetVariableNameForNode()}({lod}, {lodThreshold}, {steps}, {tmpViewDirUV}, {tmpPOMParam}, {tmpOutHeight}, TEXTURE2D_ARGS({heightmap}.tex, {sampler})); +$precision2 {GetVariableNameForSlot(kParallaxUVsOutputSlotId)} = {uvs} + ParallaxOcclusionMapping{GetVariableNameForNode()}({lod}, {lodThreshold}, {steps}, {tmpViewDirUV}, {tmpPOMParam}, {tmpOutHeight}, TEXTURE2D_ARGS({heightmap}.tex, {sampler}.samplerstate)); $precision {GetVariableNameForSlot(kPixelDepthOffsetOutputSlotId)} = ({tmpMaxHeight} - {tmpOutHeight} * {tmpMaxHeight}) / max({tmpNdotV}, 0.0001); "); From 857ffb51976299ad69fbaea0b2484e3cb4a0b5fc Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Thu, 12 Nov 2020 15:48:10 -0800 Subject: [PATCH 14/28] Fix for NormalFromTextureNode, cleanup, adding changelog --- com.unity.shadergraph/CHANGELOG.md | 11 +++++++++++ .../Editor/Data/Graphs/SamplerStateMaterialSlot.cs | 3 +-- .../Nodes/Artistic/Normal/NormalFromTextureNode.cs | 4 ++-- .../Data/Nodes/Input/Texture/CubemapAssetNode.cs | 11 +---------- .../Nodes/Input/Texture/Texture2DArrayAssetNode.cs | 11 +---------- .../Data/Nodes/Input/Texture/Texture2DAssetNode.cs | 11 +---------- .../Data/Nodes/Input/Texture/Texture3DAssetNode.cs | 11 +---------- 7 files changed, 18 insertions(+), 44 deletions(-) diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index b2bbad7c586..11b0b4159d1 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this package are documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [10.3.0] - 2020-11-12 + +### Added + +### Changed +- Texture and SamplerState types are now HLSL structures (defined in com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl). CustomFunctionNode use of the old plain types is supported, but the user should upgrade to structures to avoid bugs. + +### Fixed +- Fixed using TexelSize or reading sampler states from Textures output from a Subgraph or Custom Function Node [1284036] +- Shaders using SamplerState types now compile with GLES2 (SamplerStates are ignored, falls back to Texture-associated sampler state) [1292031] + ## [10.2.0] - 2020-10-19 ### Added diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs index a998c60f318..d2674d593fb 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs @@ -45,7 +45,6 @@ public override string GetDefaultValue(GenerationMode generationMode) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); return "UnityBuildSamplerStateStruct(SamplerState_Linear_Repeat)"; - //return $"{nodeOwner.GetVariableNameForSlot(id)}_Linear_Repeat"; // TODO: ?? } public override SlotValueType valueType { get { return SlotValueType.SamplerState; } } @@ -65,7 +64,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation filter = TextureSamplerState.FilterMode.Linear, wrap = TextureSamplerState.WrapMode.Repeat }, - // overrideReferenceName = $"{nodeOwner.GetVariableNameForSlot(id)}_Linear_Repeat", + overrideReferenceName = "SamplerState_Linear_Repeat", generatePropertyBlock = false, }); } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs index 95df4be12f6..59032eb5fdc 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalFromTextureNode.cs @@ -61,10 +61,10 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo if (edgesSampler.Any()) samplerValue = GetSlotValue(SamplerInputId, generationMode); else - samplerValue = string.Format("{0}.samplerstate", textureValue); + samplerValue = textureValue; sb.AppendLine("{0} {1};", FindOutputSlot(OutputSlotId).concreteValueType.ToShaderString(), GetVariableNameForSlot(OutputSlotId)); - sb.AppendLine("{0}(TEXTURE2D_ARGS({1}.tex, {2}), {3}, {4}, {5}, {6});", GetFunctionName(), textureValue, samplerValue, uvValue, offsetValue, strengthValue, outputValue); + sb.AppendLine("{0}(TEXTURE2D_ARGS({1}.tex, {2}.samplerstate), {3}, {4}, {5}, {6});", GetFunctionName(), textureValue, samplerValue, uvValue, offsetValue, strengthValue, outputValue); } public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode generationMode) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs index 042715bda52..ad910443819 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs @@ -19,7 +19,6 @@ public CubemapAssetNode() UpdateNodeAfterDeserialization(); } - public sealed override void UpdateNodeAfterDeserialization() { AddSlot(new CubemapMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output)); @@ -47,17 +46,9 @@ string GetTexturePropertyName() return base.GetVariableNameForSlot(OutputSlotId); } - string GetTextureVariableName() - { - return $"UnityBuildTextureCubeStruct({GetTexturePropertyName()})"; - } - public override string GetVariableNameForSlot(int slotId) { - if (slotId == OutputSlotId) - return GetTextureVariableName(); - else - return base.GetVariableNameForSlot(slotId); + return $"UnityBuildTextureCubeStruct({GetTexturePropertyName()})"; } public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs index 8a2bc2df30f..a55fce832e3 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DArrayAssetNode.cs @@ -19,7 +19,6 @@ public Texture2DArrayAssetNode() UpdateNodeAfterDeserialization(); } - public sealed override void UpdateNodeAfterDeserialization() { AddSlot(new Texture2DArrayMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output)); @@ -47,17 +46,9 @@ string GetTexturePropertyName() return base.GetVariableNameForSlot(OutputSlotId); } - string GetTextureVariableName() - { - return $"UnityBuildTexture2DArrayStruct({GetTexturePropertyName()})"; - } - public override string GetVariableNameForSlot(int slotId) { - if (slotId == OutputSlotId) - return GetTextureVariableName(); - else - return base.GetVariableNameForSlot(slotId); + return $"UnityBuildTexture2DArrayStruct({GetTexturePropertyName()})"; } public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs index c53fb63fd7f..a6dcb254019 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs @@ -19,7 +19,6 @@ public Texture2DAssetNode() UpdateNodeAfterDeserialization(); } - public sealed override void UpdateNodeAfterDeserialization() { AddSlot(new Texture2DMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output)); @@ -47,17 +46,9 @@ string GetTexturePropertyName() return base.GetVariableNameForSlot(OutputSlotId); } - string GetTextureVariableName() - { - return $"UnityBuildTexture2DStruct({GetTexturePropertyName()})"; - } - public override string GetVariableNameForSlot(int slotId) { - if (slotId == OutputSlotId) - return GetTextureVariableName(); - else - return base.GetVariableNameForSlot(slotId); + return $"UnityBuildTexture2DStruct({GetTexturePropertyName()})"; } public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs index a635352ec13..57b0b904a39 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture3DAssetNode.cs @@ -19,7 +19,6 @@ public Texture3DAssetNode() UpdateNodeAfterDeserialization(); } - public sealed override void UpdateNodeAfterDeserialization() { AddSlot(new Texture3DMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output)); @@ -47,17 +46,9 @@ string GetTexturePropertyName() return base.GetVariableNameForSlot(OutputSlotId); } - string GetTextureVariableName() - { - return $"UnityBuildTexture3DStruct({GetTexturePropertyName()})"; - } - public override string GetVariableNameForSlot(int slotId) { - if (slotId == OutputSlotId) - return GetTextureVariableName(); - else - return base.GetVariableNameForSlot(slotId); + return $"UnityBuildTexture3DStruct({GetTexturePropertyName()})"; } public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) From 9025101f4766644da4861203931571b9e209192f Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Thu, 12 Nov 2020 16:39:01 -0800 Subject: [PATCH 15/28] Fix for old Texture2DArray and Texture3D inputs to CustomFunctionNodes --- .../Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs | 8 ++++++++ .../Editor/Data/Graphs/Texture3DMaterialSlot.cs | 8 ++++++++ .../Editor/Data/Nodes/Utility/CustomFunctionNode.cs | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs index 8fcc3a63232..1bf92f0858c 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs @@ -28,6 +28,14 @@ internal override bool bareResource set { m_BareResource = value; } } + public override string GetHLSLVariableType() + { + if (m_BareResource) + return "Texture2DArray"; + else + return concreteValueType.ToShaderString(); + } + public override SlotValueType valueType { get { return SlotValueType.Texture2DArray; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Texture2DArray; } } public override bool isDefaultValue => true; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs index 12d23d859ec..38e21acc77b 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs @@ -28,6 +28,14 @@ internal override bool bareResource set { m_BareResource = value; } } + public override string GetHLSLVariableType() + { + if (m_BareResource) + return "Texture3D"; + else + return concreteValueType.ToShaderString(); + } + public override SlotValueType valueType { get { return SlotValueType.Texture3D; } } public override ConcreteSlotValueType concreteValueType { get { return ConcreteSlotValueType.Texture3D; } } public override bool isDefaultValue => true; diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs index e60da8bf940..a9c8781dda0 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs @@ -16,7 +16,7 @@ namespace UnityEditor.ShaderGraph class CustomFunctionNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction { // 0 original version - // 1 differentiate between UnityTexture2D and Texture2D + // 1 differentiate between struct-based UnityTexture2D and bare Texture2D resources (for all texture and samplerstate resources) public override int latestVersion => 1; [Serializable] From 152ab5d6907a1739483d1f710a74dc95c124f082 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Thu, 12 Nov 2020 16:57:27 -0800 Subject: [PATCH 16/28] Fix for ParallaxMapping and Triplanar nodes handling of SamplerState types --- .../Data/Nodes/UV/ParallaxMappingNode.cs | 4 ++-- .../Editor/Data/Nodes/UV/TriplanarNode.cs | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs index 76b9ca3aabc..c18c2939131 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/UV/ParallaxMappingNode.cs @@ -78,9 +78,9 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo var amplitude = GetSlotValue(kAmplitudeSlotId, generationMode); var uvs = GetSlotValue(kUVsSlotId, generationMode); - sb.AppendLines(String.Format(@"$precision2 {5} = {4} + ParallaxMapping({0}.tex, {1}, IN.{2}, {3} * 0.01, {4});", + sb.AppendLines(String.Format(@"$precision2 {5} = {4} + ParallaxMapping({0}.tex, {1}.samplerstate, IN.{2}, {3} * 0.01, {4});", heightmap, - edgesSampler.Any() ? GetSlotValue(kHeightmapSamplerSlotId, generationMode) : heightmap + ".samplerstate", + edgesSampler.Any() ? GetSlotValue(kHeightmapSamplerSlotId, generationMode) : heightmap, CoordinateSpace.Tangent.ToVariableName(InterpolatorType.ViewDirection), amplitude, // cm in the interface so we multiply by 0.01 in the shader to convert in meter uvs, diff --git a/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs index de0647308b7..93752f57813 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/UV/TriplanarNode.cs @@ -98,20 +98,20 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene , GetSlotValue(BlendInputId, generationMode)); sb.AppendLine("{0}_Blend /= ({0}_Blend.x + {0}_Blend.y + {0}_Blend.z ).xxx;", GetVariableNameForNode()); - sb.AppendLine("$precision3 {0}_X = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.zy));" + sb.AppendLine("$precision3 {0}_X = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}.samplerstate, {0}_UV.zy));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate" + id); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id); - sb.AppendLine("$precision3 {0}_Y = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xz));" + sb.AppendLine("$precision3 {0}_Y = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}.samplerstate, {0}_UV.xz));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id); - sb.AppendLine("$precision3 {0}_Z = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xy));" + sb.AppendLine("$precision3 {0}_Z = UnpackNormal(SAMPLE_TEXTURE2D({1}.tex, {2}.samplerstate, {0}_UV.xy));" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id); sb.AppendLine("{0}_X = $precision3({0}_X.xy + {1}.zy, abs({0}_X.z) * {1}.x);" , GetVariableNameForNode() @@ -148,20 +148,20 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene , GetSlotValue(NormalInputId, generationMode) , GetSlotValue(BlendInputId, generationMode)); sb.AppendLine("{0}_Blend /= dot({0}_Blend, 1.0);", GetVariableNameForNode()); - sb.AppendLine("$precision4 {0}_X = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.zy);" + sb.AppendLine("$precision4 {0}_X = SAMPLE_TEXTURE2D({1}.tex, {2}.samplerstate, {0}_UV.zy);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id); - sb.AppendLine("$precision4 {0}_Y = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xz);" + sb.AppendLine("$precision4 {0}_Y = SAMPLE_TEXTURE2D({1}.tex, {2}.samplerstate, {0}_UV.xz);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id); - sb.AppendLine("$precision4 {0}_Z = SAMPLE_TEXTURE2D({1}.tex, {2}, {0}_UV.xy);" + sb.AppendLine("$precision4 {0}_Z = SAMPLE_TEXTURE2D({1}.tex, {2}.samplerstate, {0}_UV.xy);" , GetVariableNameForNode() , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate"); + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id); sb.AppendLine("$precision4 {0} = {1}_X * {1}_Blend.x + {1}_Y * {1}_Blend.y + {1}_Z * {1}_Blend.z;" , GetVariableNameForSlot(OutputSlotId) From 1d1cbed2032c28129053ddbae0f9825a572108ea Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Thu, 12 Nov 2020 17:27:54 -0800 Subject: [PATCH 17/28] Cleanup, removing unused code and _ST values (for now) --- .../ShaderLibrary/Texture.hlsl | 20 ++++--------------- .../Data/Graphs/Texture2DInputMaterialSlot.cs | 2 +- .../Data/Graphs/Texture2DShaderProperty.cs | 4 ++-- .../Nodes/Input/Texture/Texture2DAssetNode.cs | 2 +- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index d901a97426c..1ab930a6162 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -38,8 +38,8 @@ struct UnityTexture2D }; #define UnityBuildTexture2DStruct(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, n##_ST) -#define UnityBuildTexture2DStructNoScale(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler_##n), n##_TexelSize) -UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +#define UnityBuildTexture2DStructNoScale(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, float4(1, 1, 0, 0)) +UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate) { UnityTexture2D result; result.tex = tex; @@ -53,8 +53,6 @@ struct UnityTexture2DArray { TEXTURE2D_ARRAY(tex); SAMPLERDECL(samplerstate) -// float4 texelSize; // ?? are these valid for Texture2DArrays? -// float4 scaleTranslate; // ?? }; #define UnityBuildTexture2DArrayStruct(n) UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_ARGS(n, sampler##n)) @@ -63,8 +61,6 @@ UnityTexture2DArray UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_PARAM UnityTexture2DArray result; result.tex = tex; ASSIGN_SAMPLER(result.samplerstate, samplerstate); -// result.texelSize = texelSize; -// result.scaleTranslate = scaleTranslate; return result; } @@ -73,18 +69,14 @@ struct UnityTextureCube { TEXTURECUBE(tex); SAMPLERDECL(samplerstate) - // float4 texelSize; // ?? are these valid for Texture2DArrays? - // float4 scaleTranslate; // ?? }; #define UnityBuildTextureCubeStruct(n) UnityBuildTextureCubeStructInternal(TEXTURECUBE_ARGS(n, sampler##n)) -UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samplerstate)) { UnityTextureCube result; result.tex = tex; ASSIGN_SAMPLER(result.samplerstate, samplerstate); - // result.texelSize = texelSize; - // result.scaleTranslate = scaleTranslate; return result; } @@ -93,18 +85,14 @@ struct UnityTexture3D { TEXTURE3D(tex); SAMPLERDECL(samplerstate) - // float4 texelSize; // ?? are these valid for Texture2DArrays? - // float4 scaleTranslate; // ?? }; #define UnityBuildTexture3DStruct(n) UnityBuildTexture3DStructInternal(TEXTURE3D_ARGS(n, sampler##n)) -UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplerstate)) //, float4 texelSize, float4 scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f)) +UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplerstate)) { UnityTexture3D result; result.tex = tex; ASSIGN_SAMPLER(result.samplerstate, samplerstate); - // result.texelSize = texelSize; - // result.scaleTranslate = scaleTranslate; return result; } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs index 5caab6ee5d3..e3e7c095cfb 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs @@ -54,7 +54,7 @@ public override string GetDefaultValue(GenerationMode generationMode) if (nodeOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - return $"UnityBuildTexture2DStruct({nodeOwner.GetVariableNameForSlot(id)})"; + return $"UnityBuildTexture2DStructNoScale({nodeOwner.GetVariableNameForSlot(id)})"; } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs index 1437d838368..00d8fe564d6 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DShaderProperty.cs @@ -40,7 +40,7 @@ internal override void ForeachHLSLProperty(Action action) action(new HLSLProperty(HLSLType._Texture2D, referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._SamplerState, "sampler" + referenceName, HLSLDeclaration.Global)); action(new HLSLProperty(HLSLType._float4, referenceName + "_TexelSize", decl)); - action(new HLSLProperty(HLSLType._float4, referenceName + "_ST", decl)); + // action(new HLSLProperty(HLSLType._float4, referenceName + "_ST", decl)); // TODO: allow users to make use of the ST values } internal override string GetPropertyAsArgumentString() @@ -53,7 +53,7 @@ internal override string GetHLSLVariableName(bool isSubgraphProperty) if (isSubgraphProperty) return referenceName; else - return $"UnityBuildTexture2DStruct({referenceName})"; + return $"UnityBuildTexture2DStructNoScale({referenceName})"; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs index a6dcb254019..9dfeac191bb 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs @@ -48,7 +48,7 @@ string GetTexturePropertyName() public override string GetVariableNameForSlot(int slotId) { - return $"UnityBuildTexture2DStruct({GetTexturePropertyName()})"; + return $"UnityBuildTexture2DStructNoScale({GetTexturePropertyName()})"; } public override void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode) From 4451e34ff73f2586df01020939d5a104508dc499 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Thu, 12 Nov 2020 17:36:59 -0800 Subject: [PATCH 18/28] Fix samplerstates on SampleRawCubemap and SampleTexture2DLOD nodes --- .../Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs | 4 ++-- .../Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs index a02b54cb5fd..8bbc3e90086 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleRawCubemapNode.cs @@ -51,10 +51,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene var edgesSampler = owner.GetEdges(samplerSlot.slotReference); var id = GetSlotValue(CubemapInputId, generationMode); - string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}.tex, {2}, {3}, {4});" + string result = string.Format("$precision4 {0} = SAMPLE_TEXTURECUBE_LOD({1}.tex, {2}.samplerstate, {3}, {4});" , GetVariableNameForSlot(OutputSlotId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate" + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id , GetSlotValue(NormalInputId, generationMode) , GetSlotValue(LODInputId, generationMode)); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs index a18f6899e92..90b07800ac5 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DLODNode.cs @@ -117,10 +117,10 @@ public virtual void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode gene } sb.AppendLine("#else"); { - var result = string.Format(" $precision4 {0} = SAMPLE_TEXTURE2D_LOD({1}.tex, {2}, {3}, {4});" + var result = string.Format(" $precision4 {0} = SAMPLE_TEXTURE2D_LOD({1}.tex, {2}.samplerstate, {3}, {4});" , GetVariableNameForSlot(OutputSlotRGBAId) , id - , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id + ".samplerstate" + , edgesSampler.Any() ? GetSlotValue(SamplerInputId, generationMode) : id , uvName , lodSlot); From 5028e089f82a1404388b4dca8b0248af293fe54c Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Fri, 13 Nov 2020 15:38:43 -0800 Subject: [PATCH 19/28] Fix for VFX support, additional cleanup --- .../Editor/VFXGraph/Shaders/VFXPasses.template | 1 + .../Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXPasses.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXPasses.template index 2dcf06adc85..66b5144b32b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXPasses.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXPasses.template @@ -14,6 +14,7 @@ ${VFXBegin:VFXPassVelocityAdditionalPragma}#pragma multi_compile _ WRITE_MSAA_DE ${VFXBegin:VFXShaderGraphFunctionsInclude} #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl" diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs index 244555b0376..c80fe5d5b1f 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs @@ -93,8 +93,7 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener public override string GetVariableNameForNode() { - return string.Format(@"SamplerState_{1}_{2}", // TODO: {0} ?? - NodeUtils.GetHLSLSafeName(name), + return string.Format(@"SamplerState_{0}_{1}", Enum.GetName(typeof(TextureSamplerState.FilterMode), filter), Enum.GetName(typeof(TextureSamplerState.WrapMode), wrap)); } From 1dcee047e6c0f192efb3bbeaeccbef9baa3baee3 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Sat, 14 Nov 2020 13:54:40 -0800 Subject: [PATCH 20/28] Fix for decals --- .../Editor/Material/Decal/ShaderGraph/DecalPass.template | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalPass.template b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalPass.template index 2798fd4bf61..f312a074a65 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalPass.template +++ b/com.unity.render-pipelines.high-definition/Editor/Material/Decal/ShaderGraph/DecalPass.template @@ -25,6 +25,7 @@ Pass $splice(GraphKeywords) #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" // Defines From c7eb890024ff043e520419701c9223f8bfa84cf5 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 16 Nov 2020 10:53:50 -0800 Subject: [PATCH 21/28] Fix for tests --- .../Tests/Editor/UnitTests/MaterialNodeTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com.unity.shadergraph/Tests/Editor/UnitTests/MaterialNodeTests.cs b/com.unity.shadergraph/Tests/Editor/UnitTests/MaterialNodeTests.cs index aede31ca643..4e826615a2c 100644 --- a/com.unity.shadergraph/Tests/Editor/UnitTests/MaterialNodeTests.cs +++ b/com.unity.shadergraph/Tests/Editor/UnitTests/MaterialNodeTests.cs @@ -88,12 +88,12 @@ public void CanConvertConcreteSlotValueTypeToOutputChunkProperly() Assert.AreEqual("float2", ConcreteSlotValueType.Vector2.ToShaderString(ConcretePrecision.Single)); Assert.AreEqual("float3", ConcreteSlotValueType.Vector3.ToShaderString(ConcretePrecision.Single)); Assert.AreEqual("float4", ConcreteSlotValueType.Vector4.ToShaderString(ConcretePrecision.Single)); - Assert.AreEqual("Texture2D", ConcreteSlotValueType.Texture2D.ToShaderString(ConcretePrecision.Single)); + Assert.AreEqual("UnityTexture2D", ConcreteSlotValueType.Texture2D.ToShaderString(ConcretePrecision.Single)); Assert.AreEqual("float2x2", ConcreteSlotValueType.Matrix2.ToShaderString(ConcretePrecision.Single)); Assert.AreEqual("float3x3", ConcreteSlotValueType.Matrix3.ToShaderString(ConcretePrecision.Single)); Assert.AreEqual("float4x4", ConcreteSlotValueType.Matrix4.ToShaderString(ConcretePrecision.Single)); - Assert.AreEqual("SamplerState", ConcreteSlotValueType.SamplerState.ToShaderString(ConcretePrecision.Single)); - Assert.AreEqual("TextureCube", ConcreteSlotValueType.Cubemap.ToShaderString(ConcretePrecision.Single)); + Assert.AreEqual("UnitySamplerState", ConcreteSlotValueType.SamplerState.ToShaderString(ConcretePrecision.Single)); + Assert.AreEqual("UnityTextureCube", ConcreteSlotValueType.Cubemap.ToShaderString(ConcretePrecision.Single)); } [Test] From 35071169762e245f719c572318892597b27524e3 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 16 Nov 2020 14:35:03 -0800 Subject: [PATCH 22/28] Fix VFX path generation issues with textures --- com.unity.shadergraph/Editor/AssemblyInfo.cs | 1 + .../Editor/Importers/ShaderGraphImporter.cs | 614 +++++++++--------- .../VFXShaderGraphParticleOutput.cs | 2 +- 3 files changed, 316 insertions(+), 301 deletions(-) diff --git a/com.unity.shadergraph/Editor/AssemblyInfo.cs b/com.unity.shadergraph/Editor/AssemblyInfo.cs index 0797e86434e..d948626b156 100644 --- a/com.unity.shadergraph/Editor/AssemblyInfo.cs +++ b/com.unity.shadergraph/Editor/AssemblyInfo.cs @@ -5,3 +5,4 @@ [assembly: InternalsVisibleTo("Unity.ShaderGraph.GraphicsTests")] [assembly: InternalsVisibleTo("Unity.ShaderGraph.Editor.GraphicsTests")] [assembly: InternalsVisibleTo("Unity.RenderPipelines.HighDefinition.Editor")] +[assembly: InternalsVisibleTo("Unity.VisualEffectGraph.Editor")] diff --git a/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs b/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs index ebb44b107ef..f1df6f162de 100644 --- a/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs +++ b/com.unity.shadergraph/Editor/Importers/ShaderGraphImporter.cs @@ -330,419 +330,433 @@ static ShaderGraphVfxAsset GenerateVfxShaderGraphAsset(GraphData graph) if(target == null) return null; - var nl = Environment.NewLine; - var indent = new string(' ', 4); - var asset = ScriptableObject.CreateInstance(); - var result = asset.compilationResult = new GraphCompilationResult(); - var mode = GenerationMode.ForReals; + // we need to override graph.isSubgraph, so save old state to restore it + // (this is not great, but whole VFX pipeline is rather hacky at the moment) + // use try/finally to ensure it always gets restored + bool oldIsSubGraph = graph.isSubGraph; + try + { + // override to generate as a subgraph, as that is what VFX is using it as + graph.isSubGraph = true; - asset.lit = target.lit; - asset.alphaClipping = target.alphaTest; + var nl = Environment.NewLine; + var indent = new string(' ', 4); + var asset = ScriptableObject.CreateInstance(); + var result = asset.compilationResult = new GraphCompilationResult(); + var mode = GenerationMode.ForReals; - var assetGuid = graph.assetGuid; - var assetPath = AssetDatabase.GUIDToAssetPath(assetGuid); - var hlslName = NodeUtils.GetHLSLSafeName(Path.GetFileNameWithoutExtension(assetPath)); + asset.lit = target.lit; + asset.alphaClipping = target.alphaTest; - var ports = new List(); - var nodes = new List(); + var assetGuid = graph.assetGuid; + var assetPath = AssetDatabase.GUIDToAssetPath(assetGuid); + var hlslName = NodeUtils.GetHLSLSafeName(Path.GetFileNameWithoutExtension(assetPath)); - foreach(var vertexBlock in graph.vertexContext.blocks) - { - vertexBlock.value.GetInputSlots(ports); - NodeUtils.DepthFirstCollectNodesFromNode(nodes, vertexBlock); - } + var ports = new List(); + var nodes = new List(); - foreach(var fragmentBlock in graph.fragmentContext.blocks) - { - fragmentBlock.value.GetInputSlots(ports); - NodeUtils.DepthFirstCollectNodesFromNode(nodes, fragmentBlock); - } - - //Remove inactive blocks from generation - { - var tmpCtx = new TargetActiveBlockContext(new List(), null); - target.GetActiveBlocks(ref tmpCtx); - ports.RemoveAll(materialSlot => + foreach (var vertexBlock in graph.vertexContext.blocks) { - return !tmpCtx.activeBlocks.Any(o => materialSlot.RawDisplayName() == o.displayName); - }); - } - - var bodySb = new ShaderStringBuilder(1); - var registry = new FunctionRegistry(new ShaderStringBuilder(), true); + vertexBlock.value.GetInputSlots(ports); + NodeUtils.DepthFirstCollectNodesFromNode(nodes, vertexBlock); + } - foreach (var properties in graph.properties) - { - properties.ValidateConcretePrecision(graph.concretePrecision); - } + foreach (var fragmentBlock in graph.fragmentContext.blocks) + { + fragmentBlock.value.GetInputSlots(ports); + NodeUtils.DepthFirstCollectNodesFromNode(nodes, fragmentBlock); + } - foreach (var node in nodes) - { - if (node is IGeneratesBodyCode bodyGenerator) + //Remove inactive blocks from generation { - bodySb.currentNode = node; - bodyGenerator.GenerateNodeCode(bodySb, mode); - bodySb.ReplaceInCurrentMapping(PrecisionUtil.Token, node.concretePrecision.ToShaderString()); + var tmpCtx = new TargetActiveBlockContext(new List(), null); + target.GetActiveBlocks(ref tmpCtx); + ports.RemoveAll(materialSlot => + { + return !tmpCtx.activeBlocks.Any(o => materialSlot.RawDisplayName() == o.displayName); + }); } - if (node is IGeneratesFunction generatesFunction) + var bodySb = new ShaderStringBuilder(1); + var registry = new FunctionRegistry(new ShaderStringBuilder(), true); + + foreach (var properties in graph.properties) { - registry.builder.currentNode = node; - generatesFunction.GenerateNodeFunction(registry, mode); + properties.ValidateConcretePrecision(graph.concretePrecision); } - } - bodySb.currentNode = null; - var portNodeSets = new HashSet[ports.Count]; - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - var port = ports[portIndex]; - var nodeSet = new HashSet(); - NodeUtils.CollectNodeSet(nodeSet, port); - portNodeSets[portIndex] = nodeSet; - } + foreach (var node in nodes) + { + if (node is IGeneratesBodyCode bodyGenerator) + { + bodySb.currentNode = node; + bodyGenerator.GenerateNodeCode(bodySb, mode); + bodySb.ReplaceInCurrentMapping(PrecisionUtil.Token, node.concretePrecision.ToShaderString()); + } - var portPropertySets = new HashSet[ports.Count]; - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - portPropertySets[portIndex] = new HashSet(); - } + if (node is IGeneratesFunction generatesFunction) + { + registry.builder.currentNode = node; + generatesFunction.GenerateNodeFunction(registry, mode); + } + } + bodySb.currentNode = null; - foreach (var node in nodes) - { - if (!(node is PropertyNode propertyNode)) + var portNodeSets = new HashSet[ports.Count]; + for (var portIndex = 0; portIndex < ports.Count; portIndex++) { - continue; + var port = ports[portIndex]; + var nodeSet = new HashSet(); + NodeUtils.CollectNodeSet(nodeSet, port); + portNodeSets[portIndex] = nodeSet; } + var portPropertySets = new HashSet[ports.Count]; for (var portIndex = 0; portIndex < ports.Count; portIndex++) { - var portNodeSet = portNodeSets[portIndex]; - if (portNodeSet.Contains(node)) + portPropertySets[portIndex] = new HashSet(); + } + + foreach (var node in nodes) + { + if (!(node is PropertyNode propertyNode)) { - portPropertySets[portIndex].Add(propertyNode.property.objectId); + continue; } - } - } - var shaderProperties = new PropertyCollector(); - foreach (var node in nodes) - { - node.CollectShaderProperties(shaderProperties, GenerationMode.ForReals); - } + for (var portIndex = 0; portIndex < ports.Count; portIndex++) + { + var portNodeSet = portNodeSets[portIndex]; + if (portNodeSet.Contains(node)) + { + portPropertySets[portIndex].Add(propertyNode.property.objectId); + } + } + } - asset.SetTextureInfos(shaderProperties.GetConfiguredTexutres()); + var shaderProperties = new PropertyCollector(); + foreach (var node in nodes) + { + node.CollectShaderProperties(shaderProperties, GenerationMode.ForReals); + } - var codeSnippets = new List(); - var portCodeIndices = new List[ports.Count]; - var sharedCodeIndices = new List(); - for (var i = 0; i < portCodeIndices.Length; i++) - { - portCodeIndices[i] = new List(); - } + asset.SetTextureInfos(shaderProperties.GetConfiguredTexutres()); - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"#include \"Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl\"{nl}"); + var codeSnippets = new List(); + var portCodeIndices = new List[ports.Count]; + var sharedCodeIndices = new List(); + for (var i = 0; i < portCodeIndices.Length; i++) + { + portCodeIndices[i] = new List(); + } - for (var registryIndex = 0; registryIndex < registry.names.Count; registryIndex++) - { - var name = registry.names[registryIndex]; - var source = registry.sources[name]; - var precision = source.nodes.First().concretePrecision; + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"#include \"Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl\"{nl}"); - var hasPrecisionMismatch = false; - var nodeNames = new HashSet(); - foreach (var node in source.nodes) + for (var registryIndex = 0; registryIndex < registry.names.Count; registryIndex++) { - nodeNames.Add(node.name); - if (node.concretePrecision != precision) + var name = registry.names[registryIndex]; + var source = registry.sources[name]; + var precision = source.nodes.First().concretePrecision; + + var hasPrecisionMismatch = false; + var nodeNames = new HashSet(); + foreach (var node in source.nodes) { - hasPrecisionMismatch = true; - break; + nodeNames.Add(node.name); + if (node.concretePrecision != precision) + { + hasPrecisionMismatch = true; + break; + } } - } - if (hasPrecisionMismatch) - { - var message = new StringBuilder($"Precision mismatch for function {name}:"); - foreach (var node in source.nodes) + if (hasPrecisionMismatch) { - message.AppendLine($"{node.name} ({node.objectId}): {node.concretePrecision}"); + var message = new StringBuilder($"Precision mismatch for function {name}:"); + foreach (var node in source.nodes) + { + message.AppendLine($"{node.name} ({node.objectId}): {node.concretePrecision}"); + } + throw new InvalidOperationException(message.ToString()); } - throw new InvalidOperationException(message.ToString()); - } - var code = source.code.Replace(PrecisionUtil.Token, precision.ToShaderString()); - code = $"// Node: {string.Join(", ", nodeNames)}{nl}{code}"; - var codeIndex = codeSnippets.Count; - codeSnippets.Add(code + nl); - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - var portNodeSet = portNodeSets[portIndex]; - foreach (var node in source.nodes) + var code = source.code.Replace(PrecisionUtil.Token, precision.ToShaderString()); + code = $"// Node: {string.Join(", ", nodeNames)}{nl}{code}"; + var codeIndex = codeSnippets.Count; + codeSnippets.Add(code + nl); + for (var portIndex = 0; portIndex < ports.Count; portIndex++) { - if (portNodeSet.Contains(node)) + var portNodeSet = portNodeSets[portIndex]; + foreach (var node in source.nodes) { - portCodeIndices[portIndex].Add(codeIndex); - break; + if (portNodeSet.Contains(node)) + { + portCodeIndices[portIndex].Add(codeIndex); + break; + } } } } - } - foreach (var property in graph.properties) - { - if (property.isExposable && property.generatePropertyBlock) + foreach (var property in graph.properties) { - continue; - } + if (property.isExposable && property.generatePropertyBlock) + { + continue; + } - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - var portPropertySet = portPropertySets[portIndex]; - if (portPropertySet.Contains(property.objectId)) + for (var portIndex = 0; portIndex < ports.Count; portIndex++) { - portCodeIndices[portIndex].Add(codeSnippets.Count); + var portPropertySet = portPropertySets[portIndex]; + if (portPropertySet.Contains(property.objectId)) + { + portCodeIndices[portIndex].Add(codeSnippets.Count); + } } - } - ShaderStringBuilder builder = new ShaderStringBuilder(); - property.ForeachHLSLProperty(h => h.AppendTo(builder)); + ShaderStringBuilder builder = new ShaderStringBuilder(); + property.ForeachHLSLProperty(h => h.AppendTo(builder)); - codeSnippets.Add($"// Property: {property.displayName}{nl}{builder.ToCodeBlock()}{nl}{nl}"); - } + codeSnippets.Add($"// Property: {property.displayName}{nl}{builder.ToCodeBlock()}{nl}{nl}"); + } - var inputStructName = $"SG_Input_{assetGuid}"; - var outputStructName = $"SG_Output_{assetGuid}"; - var evaluationFunctionName = $"SG_Evaluate_{assetGuid}"; + var inputStructName = $"SG_Input_{assetGuid}"; + var outputStructName = $"SG_Output_{assetGuid}"; + var evaluationFunctionName = $"SG_Evaluate_{assetGuid}"; - #region Input Struct + #region Input Struct - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"struct {inputStructName}{nl}{{{nl}"); + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"struct {inputStructName}{nl}{{{nl}"); - #region Requirements + #region Requirements - var portRequirements = new ShaderGraphRequirements[ports.Count]; - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - var requirementsNodes = portNodeSets[portIndex].ToList(); - requirementsNodes.Add(ports[portIndex].owner); - portRequirements[portIndex] = ShaderGraphRequirements.FromNodes(requirementsNodes, ports[portIndex].stageCapability); - } + var portRequirements = new ShaderGraphRequirements[ports.Count]; + for (var portIndex = 0; portIndex < ports.Count; portIndex++) + { + var requirementsNodes = portNodeSets[portIndex].ToList(); + requirementsNodes.Add(ports[portIndex].owner); + portRequirements[portIndex] = ShaderGraphRequirements.FromNodes(requirementsNodes, ports[portIndex].stageCapability); + } - var portIndices = new List(); - portIndices.Capacity = ports.Count; + var portIndices = new List(); + portIndices.Capacity = ports.Count; - void AddRequirementsSnippet(Func predicate, string snippet) - { - portIndices.Clear(); - for (var portIndex = 0; portIndex < ports.Count; portIndex++) + void AddRequirementsSnippet(Func predicate, string snippet) { - if (predicate(portRequirements[portIndex])) + portIndices.Clear(); + for (var portIndex = 0; portIndex < ports.Count; portIndex++) { - portIndices.Add(portIndex); + if (predicate(portRequirements[portIndex])) + { + portIndices.Add(portIndex); + } + } + + if (portIndices.Count > 0) + { + foreach (var portIndex in portIndices) + { + portCodeIndices[portIndex].Add(codeSnippets.Count); + } + + codeSnippets.Add($"{indent}{snippet};{nl}"); } } - if (portIndices.Count > 0) + void AddCoordinateSpaceSnippets(InterpolatorType interpolatorType, Func selector) { - foreach (var portIndex in portIndices) + foreach (var space in EnumInfo.values) { - portCodeIndices[portIndex].Add(codeSnippets.Count); + var neededSpace = space.ToNeededCoordinateSpace(); + AddRequirementsSnippet(r => (selector(r) & neededSpace) > 0, $"float3 {space.ToVariableName(interpolatorType)}"); } - - codeSnippets.Add($"{indent}{snippet};{nl}"); } - } - void AddCoordinateSpaceSnippets(InterpolatorType interpolatorType, Func selector) - { - foreach (var space in EnumInfo.values) + // TODO: Rework requirements system to make this better + AddCoordinateSpaceSnippets(InterpolatorType.Normal, r => r.requiresNormal); + AddCoordinateSpaceSnippets(InterpolatorType.Tangent, r => r.requiresTangent); + AddCoordinateSpaceSnippets(InterpolatorType.BiTangent, r => r.requiresBitangent); + AddCoordinateSpaceSnippets(InterpolatorType.ViewDirection, r => r.requiresViewDir); + AddCoordinateSpaceSnippets(InterpolatorType.Position, r => r.requiresPosition); + + AddRequirementsSnippet(r => r.requiresVertexColor, $"float4 {ShaderGeneratorNames.VertexColor}"); + AddRequirementsSnippet(r => r.requiresScreenPosition, $"float4 {ShaderGeneratorNames.ScreenPosition}"); + AddRequirementsSnippet(r => r.requiresFaceSign, $"float4 {ShaderGeneratorNames.FaceSign}"); + + foreach (var uvChannel in EnumInfo.values) { - var neededSpace = space.ToNeededCoordinateSpace(); - AddRequirementsSnippet(r => (selector(r) & neededSpace) > 0, $"float3 {space.ToVariableName(interpolatorType)}"); + AddRequirementsSnippet(r => r.requiresMeshUVs.Contains(uvChannel), $"half4 {uvChannel.GetUVName()}"); } - } - // TODO: Rework requirements system to make this better - AddCoordinateSpaceSnippets(InterpolatorType.Normal, r => r.requiresNormal); - AddCoordinateSpaceSnippets(InterpolatorType.Tangent, r => r.requiresTangent); - AddCoordinateSpaceSnippets(InterpolatorType.BiTangent, r => r.requiresBitangent); - AddCoordinateSpaceSnippets(InterpolatorType.ViewDirection, r => r.requiresViewDir); - AddCoordinateSpaceSnippets(InterpolatorType.Position, r => r.requiresPosition); + AddRequirementsSnippet(r => r.requiresTime, $"float3 {ShaderGeneratorNames.TimeParameters}"); - AddRequirementsSnippet(r => r.requiresVertexColor, $"float4 {ShaderGeneratorNames.VertexColor}"); - AddRequirementsSnippet(r => r.requiresScreenPosition, $"float4 {ShaderGeneratorNames.ScreenPosition}"); - AddRequirementsSnippet(r => r.requiresFaceSign, $"float4 {ShaderGeneratorNames.FaceSign}"); + #endregion - foreach (var uvChannel in EnumInfo.values) - { - AddRequirementsSnippet(r => r.requiresMeshUVs.Contains(uvChannel), $"half4 {uvChannel.GetUVName()}"); - } + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"}};{nl}{nl}"); - AddRequirementsSnippet(r => r.requiresTime, $"float3 {ShaderGeneratorNames.TimeParameters}"); + #endregion - #endregion + // VFX Code heavily relies on the slotId from the original MasterNodes + // Since we keep these around for upgrades anyway, for now it is simpler to use them + // Therefore we remap the output blocks back to the original Ids here + var originialPortIds = new int[ports.Count]; + for (int i = 0; i < originialPortIds.Length; i++) + { + if (!VFXTarget.s_BlockMap.TryGetValue((ports[i].owner as BlockNode).descriptor, out var originalId)) + continue; - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"}};{nl}{nl}"); + // In Master Nodes we had a different BaseColor/Color slot id between Unlit/Lit + // In the stack we use BaseColor for both cases. Catch this here. + if (asset.lit && originalId == ShaderGraphVfxAsset.ColorSlotId) + { + originalId = ShaderGraphVfxAsset.BaseColorSlotId; + } - #endregion + originialPortIds[i] = originalId; + } - // VFX Code heavily relies on the slotId from the original MasterNodes - // Since we keep these around for upgrades anyway, for now it is simpler to use them - // Therefore we remap the output blocks back to the original Ids here - var originialPortIds = new int[ports.Count]; - for(int i = 0; i < originialPortIds.Length; i++) - { - if(!VFXTarget.s_BlockMap.TryGetValue((ports[i].owner as BlockNode).descriptor, out var originalId)) - continue; + #region Output Struct - // In Master Nodes we had a different BaseColor/Color slot id between Unlit/Lit - // In the stack we use BaseColor for both cases. Catch this here. - if(asset.lit && originalId == ShaderGraphVfxAsset.ColorSlotId) + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"struct {outputStructName}{nl}{{"); + + for (var portIndex = 0; portIndex < ports.Count; portIndex++) { - originalId = ShaderGraphVfxAsset.BaseColorSlotId; + var port = ports[portIndex]; + portCodeIndices[portIndex].Add(codeSnippets.Count); + codeSnippets.Add($"{nl}{indent}{port.concreteValueType.ToShaderString(graph.concretePrecision)} {port.shaderOutputName}_{originialPortIds[portIndex]};"); } - originialPortIds[i] = originalId; - } + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"{nl}}};{nl}{nl}"); - #region Output Struct + #endregion - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"struct {outputStructName}{nl}{{"); + #region Graph Function - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - var port = ports[portIndex]; - portCodeIndices[portIndex].Add(codeSnippets.Count); - codeSnippets.Add($"{nl}{indent}{port.concreteValueType.ToShaderString(graph.concretePrecision)} {port.shaderOutputName}_{originialPortIds[portIndex]};"); - } + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"{outputStructName} {evaluationFunctionName}({nl}{indent}{inputStructName} IN"); - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"{nl}}};{nl}{nl}"); - - #endregion + var inputProperties = new List(); + var portPropertyIndices = new List[ports.Count]; + for (var portIndex = 0; portIndex < ports.Count; portIndex++) + { + portPropertyIndices[portIndex] = new List(); + } - #region Graph Function + foreach (var property in graph.properties) + { + if (!property.isExposable || !property.generatePropertyBlock) + { + continue; + } - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"{outputStructName} {evaluationFunctionName}({nl}{indent}{inputStructName} IN"); + var propertyIndex = inputProperties.Count; + var codeIndex = codeSnippets.Count; - var inputProperties = new List(); - var portPropertyIndices = new List[ports.Count]; - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - portPropertyIndices[portIndex] = new List(); - } + for (var portIndex = 0; portIndex < ports.Count; portIndex++) + { + var portPropertySet = portPropertySets[portIndex]; + if (portPropertySet.Contains(property.objectId)) + { + portCodeIndices[portIndex].Add(codeIndex); + portPropertyIndices[portIndex].Add(propertyIndex); + } + } - foreach (var property in graph.properties) - { - if (!property.isExposable || !property.generatePropertyBlock) - { - continue; + inputProperties.Add(property); + codeSnippets.Add($",{nl}{indent}/* Property: {property.displayName} */ {property.GetPropertyAsArgumentString()}"); } - var propertyIndex = inputProperties.Count; - var codeIndex = codeSnippets.Count; + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"){nl}{{"); - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - var portPropertySet = portPropertySets[portIndex]; - if (portPropertySet.Contains(property.objectId)) + #region Node Code + + for (var mappingIndex = 0; mappingIndex < bodySb.mappings.Count; mappingIndex++) { - portCodeIndices[portIndex].Add(codeIndex); - portPropertyIndices[portIndex].Add(propertyIndex); + var mapping = bodySb.mappings[mappingIndex]; + var code = bodySb.ToString(mapping.startIndex, mapping.count); + if (string.IsNullOrWhiteSpace(code)) + { + continue; } - } - inputProperties.Add(property); - codeSnippets.Add($",{nl}{indent}/* Property: {property.displayName} */ {property.GetPropertyAsArgumentString()}"); - } + code = $"{nl}{indent}// Node: {mapping.node.name}{nl}{code}"; + var codeIndex = codeSnippets.Count; + codeSnippets.Add(code); + for (var portIndex = 0; portIndex < ports.Count; portIndex++) + { + var portNodeSet = portNodeSets[portIndex]; + if (portNodeSet.Contains(mapping.node)) + { + portCodeIndices[portIndex].Add(codeIndex); + } + } + } - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"){nl}{{"); + #endregion - #region Node Code + #region Output Mapping - for (var mappingIndex = 0; mappingIndex < bodySb.mappings.Count; mappingIndex++) - { - var mapping = bodySb.mappings[mappingIndex]; - var code = bodySb.ToString(mapping.startIndex, mapping.count); - if (string.IsNullOrWhiteSpace(code)) - { - continue; - } + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"{nl}{indent}// VFXMasterNode{nl}{indent}{outputStructName} OUT;{nl}"); - code = $"{nl}{indent}// Node: {mapping.node.name}{nl}{code}"; - var codeIndex = codeSnippets.Count; - codeSnippets.Add(code); + // Output mapping for (var portIndex = 0; portIndex < ports.Count; portIndex++) { - var portNodeSet = portNodeSets[portIndex]; - if (portNodeSet.Contains(mapping.node)) - { - portCodeIndices[portIndex].Add(codeIndex); - } + var port = ports[portIndex]; + portCodeIndices[portIndex].Add(codeSnippets.Count); + codeSnippets.Add($"{indent}OUT.{port.shaderOutputName}_{originialPortIds[portIndex]} = {port.owner.GetSlotValue(port.id, GenerationMode.ForReals, graph.concretePrecision)};{nl}"); } - } - #endregion + #endregion - #region Output Mapping + // Function end + sharedCodeIndices.Add(codeSnippets.Count); + codeSnippets.Add($"{indent}return OUT;{nl}}}{nl}"); - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"{nl}{indent}// VFXMasterNode{nl}{indent}{outputStructName} OUT;{nl}"); + #endregion - // Output mapping - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - var port = ports[portIndex]; - portCodeIndices[portIndex].Add(codeSnippets.Count); - codeSnippets.Add($"{indent}OUT.{port.shaderOutputName}_{originialPortIds[portIndex]} = {port.owner.GetSlotValue(port.id, GenerationMode.ForReals, graph.concretePrecision)};{nl}"); - } + result.codeSnippets = codeSnippets.ToArray(); + result.sharedCodeIndices = sharedCodeIndices.ToArray(); + result.outputCodeIndices = new IntArray[ports.Count]; + for (var i = 0; i < ports.Count; i++) + { + result.outputCodeIndices[i] = portCodeIndices[i].ToArray(); + } - #endregion + var outputMetadatas = new OutputMetadata[ports.Count]; + for (int portIndex = 0; portIndex < outputMetadatas.Length; portIndex++) + { + outputMetadatas[portIndex] = new OutputMetadata(portIndex, ports[portIndex].shaderOutputName, originialPortIds[portIndex]); + } - // Function end - sharedCodeIndices.Add(codeSnippets.Count); - codeSnippets.Add($"{indent}return OUT;{nl}}}{nl}"); + asset.SetOutputs(outputMetadatas); - #endregion + asset.evaluationFunctionName = evaluationFunctionName; + asset.inputStructName = inputStructName; + asset.outputStructName = outputStructName; + asset.portRequirements = portRequirements; + asset.concretePrecision = graph.concretePrecision; + asset.SetProperties(inputProperties); + asset.outputPropertyIndices = new IntArray[ports.Count]; + for (var portIndex = 0; portIndex < ports.Count; portIndex++) + { + asset.outputPropertyIndices[portIndex] = portPropertyIndices[portIndex].ToArray(); + } - result.codeSnippets = codeSnippets.ToArray(); - result.sharedCodeIndices = sharedCodeIndices.ToArray(); - result.outputCodeIndices = new IntArray[ports.Count]; - for (var i = 0; i < ports.Count; i++) - { - result.outputCodeIndices[i] = portCodeIndices[i].ToArray(); + return asset; } - - var outputMetadatas = new OutputMetadata[ports.Count]; - for (int portIndex = 0; portIndex < outputMetadatas.Length; portIndex++) + finally { - outputMetadatas[portIndex] = new OutputMetadata(portIndex, ports[portIndex].shaderOutputName, originialPortIds[portIndex]); + graph.isSubGraph = oldIsSubGraph; } - - asset.SetOutputs(outputMetadatas); - - asset.evaluationFunctionName = evaluationFunctionName; - asset.inputStructName = inputStructName; - asset.outputStructName = outputStructName; - asset.portRequirements = portRequirements; - asset.concretePrecision = graph.concretePrecision; - asset.SetProperties(inputProperties); - asset.outputPropertyIndices = new IntArray[ports.Count]; - for (var portIndex = 0; portIndex < ports.Count; portIndex++) - { - asset.outputPropertyIndices[portIndex] = portPropertyIndices[portIndex].ToArray(); - } - - return asset; } #endif } diff --git a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs index 1ba422698a3..326a9b3f2b3 100644 --- a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs +++ b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs @@ -566,7 +566,7 @@ public override IEnumerable> additionalRep callSG.builder.Append($"\n{shaderGraph.outputStructName} OUTSG = {shaderGraph.evaluationFunctionName}(INSG"); if (graphCode.properties.Any()) - callSG.builder.Append("," + graphCode.properties.Select(t => IsTexture(t.propertyType) ? (t.propertyType == PropertyType.Texture2D ? $"{t.referenceName}, sampler{t.referenceName}, {t.referenceName}_TexelSize" : $"{t.referenceName}, sampler{t.referenceName}") : t.referenceName).Aggregate((s, t) => s + ", " + t)); + callSG.builder.Append("," + graphCode.properties.Select(t => t.GetHLSLVariableName(false)).Aggregate((s, t) => s + ", " + t)); callSG.builder.AppendLine(");"); From aa1db2d4900a1491e5a7bba0c2777137f16d0f36 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 23 Nov 2020 12:46:02 -0800 Subject: [PATCH 23/28] Improved backwards compatibility, added graphics tests, addressing feedback --- .../CommonAssets/Editor/ImportUpdateTests.cs | 129 +- .../Textures/Textures/Numbers.psd | 3 + .../Textures/Textures/Numbers.psd.meta | 144 + .../Textures/Textures/blueTexture.png | 3 + .../Textures/Textures/blueTexture.png.meta | 144 + .../Textures/Textures/heartTexture.png | 3 + .../Textures/Textures/heartTexture.png.meta | 144 + .../Textures/Textures/pumpkinTexture.png | 3 + .../Textures/Textures/pumpkinTexture.png.meta | 144 + .../Textures/Textures/rainbowTexture.png | 3 + .../Textures/Textures/rainbowTexture.png.meta | 144 + .../Textures/Textures/sunTexture.png | 3 + .../Textures/Textures/sunTexture.png.meta | 144 + .../Textures/Textures/sunTexture_point.png | 3 + .../Textures/sunTexture_point.png.meta | 144 + .../Textures/Textures/treeTexture.png | 3 + .../Textures/Textures/treeTexture.png.meta | 144 + .../10.x.x/TextureTest/Digit.shadersubgraph | 1181 +++ .../TextureTest/Digit.shadersubgraph.meta | 10 + .../10.x.x/TextureTest/Integer.shadersubgraph | 3490 ++++++++ .../TextureTest/Integer.shadersubgraph.meta | 10 + .../TextureTest/SubgraphTest.shadersubgraph | 511 ++ .../SubgraphTest.shadersubgraph.meta | 10 + .../TextureTest/TextureTest.shadergraph | 7447 +++++++++++++++++ .../TextureTest/TextureTest.shadergraph.meta | 10 + .../ShaderLibrary/Texture.hlsl | 82 + .../Data/Graphs/CubemapInputMaterialSlot.cs | 2 +- .../Editor/Data/Graphs/CubemapMaterialSlot.cs | 2 +- .../Data/Graphs/SamplerStateMaterialSlot.cs | 2 +- .../Graphs/Texture2DArrayInputMaterialSlot.cs | 2 +- .../Data/Graphs/Texture2DArrayMaterialSlot.cs | 2 +- .../Data/Graphs/Texture2DInputMaterialSlot.cs | 2 +- .../Data/Graphs/Texture2DMaterialSlot.cs | 2 +- .../Data/Graphs/Texture3DInputMaterialSlot.cs | 2 +- .../Data/Graphs/Texture3DMaterialSlot.cs | 2 +- .../Data/Nodes/Utility/CustomFunctionNode.cs | 71 +- 36 files changed, 14099 insertions(+), 46 deletions(-) create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/Numbers.psd create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/Numbers.psd.meta create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/blueTexture.png create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/blueTexture.png.meta create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/heartTexture.png create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/heartTexture.png.meta create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/pumpkinTexture.png create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/pumpkinTexture.png.meta create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/rainbowTexture.png create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/rainbowTexture.png.meta create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture.png create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture.png.meta create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture_point.png create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture_point.png.meta create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/treeTexture.png create mode 100644 TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/treeTexture.png.meta create mode 100644 TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Digit.shadersubgraph create mode 100644 TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Digit.shadersubgraph.meta create mode 100644 TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Integer.shadersubgraph create mode 100644 TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Integer.shadersubgraph.meta create mode 100644 TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/SubgraphTest.shadersubgraph create mode 100644 TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/SubgraphTest.shadersubgraph.meta create mode 100644 TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/TextureTest.shadergraph create mode 100644 TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/TextureTest.shadergraph.meta diff --git a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ImportUpdateTests.cs b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ImportUpdateTests.cs index d3e8234fc60..b0813730ba6 100644 --- a/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ImportUpdateTests.cs +++ b/TestProjects/ShaderGraph/Assets/CommonAssets/Editor/ImportUpdateTests.cs @@ -1,6 +1,7 @@ using NUnit.Framework; using System.Collections; using System.IO; +using System.Linq; using UnityEditor.Graphing.Util; using UnityEditor.ShaderGraph.Serialization; using UnityEngine; @@ -10,63 +11,116 @@ namespace UnityEditor.ShaderGraph.UnitTests [TestFixture] class ImportUpdateTests { - public class ImportCases : IEnumerable + public class SingleImportCases : IEnumerable { private const string kGraphsLocation = "PreviousGraphVersions/"; public IEnumerator GetEnumerator() { - return Directory.GetFiles(Application.dataPath + "/../" + kGraphsLocation, "*", SearchOption.AllDirectories).GetEnumerator(); + var versionDirs = Directory.GetDirectories(Application.dataPath + "/../" + kGraphsLocation, "*", SearchOption.TopDirectoryOnly); + foreach (var dir in versionDirs) + foreach (var assetPath in Directory.GetFiles(dir, "*", SearchOption.TopDirectoryOnly)) + yield return assetPath; + } + } + + public class MultiImportDirectories : IEnumerable + { + private const string kGraphsLocation = "PreviousGraphVersions/"; + public IEnumerator GetEnumerator() + { + var versionDirs = Directory.GetDirectories(Application.dataPath + "/../" + kGraphsLocation, "*", SearchOption.TopDirectoryOnly); + foreach (var dir in versionDirs) + foreach (var multiDir in Directory.GetDirectories(dir, "*", SearchOption.TopDirectoryOnly)) + yield return multiDir; } } [OneTimeSetUp] public void Setup() { - if(!AssetDatabase.IsValidFolder("Assets/Testing/ImportTests")) + if (!Directory.Exists(Application.dataPath + "Testing/ImportTests")) + Directory.CreateDirectory(Application.dataPath + "Testing/ImportTests"); + AssetDatabase.Refresh(); + + if (!AssetDatabase.IsValidFolder("Assets/Testing/ImportTests")) { AssetDatabase.CreateFolder("Assets/Testing", "ImportTests"); } } - [TestCaseSource(typeof(ImportCases))] - public void CopyOverAndImport(string assetPath) + [TestCaseSource(typeof(SingleImportCases))] + public void ImportSingle(string assetPath) { string fileName = Path.GetFileName(assetPath); - string fileNameNoExtension = Path.GetFileNameWithoutExtension(assetPath); string fileContents = File.ReadAllText(assetPath); - string fileExtension = Path.GetExtension(assetPath).ToLower(); - bool isSubgraph = (fileExtension == "shadersubgraph"); - string localFilePath = "Assets/Testing/ImportTests/" + fileName; - string localFilePathNoExtension = "Assets/Testing/ImportTests/" + fileNameNoExtension; + string targetPath = Application.dataPath + "/Testing/ImportTests/" + fileName; + File.WriteAllText(targetPath, fileContents); - File.WriteAllText(Application.dataPath + "/Testing/ImportTests/" + fileName, fileContents); - AssetDatabase.ImportAsset(localFilePath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate | ImportAssetOptions.DontDownloadFromCacheServer); - var graphGuid = AssetDatabase.AssetPathToGUID(localFilePath); + string unityLocalPath = "Assets/Testing/ImportTests/" + fileName; + TestImportAsset(unityLocalPath, targetPath); + } + + [TestCaseSource(typeof(MultiImportDirectories))] + public void ImportMulti(string directory) + { + string sourceDir = Path.GetFullPath(directory).TrimEnd(Path.DirectorySeparatorChar); + string dirName = Path.GetFileName(sourceDir); + + string targetDir = Application.dataPath + "/Testing/ImportTests/" + dirName; + DirectoryCopy(sourceDir, targetDir, true, true); + + foreach (var assetFullPath in Directory.GetFiles(targetDir, "*.shader*", SearchOption.TopDirectoryOnly)) + { + if (!assetFullPath.EndsWith(".meta")) + { + string relativeFilePath = assetFullPath.Substring(targetDir.Length); + string unityLocalPath = "Assets/Testing/ImportTests/" + dirName + relativeFilePath; + TestImportAsset(unityLocalPath, assetFullPath); + } + } + } + + public void TestImportAsset(string unityLocalPath, string fullPath) + { + unityLocalPath = unityLocalPath.Replace("\\", "/"); + Debug.Log("Testing file: " + unityLocalPath); + + // invoke an import + AssetDatabase.ImportAsset(unityLocalPath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate | ImportAssetOptions.DontDownloadFromCacheServer); + + // double check we can load it up and validate it + string fileContents = File.ReadAllText(fullPath); + Assert.Greater(fileContents.Length, 0); + + var graphGuid = AssetDatabase.AssetPathToGUID(unityLocalPath); var messageManager = new MessageManager(); GraphData graphData = new GraphData() { assetGuid = graphGuid, messageManager = messageManager }; MultiJson.Deserialize(graphData, fileContents); graphData.OnEnable(); graphData.ValidateGraph(); + string fileExtension = Path.GetExtension(fullPath).ToLower(); + bool isSubgraph = (fileExtension == "shadersubgraph"); if (isSubgraph) { // check that the SubGraphAsset is the same after versioning twice // this is important to ensure we're not importing subgraphs non-deterministically when they are out-of-date on disk - AssetDatabase.ImportAsset(localFilePath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate | ImportAssetOptions.DontDownloadFromCacheServer); - var subGraph = AssetDatabase.LoadAssetAtPath(localFilePath); + AssetDatabase.ImportAsset(unityLocalPath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate | ImportAssetOptions.DontDownloadFromCacheServer); + var subGraph = AssetDatabase.LoadAssetAtPath(unityLocalPath); var serialized = EditorJsonUtility.ToJson(subGraph); - AssetDatabase.ImportAsset(localFilePath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate | ImportAssetOptions.DontDownloadFromCacheServer); - var subGraph2 = AssetDatabase.LoadAssetAtPath(localFilePath); + AssetDatabase.ImportAsset(unityLocalPath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate | ImportAssetOptions.DontDownloadFromCacheServer); + var subGraph2 = AssetDatabase.LoadAssetAtPath(unityLocalPath); var serialized2 = EditorJsonUtility.ToJson(subGraph2); - Assert.AreEqual(serialized, serialized2, $"Importing the subgraph {localFilePath} twice resulted in different subgraph assets."); + Assert.AreEqual(serialized, serialized2, $"Importing the subgraph {unityLocalPath} twice resulted in different subgraph assets."); } else { // check that the generated shader is the same after versioning twice // this is important to ensure we're not importing shaders non-deterministically when they are out-of-date on disk + string fileNameNoExtension = Path.GetFileNameWithoutExtension(fullPath); var generator = new Generator(graphData, graphData.outputNode, GenerationMode.ForReals, fileNameNoExtension, null); string shader = generator.generatedShader; @@ -78,18 +132,55 @@ public void CopyOverAndImport(string assetPath) var generator2 = new Generator(graphData2, graphData2.outputNode, GenerationMode.ForReals, fileNameNoExtension, null); string shader2 = generator2.generatedShader; - Assert.AreEqual(shader, shader2, $"Importing the graph {localFilePath} twice resulted in different generated shaders."); + Assert.AreEqual(shader, shader2, $"Importing the graph {unityLocalPath} twice resulted in different generated shaders."); } } [OneTimeTearDown] public void Cleanup() { + AssetDatabase.Refresh(); foreach (string assetGuid in AssetDatabase.FindAssets("*", new string[] { "Assets/Testing/ImportTests" })) { Debug.Log(AssetDatabase.GUIDToAssetPath(assetGuid)); AssetDatabase.DeleteAsset(AssetDatabase.GUIDToAssetPath(assetGuid)); } } + + private static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs, bool overwriteFiles) + { + // Get the subdirectories for the specified directory. + DirectoryInfo dir = new DirectoryInfo(sourceDirName); + + if (!dir.Exists) + { + throw new DirectoryNotFoundException( + "Source directory does not exist or could not be found: " + + sourceDirName); + } + + DirectoryInfo[] dirs = dir.GetDirectories(); + + // If the destination directory doesn't exist, create it. + Directory.CreateDirectory(destDirName); + + // Get the files in the directory and copy them to the new location. + FileInfo[] files = dir.GetFiles(); + foreach (FileInfo file in files) + { + string tempPath = Path.Combine(destDirName, file.Name); + file.CopyTo(tempPath, overwriteFiles); + } + + // If copying subdirectories, copy them and their contents to new location. + if (copySubDirs) + { + foreach (DirectoryInfo subdir in dirs) + { + string tempPath = Path.Combine(destDirName, subdir.Name); + DirectoryCopy(subdir.FullName, tempPath, copySubDirs, overwriteFiles); + } + } + } } } diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/Numbers.psd b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/Numbers.psd new file mode 100644 index 00000000000..38c3ce0088c --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/Numbers.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c2f3a88b52643dcdd288ab5d616577b8d9fbe686a4d2a09dc9f325bbb135cf9 +size 189915 diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/Numbers.psd.meta b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/Numbers.psd.meta new file mode 100644 index 00000000000..1c8d4ff0bb9 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/Numbers.psd.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: cda8ec2060aac304dad696b1b6c763b5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/blueTexture.png b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/blueTexture.png new file mode 100644 index 00000000000..f5eab215845 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/blueTexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cad6f73c60e82812cf97f9402077b8e930e803466154ecf6c9424ddb51de18d +size 139 diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/blueTexture.png.meta b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/blueTexture.png.meta new file mode 100644 index 00000000000..383aaf46cfb --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/blueTexture.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: 33e7bdccd936e2a47965bf92082c7e5f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/heartTexture.png b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/heartTexture.png new file mode 100644 index 00000000000..2aeeefee3ad --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/heartTexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00d81280a8cb7e6b958788eddf7eebf111eaf2d8e2c2a87eed2d892c6c759f5e +size 259 diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/heartTexture.png.meta b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/heartTexture.png.meta new file mode 100644 index 00000000000..7acf84e4efa --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/heartTexture.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: 940df6ba508f64540a3ffd2c5c43c91a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/pumpkinTexture.png b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/pumpkinTexture.png new file mode 100644 index 00000000000..e7d5922006e --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/pumpkinTexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7641505a0b024743ec48003ebc277f47800b0cf6896a39d966c4cf016485d8e +size 229 diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/pumpkinTexture.png.meta b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/pumpkinTexture.png.meta new file mode 100644 index 00000000000..4c3e69eb814 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/pumpkinTexture.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: 4ea79c9c5cb5bf344a4c46bd8e87b35f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/rainbowTexture.png b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/rainbowTexture.png new file mode 100644 index 00000000000..f1c461d0e90 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/rainbowTexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:895f3bfe4d76b6b1fa999907d5d51ac6d9b9ab978123f8c501b8ee5314688805 +size 156 diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/rainbowTexture.png.meta b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/rainbowTexture.png.meta new file mode 100644 index 00000000000..f76a0950c70 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/rainbowTexture.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: 4178de12098ce6e4da6ff9f539f2cd9f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture.png b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture.png new file mode 100644 index 00000000000..6fcdc7a94d6 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6630f032351a23e43508dcba5e7dc9f1b20f3eecc21ff40ec8db51257e147667 +size 238 diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture.png.meta b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture.png.meta new file mode 100644 index 00000000000..393b0820c1d --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: d2be28188f7455b4bbef6bda86eb7410 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture_point.png b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture_point.png new file mode 100644 index 00000000000..6fcdc7a94d6 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture_point.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6630f032351a23e43508dcba5e7dc9f1b20f3eecc21ff40ec8db51257e147667 +size 238 diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture_point.png.meta b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture_point.png.meta new file mode 100644 index 00000000000..5018fb521fc --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/sunTexture_point.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: 0cca700aac7c2a9498c86edf66f943f8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 2 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/treeTexture.png b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/treeTexture.png new file mode 100644 index 00000000000..63ab27739bc --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/treeTexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e718cfbd3e5cf9ef420faeb6137ca8d6a778a02f4ab20d14eadc316e6ef1a40 +size 206 diff --git a/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/treeTexture.png.meta b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/treeTexture.png.meta new file mode 100644 index 00000000000..d27b5709af3 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/TestbedAssets/Textures/Textures/treeTexture.png.meta @@ -0,0 +1,144 @@ +fileFormatVersion: 2 +guid: 53ee4b410c7f7564b8fd0ff023cfc560 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Digit.shadersubgraph b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Digit.shadersubgraph new file mode 100644 index 00000000000..588cb0fea67 --- /dev/null +++ b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Digit.shadersubgraph @@ -0,0 +1,1181 @@ +{ + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "9c9d5d5aa926466995a8f06ae9a32c82", + "m_Version": 2, + "m_Properties": [ + { + "m_Id": "15291492f0bd40d889c9b12c3dec8ffe" + }, + { + "m_Id": "669bf42fd6af4466869d0fb87fbcd038" + } + ], + "m_Keywords": [], + "m_Nodes": [ + { + "m_Id": "e81b9fe1634141cc85a3d4ac33cd7ed3" + }, + { + "m_Id": "df9c0578fb224ceaa2877ce149a5dbcf" + }, + { + "m_Id": "a5a2b0edf71d48d49e5978493f5330fe" + }, + { + "m_Id": "d70257105f6a45ec869cc924161b820c" + }, + { + "m_Id": "943f6b4b9b41418eb88fa6773701bd95" + }, + { + "m_Id": "5bae3e0f72b74004b52761718b0cd2c0" + }, + { + "m_Id": "76f545dec837408b8c4c4653a3a36575" + }, + { + "m_Id": "1d9bfd90e756468f8ed59f4c9ce45ab5" + }, + { + "m_Id": "11be16753c094ece8c66a9ca70426f6c" + }, + { + "m_Id": "3bf5873bc1fe4d398f013a0b68f830ee" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "11be16753c094ece8c66a9ca70426f6c" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "943f6b4b9b41418eb88fa6773701bd95" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "1d9bfd90e756468f8ed59f4c9ce45ab5" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a5a2b0edf71d48d49e5978493f5330fe" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3bf5873bc1fe4d398f013a0b68f830ee" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1d9bfd90e756468f8ed59f4c9ce45ab5" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5bae3e0f72b74004b52761718b0cd2c0" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e81b9fe1634141cc85a3d4ac33cd7ed3" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "943f6b4b9b41418eb88fa6773701bd95" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a5a2b0edf71d48d49e5978493f5330fe" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a5a2b0edf71d48d49e5978493f5330fe" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5bae3e0f72b74004b52761718b0cd2c0" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d70257105f6a45ec869cc924161b820c" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "11be16753c094ece8c66a9ca70426f6c" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "df9c0578fb224ceaa2877ce149a5dbcf" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d70257105f6a45ec869cc924161b820c" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 368.0000305175781, + "y": -78.0000228881836 + }, + "m_Blocks": [] + }, + "m_FragmentContext": { + "m_Position": { + "x": 368.0000305175781, + "y": 121.9999771118164 + }, + "m_Blocks": [] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"fileID\":10210,\"guid\":\"0000000000000000e000000000000000\",\"type\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Sub Graphs", + "m_ConcretePrecision": 0, + "m_OutputNode": { + "m_Id": "e81b9fe1634141cc85a3d4ac33cd7ed3" + }, + "m_ActiveTargets": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "0e7a433bcbaf464db111903f53f68e1d", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "11be16753c094ece8c66a9ca70426f6c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -917.0, + "y": 27.999996185302736, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "64670df19aef43fa8bd83a35dd9faca0" + }, + { + "m_Id": "bee9ef31bb004dd58804e4db868b84b3" + }, + { + "m_Id": "dd7514a630394a9db9efbfe535d7c3be" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector2ShaderProperty", + "m_ObjectId": "15291492f0bd40d889c9b12c3dec8ffe", + "m_Guid": { + "m_GuidSerialized": "1ccd7855-d017-443a-aa39-c0158764f83f" + }, + "m_Name": "UV", + "m_DefaultReferenceName": "Vector2_15291492f0bd40d889c9b12c3dec8ffe", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "19f02c59f21c4118840128124beb9e54", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.SaturateNode", + "m_ObjectId": "1d9bfd90e756468f8ed59f4c9ce45ab5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Saturate", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -586.0, + "y": -299.0000305175781, + "width": 208.0, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "f2588a83d4574b58b00001b70c989f24" + }, + { + "m_Id": "c397b63bacae42f8b41a85a7718f2751" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "36648c80bdfc4b0cb610ea5aaa2dc096", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "3b6a409500be4840a5c1eb52d0a7e559", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "3bf5873bc1fe4d398f013a0b68f830ee", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -850.9999389648438, + "y": -460.99993896484377, + "width": 93.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "775e7cb2278f4527a069112e2f643066" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "15291492f0bd40d889c9b12c3dec8ffe" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "409ea074231f45fc8b44a6d6f87f2b24", + "m_Id": 2, + "m_DisplayName": "Y", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Y", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "42e2b7e98cc24ee6958537db15d5446c", + "m_Id": 2, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "471cc9b7ad1544cb9516ad4fc5c3b289", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "489e3b4617b848d88e4e0150458cc744", + "m_Id": 1, + "m_DisplayName": "Tiling", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Tiling", + "m_StageCapability": 3, + "m_Value": { + "x": 0.10000000149011612, + "y": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "5bae3e0f72b74004b52761718b0cd2c0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 11.000025749206543, + "y": -51.00004577636719, + "width": 208.0, + "height": 437.0000305175781 + } + }, + "m_Slots": [ + { + "m_Id": "471cc9b7ad1544cb9516ad4fc5c3b289" + }, + { + "m_Id": "0e7a433bcbaf464db111903f53f68e1d" + }, + { + "m_Id": "36648c80bdfc4b0cb610ea5aaa2dc096" + }, + { + "m_Id": "c97d07f4f89e414bb024af333c6abbe9" + }, + { + "m_Id": "cd94ad29a2c547e5b11253fdba07ec73" + }, + { + "m_Id": "ef319368f0dc4d3381b2dd193977de4b" + }, + { + "m_Id": "7d8dddc257e04252a2949471c0ec0422" + }, + { + "m_Id": "3b6a409500be4840a5c1eb52d0a7e559" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "643e0e550d94492d86a4954270cbafef", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "64670df19aef43fa8bd83a35dd9faca0", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "669bf42fd6af4466869d0fb87fbcd038", + "m_Guid": { + "m_GuidSerialized": "f6aa3968-62a0-41e5-bc4a-e02f5a8142df" + }, + "m_Name": "Digit", + "m_DefaultReferenceName": "Vector1_669bf42fd6af4466869d0fb87fbcd038", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": 0.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "76f545dec837408b8c4c4653a3a36575", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -949.9999389648438, + "y": -330.9999694824219, + "width": 208.0, + "height": 313.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "19f02c59f21c4118840128124beb9e54" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "775e7cb2278f4527a069112e2f643066", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "7a65192301f54f63a39333735ded640f", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "7d8dddc257e04252a2949471c0ec0422", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "8f3fa299a51e423f8b2720df48bd8133", + "m_Id": 1, + "m_DisplayName": "Digit", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Digit", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2Node", + "m_ObjectId": "943f6b4b9b41418eb88fa6773701bd95", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Vector 2", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -615.0000610351563, + "y": 25.000017166137697, + "width": 128.0, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "9e24503b4e30405690c8bb562208ebaa" + }, + { + "m_Id": "409ea074231f45fc8b44a6d6f87f2b24" + }, + { + "m_Id": "7a65192301f54f63a39333735ded640f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": { + "x": 0.0, + "y": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9e24503b4e30405690c8bb562208ebaa", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode", + "m_ObjectId": "a5a2b0edf71d48d49e5978493f5330fe", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Tiling And Offset", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -353.99993896484377, + "y": -24.99997901916504, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "643e0e550d94492d86a4954270cbafef" + }, + { + "m_Id": "489e3b4617b848d88e4e0150458cc744" + }, + { + "m_Id": "42e2b7e98cc24ee6958537db15d5446c" + }, + { + "m_Id": "fc251b6d14424bd990190ec276e07f34" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "aa58248512924e92b57173b66775ddf3", + "m_Id": 0, + "m_DisplayName": "Digit", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b9216ab46afa48bca5b432fd2291b5e6", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "bdd6a73c768d46a8ac943ffd47f537bd", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "bee9ef31bb004dd58804e4db868b84b3", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.10000000149011612, + "e01": 2.0, + "e02": 2.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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c397b63bacae42f8b41a85a7718f2751", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c97d07f4f89e414bb024af333c6abbe9", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "cd94ad29a2c547e5b11253fdba07ec73", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.FloorNode", + "m_ObjectId": "d70257105f6a45ec869cc924161b820c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Floor", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1137.0, + "y": 26.999971389770509, + "width": 128.0, + "height": 94.0 + } + }, + "m_Slots": [ + { + "m_Id": "bdd6a73c768d46a8ac943ffd47f537bd" + }, + { + "m_Id": "b9216ab46afa48bca5b432fd2291b5e6" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "dd7514a630394a9db9efbfe535d7c3be", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "df9c0578fb224ceaa2877ce149a5dbcf", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1249.0, + "y": 68.00000762939453, + "width": 101.00000762939453, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "aa58248512924e92b57173b66775ddf3" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "669bf42fd6af4466869d0fb87fbcd038" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode", + "m_ObjectId": "e81b9fe1634141cc85a3d4ac33cd7ed3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Output", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 368.0000305175781, + "y": -78.0000228881836, + "width": 85.0, + "height": 77.00000762939453 + } + }, + "m_Slots": [ + { + "m_Id": "8f3fa299a51e423f8b2720df48bd8133" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "IsFirstSlotValid": true +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "ef319368f0dc4d3381b2dd193977de4b", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"cda8ec2060aac304dad696b1b6c763b5\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f2588a83d4574b58b00001b70c989f24", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "fc251b6d14424bd990190ec276e07f34", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + diff --git a/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Digit.shadersubgraph.meta b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Digit.shadersubgraph.meta new file mode 100644 index 00000000000..94e3b4230f0 --- /dev/null +++ b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Digit.shadersubgraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d84164d294d275e4fa5d357ce2a5846b +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} diff --git a/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Integer.shadersubgraph b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Integer.shadersubgraph new file mode 100644 index 00000000000..2a6950d2a9a --- /dev/null +++ b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Integer.shadersubgraph @@ -0,0 +1,3490 @@ +{ + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "596127c898e5439c9cb25702828a6937", + "m_Version": 2, + "m_Properties": [ + { + "m_Id": "64bed4c1d817457d9eee6dd11af4d56c" + }, + { + "m_Id": "9c9afe9c6d854d25bf0e3a296657a9ab" + }, + { + "m_Id": "20cd827e2fd74009a9902fcbcc06f7e5" + } + ], + "m_Keywords": [], + "m_Nodes": [ + { + "m_Id": "1125f4ca226b4dc691d6078dfe5b6cec" + }, + { + "m_Id": "6a6a8931be034311a6e421dc967d09e0" + }, + { + "m_Id": "e47e30d0c22e4959b91285e3e8fe462a" + }, + { + "m_Id": "f588bc734f3549348afcf45221ea9cc2" + }, + { + "m_Id": "4beabb18b20f40189983038254b372b7" + }, + { + "m_Id": "b9c86c8782de4065b41a021d380ef1c7" + }, + { + "m_Id": "ec4bdcedd2434fcfbf233020366ac713" + }, + { + "m_Id": "5e352eb98f0d4a68a8aa85a5388eb83f" + }, + { + "m_Id": "b655e93a619f4f80a3c3a7b49d191e80" + }, + { + "m_Id": "d7d11d5f2f464d7e93a1e5f8277b3db8" + }, + { + "m_Id": "33b9d1ca14594e1bbef78a99bd593c8c" + }, + { + "m_Id": "9be51aabe5c04a70a5cfb54359550de3" + }, + { + "m_Id": "000beb6d86f64e41ac9da07fdd007055" + }, + { + "m_Id": "43c99c8b9f734e90a32c0b0af88c8269" + }, + { + "m_Id": "3ff716bf38804c82898a42c026b91f21" + }, + { + "m_Id": "0a15013ce20347899d69c648889d23ee" + }, + { + "m_Id": "3dcd4b11a6c54af6a4e56107db4da139" + }, + { + "m_Id": "4cd607924d024b97a5642037e247e638" + }, + { + "m_Id": "42615aca8bcd4651bc2cee56f3055136" + }, + { + "m_Id": "2a064ed617dd44cd9562fe84197b5f5d" + }, + { + "m_Id": "62835f892f8443919d4317d1464add37" + }, + { + "m_Id": "d30df94d4b514ec1b430e07198af43c0" + }, + { + "m_Id": "a92a2903119b4415900a5c9727eb8ce8" + }, + { + "m_Id": "9ff80d49911347fd8420b3cc4427763b" + }, + { + "m_Id": "f6377eeb42a74b71a553b5a38aa1de6c" + }, + { + "m_Id": "8a0a5e4479364711bbff96b125139cca" + }, + { + "m_Id": "a5e726df342e42b4b1fd34daf7180a07" + }, + { + "m_Id": "583f9f7a54e44665a02d5700cf2b6332" + }, + { + "m_Id": "bf36031f024f403f92b03e1a6363446b" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "000beb6d86f64e41ac9da07fdd007055" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "583f9f7a54e44665a02d5700cf2b6332" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "0a15013ce20347899d69c648889d23ee" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b9c86c8782de4065b41a021d380ef1c7" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "2a064ed617dd44cd9562fe84197b5f5d" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a5e726df342e42b4b1fd34daf7180a07" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "2a064ed617dd44cd9562fe84197b5f5d" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d30df94d4b514ec1b430e07198af43c0" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "33b9d1ca14594e1bbef78a99bd593c8c" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9be51aabe5c04a70a5cfb54359550de3" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3dcd4b11a6c54af6a4e56107db4da139" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f6377eeb42a74b71a553b5a38aa1de6c" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3ff716bf38804c82898a42c026b91f21" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "1125f4ca226b4dc691d6078dfe5b6cec" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "42615aca8bcd4651bc2cee56f3055136" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "2a064ed617dd44cd9562fe84197b5f5d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "43c99c8b9f734e90a32c0b0af88c8269" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3ff716bf38804c82898a42c026b91f21" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4beabb18b20f40189983038254b372b7" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b9c86c8782de4065b41a021d380ef1c7" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4cd607924d024b97a5642037e247e638" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "bf36031f024f403f92b03e1a6363446b" + }, + "m_SlotId": 215628880 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "583f9f7a54e44665a02d5700cf2b6332" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "43c99c8b9f734e90a32c0b0af88c8269" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5e352eb98f0d4a68a8aa85a5388eb83f" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4cd607924d024b97a5642037e247e638" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "62835f892f8443919d4317d1464add37" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "2a064ed617dd44cd9562fe84197b5f5d" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "8a0a5e4479364711bbff96b125139cca" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9ff80d49911347fd8420b3cc4427763b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9be51aabe5c04a70a5cfb54359550de3" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "000beb6d86f64e41ac9da07fdd007055" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9ff80d49911347fd8420b3cc4427763b" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "62835f892f8443919d4317d1464add37" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a5e726df342e42b4b1fd34daf7180a07" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "583f9f7a54e44665a02d5700cf2b6332" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a92a2903119b4415900a5c9727eb8ce8" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "bf36031f024f403f92b03e1a6363446b" + }, + "m_SlotId": 1946843218 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b655e93a619f4f80a3c3a7b49d191e80" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0a15013ce20347899d69c648889d23ee" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b9c86c8782de4065b41a021d380ef1c7" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3dcd4b11a6c54af6a4e56107db4da139" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b9c86c8782de4065b41a021d380ef1c7" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5e352eb98f0d4a68a8aa85a5388eb83f" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b9c86c8782de4065b41a021d380ef1c7" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d7d11d5f2f464d7e93a1e5f8277b3db8" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "bf36031f024f403f92b03e1a6363446b" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "3ff716bf38804c82898a42c026b91f21" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d30df94d4b514ec1b430e07198af43c0" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a92a2903119b4415900a5c9727eb8ce8" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7d11d5f2f464d7e93a1e5f8277b3db8" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "33b9d1ca14594e1bbef78a99bd593c8c" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e47e30d0c22e4959b91285e3e8fe462a" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b9c86c8782de4065b41a021d380ef1c7" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e47e30d0c22e4959b91285e3e8fe462a" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ec4bdcedd2434fcfbf233020366ac713" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ec4bdcedd2434fcfbf233020366ac713" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b655e93a619f4f80a3c3a7b49d191e80" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f588bc734f3549348afcf45221ea9cc2" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4beabb18b20f40189983038254b372b7" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f6377eeb42a74b71a553b5a38aa1de6c" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9ff80d49911347fd8420b3cc4427763b" + }, + "m_SlotId": 1 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 2710.0, + "y": 96.00000762939453 + }, + "m_Blocks": [] + }, + "m_FragmentContext": { + "m_Position": { + "x": 2710.0, + "y": 296.0 + }, + "m_Blocks": [] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"fileID\":10210,\"guid\":\"0000000000000000e000000000000000\",\"type\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Sub Graphs", + "m_ConcretePrecision": 0, + "m_OutputNode": { + "m_Id": "1125f4ca226b4dc691d6078dfe5b6cec" + }, + "m_ActiveTargets": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.ComparisonNode", + "m_ObjectId": "000beb6d86f64e41ac9da07fdd007055", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Comparison", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 659.0000610351563, + "y": 644.0, + "width": 145.00001525878907, + "height": 137.0 + } + }, + "m_Slots": [ + { + "m_Id": "3b2024ad25ed444cacf1a83f40d734b2" + }, + { + "m_Id": "9437b1def3f1438490492390205351d9" + }, + { + "m_Id": "bad8332c75284d029ad25289bd6e60c1" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ComparisonType": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "064b93ec33c84cc0b9e7b993c8ce9d16", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector2Node", + "m_ObjectId": "0a15013ce20347899d69c648889d23ee", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Vector 2", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -488.00006103515627, + "y": 181.0, + "width": 128.0, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "dd8da4636af44f08a2ac6650c1b3f7e1" + }, + { + "m_Id": "8b77a545caea4fb0a63f26d108510c52" + }, + { + "m_Id": "c28fabbcb2ef4a0baf7b8adf8017c497" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Value": { + "x": 0.0, + "y": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0be6c7e375984b43902cdd4a77c03d05", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode", + "m_ObjectId": "1125f4ca226b4dc691d6078dfe5b6cec", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Output", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2710.0, + "y": 96.00000762939453, + "width": 95.0, + "height": 77.0 + } + }, + "m_Slots": [ + { + "m_Id": "c500dac15f1349c188cb28ce78216469" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "IsFirstSlotValid": true +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "19b17a59a67245feb003806dc4a277da", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "20cd827e2fd74009a9902fcbcc06f7e5", + "m_Guid": { + "m_GuidSerialized": "4080c0c9-8c3d-4fd1-953a-6f6a1f5e67ef" + }, + "m_Name": "DigitsToDisplay", + "m_DefaultReferenceName": "Vector1_20cd827e2fd74009a9902fcbcc06f7e5", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": 9.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "211887bac9824af6a7f52ed799a6c151", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.5, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "23d25d5f5c1343ffacccdac081c22c4e", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": -0.5, + "e01": 2.0, + "e02": 2.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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2665d991e3274418966d21530b8674cb", + "m_Id": 4, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "273ab3e7e08a46819b5f611f011bdbd0", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 2.0, + "y": 2.0, + "z": 2.0, + "w": 2.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "28023c4be4594244b37ea10764c13e32", + "m_Id": 2, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "2979074377cb441da150e4885dfbc899", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "299e124a22584916af2e2a17ce79777c", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.DivideNode", + "m_ObjectId": "2a064ed617dd44cd9562fe84197b5f5d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Divide", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 977.0000610351563, + "y": 33.000003814697269, + "width": 208.0, + "height": 301.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "49c9a940ca7c4422890b38d45b751f19" + }, + { + "m_Id": "273ab3e7e08a46819b5f611f011bdbd0" + }, + { + "m_Id": "064b93ec33c84cc0b9e7b993c8ce9d16" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "2eb601e704e4425e869691d73684e1e0", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.SubtractNode", + "m_ObjectId": "33b9d1ca14594e1bbef78a99bd593c8c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Subtract", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 135.00001525878907, + "y": 644.0, + "width": 208.00001525878907, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "e6307746c18242afab12ba037188082e" + }, + { + "m_Id": "211887bac9824af6a7f52ed799a6c151" + }, + { + "m_Id": "a37934744907423793e6418b69a13df7" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "363fe81095c349a5ae8fe305f0a5245e", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "37b9b6b73647499ba3120aebf4b6629e", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.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_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "38903ecae5ce4295b4d7b6fc2b897dec", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": -1.0, + "e01": -1.0, + "e02": 2.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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "38f068e211124541a047eeafb93bbe22", + "m_Id": 3, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "3b2024ad25ed444cacf1a83f40d734b2", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.FloorNode", + "m_ObjectId": "3dcd4b11a6c54af6a4e56107db4da139", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Floor", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -34.999977111816409, + "y": 176.00001525878907, + "width": 208.00001525878907, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "a26895baecac4717a1baa46674c9c937" + }, + { + "m_Id": "4dbdbea55f5d47cb92e190f652f1c7a7" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3f881fcd0aa54409a8a35541095f939c", + "m_Id": 1, + "m_DisplayName": "", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "3ff716bf38804c82898a42c026b91f21", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2356.0, + "y": 172.00003051757813, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "528992820fa34df7a41855b5cc78fedc" + }, + { + "m_Id": "37b9b6b73647499ba3120aebf4b6629e" + }, + { + "m_Id": "49f9a507e30648b5a9b9de4df1d84e73" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "41e9292472a24cf6a66f3c417a07543b", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 2.0, + "y": 2.0, + "z": 2.0, + "w": 2.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "42615aca8bcd4651bc2cee56f3055136", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 832.0, + "y": 22.000022888183595, + "width": 104.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "f093e55d607c480093903eef04380efb" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "9c9afe9c6d854d25bf0e3a296657a9ab" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BranchNode", + "m_ObjectId": "43c99c8b9f734e90a32c0b0af88c8269", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Branch", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2099.0, + "y": 303.99993896484377, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "44a8d3f693804077a4c1764a08f52e5d" + }, + { + "m_Id": "47d116b91a554784a5ff91bfcebfd743" + }, + { + "m_Id": "56038bd13620448fa836825b1a78d64e" + }, + { + "m_Id": "ead07e7cdbb346d599e4441f2ae0e58f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "44a8d3f693804077a4c1764a08f52e5d", + "m_Id": 0, + "m_DisplayName": "Predicate", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Predicate", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "46342cecafe64ef1a56cab4a7a1ee101", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "47d116b91a554784a5ff91bfcebfd743", + "m_Id": 1, + "m_DisplayName": "True", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "True", + "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_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "4933855a8cc6401da9538a4aaa059793", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 10.0, + "e01": 10.0, + "e02": 2.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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "49c9a940ca7c4422890b38d45b751f19", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "49f9a507e30648b5a9b9de4df1d84e73", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "4ac7f14b2e64415c87ae47e41c7cf7e4", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "4b3067b631db4f798c9ee20619370b89", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.SaturateNode", + "m_ObjectId": "4beabb18b20f40189983038254b372b7", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Saturate", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -581.0, + "y": -204.0, + "width": 208.00001525878907, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "6fb2b974ea8d4b24ae15360eff9eb9f5" + }, + { + "m_Id": "299e124a22584916af2e2a17ce79777c" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.RedirectNodeData", + "m_ObjectId": "4cd607924d024b97a5642037e247e638", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Redirect Node", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 692.0, + "y": -648.0, + "width": 55.999996185302737, + "height": 24.0 + } + }, + "m_Slots": [ + { + "m_Id": "7975b06dc2424bdc9e0d2a3b749f1e4a" + }, + { + "m_Id": "3f881fcd0aa54409a8a35541095f939c" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "4dbdbea55f5d47cb92e190f652f1c7a7", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "4e0bd7c44a2b444597e9e5ec25de3512", + "m_Id": 1, + "m_DisplayName": "Tiling", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Tiling", + "m_StageCapability": 3, + "m_Value": { + "x": 2.0, + "y": 2.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "504fbc774c3347d69aca2a30d99f50c4", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "525cc98c276f4390b5a2f76f7cc871ce", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "528992820fa34df7a41855b5cc78fedc", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "56038bd13620448fa836825b1a78d64e", + "m_Id": 2, + "m_DisplayName": "False", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "False", + "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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "58319a82fd5d4b3db8864e67890841a1", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 0.5, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.AndNode", + "m_ObjectId": "583f9f7a54e44665a02d5700cf2b6332", + "m_Group": { + "m_Id": "" + }, + "m_Name": "And", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1909.0001220703125, + "y": 481.85003662109377, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "525cc98c276f4390b5a2f76f7cc871ce" + }, + { + "m_Id": "7749f7194f2346a980f6d5160b9d1042" + }, + { + "m_Id": "e53b4d63338145eeb2833732b2c161a3" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5bfd20d8a1ed42eab3073d80014227fe", + "m_Id": 2, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.FractionNode", + "m_ObjectId": "5e352eb98f0d4a68a8aa85a5388eb83f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Fraction", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -13.999993324279786, + "y": -641.0, + "width": 207.99998474121095, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "c1b650e901b8484fb616989577357858" + }, + { + "m_Id": "46342cecafe64ef1a56cab4a7a1ee101" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "5f543760e08745d7bba72228c28d30f1", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.PowerNode", + "m_ObjectId": "62835f892f8443919d4317d1464add37", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Power", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 725.0, + "y": 99.99998474121094, + "width": 208.0, + "height": 301.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "be907b4a4909490eb27c614c082f945b" + }, + { + "m_Id": "41e9292472a24cf6a66f3c417a07543b" + }, + { + "m_Id": "0be6c7e375984b43902cdd4a77c03d05" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector2ShaderProperty", + "m_ObjectId": "64bed4c1d817457d9eee6dd11af4d56c", + "m_Guid": { + "m_GuidSerialized": "09603004-0120-45b9-8dad-231076812a11" + }, + "m_Name": "UV", + "m_DefaultReferenceName": "Vector2_64bed4c1d817457d9eee6dd11af4d56c", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "6a6a8931be034311a6e421dc967d09e0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -769.0, + "y": -271.9999694824219, + "width": 93.00000762939453, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "e904483c220f4fa2a05563bb4973e06f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "64bed4c1d817457d9eee6dd11af4d56c" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "6afb2ae88781479ba8e01bab30c54648", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6fb2b974ea8d4b24ae15360eff9eb9f5", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "7749f7194f2346a980f6d5160b9d1042", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "77d2877abd344108a09ebc3d02c796f9", + "m_Id": 0, + "m_DisplayName": "DigitsToDisplay", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "7975b06dc2424bdc9e0d2a3b749f1e4a", + "m_Id": 0, + "m_DisplayName": "", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7b3bfaf87ead4af19d57cbb4ac789c76", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.10000000149011612, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "7c2fb6bd1d7e4c36aed703e99eb012d4", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "809ab6e0914646c4994d4c5c09889858", + "m_Id": 0, + "m_DisplayName": "DigitsToDisplay", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "876b8cf5357f4d3f92f8d809485ec918", + "m_Id": 1946843218, + "m_DisplayName": "Digit", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_669bf42fd6af4466869d0fb87fbcd038", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "8a0a5e4479364711bbff96b125139cca", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 272.9999694824219, + "y": 165.99998474121095, + "width": 160.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "809ab6e0914646c4994d4c5c09889858" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "20cd827e2fd74009a9902fcbcc06f7e5" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "8b77a545caea4fb0a63f26d108510c52", + "m_Id": 2, + "m_DisplayName": "Y", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Y", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "90cceb719eb14a4f82f6f51dae5417b2", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "92b989a5037743ab91ecd02b05444555", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9437b1def3f1438490492390205351d9", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": 0.5, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.AbsoluteNode", + "m_ObjectId": "9be51aabe5c04a70a5cfb54359550de3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Absolute", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 366.0, + "y": 644.0, + "width": 208.00001525878907, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "4ac7f14b2e64415c87ae47e41c7cf7e4" + }, + { + "m_Id": "90cceb719eb14a4f82f6f51dae5417b2" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "9c9afe9c6d854d25bf0e3a296657a9ab", + "m_Guid": { + "m_GuidSerialized": "d53af356-c9ba-44c2-9439-9b6b62de21b8" + }, + "m_Name": "Value", + "m_DefaultReferenceName": "Vector1_9c9afe9c6d854d25bf0e3a296657a9ab", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": 1128745.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "9ff80d49911347fd8420b3cc4427763b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 475.0000305175781, + "y": 180.0, + "width": 208.0, + "height": 301.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "d4cb4e4a56b64dfdbe67ed308f46896a" + }, + { + "m_Id": "e51894c1de5b413aac845b7e97138478" + }, + { + "m_Id": "d2222b7613f943de95411054dff9169c" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "a26895baecac4717a1baa46674c9c937", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "a361fa0dc7a547da8b70aedc728e0a30", + "m_Id": 215628880, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector2_15291492f0bd40d889c9b12c3dec8ffe", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "a37934744907423793e6418b69a13df7", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.ComparisonNode", + "m_ObjectId": "a5e726df342e42b4b1fd34daf7180a07", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Comparison", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1334.0, + "y": 313.0, + "width": 145.00001525878907, + "height": 137.0 + } + }, + "m_Slots": [ + { + "m_Id": "b7f934ccb0a44c23af59fae74f97eaf4" + }, + { + "m_Id": "7b3bfaf87ead4af19d57cbb4ac789c76" + }, + { + "m_Id": "504fbc774c3347d69aca2a30d99f50c4" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_ComparisonType": 4 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "a82765012e1c4ab0a1f12e47eeda0bc2", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "a92a2903119b4415900a5c9727eb8ce8", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1653.0, + "y": 19.0000057220459, + "width": 208.00001525878907, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "7c2fb6bd1d7e4c36aed703e99eb012d4" + }, + { + "m_Id": "4933855a8cc6401da9538a4aaa059793" + }, + { + "m_Id": "2979074377cb441da150e4885dfbc899" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b1e0a0675d1445719b45f77d34fb08fb", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "b655e93a619f4f80a3c3a7b49d191e80", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -673.0, + "y": 247.0, + "width": 126.00000762939453, + "height": 118.00000762939453 + } + }, + "m_Slots": [ + { + "m_Id": "a82765012e1c4ab0a1f12e47eeda0bc2" + }, + { + "m_Id": "58319a82fd5d4b3db8864e67890841a1" + }, + { + "m_Id": "5f543760e08745d7bba72228c28d30f1" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b7f934ccb0a44c23af59fae74f97eaf4", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode", + "m_ObjectId": "b9c86c8782de4065b41a021d380ef1c7", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Tiling And Offset", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -303.9999694824219, + "y": 85.00001525878906, + "width": 208.00001525878907, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "6afb2ae88781479ba8e01bab30c54648" + }, + { + "m_Id": "4e0bd7c44a2b444597e9e5ec25de3512" + }, + { + "m_Id": "28023c4be4594244b37ea10764c13e32" + }, + { + "m_Id": "db609ff10fdf43a9b039f444c9772e02" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "bad8332c75284d029ad25289bd6e60c1", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "be907b4a4909490eb27c614c082f945b", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 10.0, + "y": 10.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", + "m_ObjectId": "bf36031f024f403f92b03e1a6363446b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Digit", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 2099.0, + "y": -117.99993896484375, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "a361fa0dc7a547da8b70aedc728e0a30" + }, + { + "m_Id": "876b8cf5357f4d3f92f8d809485ec918" + }, + { + "m_Id": "c56145da59bb4fef9108b6a3b189aee0" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"d84164d294d275e4fa5d357ce2a5846b\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "1ccd7855-d017-443a-aa39-c0158764f83f", + "f6aa3968-62a0-41e5-bc4a-e02f5a8142df" + ], + "m_PropertyIds": [ + 215628880, + 1946843218 + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c1b650e901b8484fb616989577357858", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "c28fabbcb2ef4a0baf7b8adf8017c497", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c500dac15f1349c188cb28ce78216469", + "m_Id": 1, + "m_DisplayName": "Number", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Number", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c56145da59bb4fef9108b6a3b189aee0", + "m_Id": 1, + "m_DisplayName": "Digit", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Digit", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d2222b7613f943de95411054dff9169c", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.FractionNode", + "m_ObjectId": "d30df94d4b514ec1b430e07198af43c0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Fraction", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 1295.0, + "y": -35.99998092651367, + "width": 208.00001525878907, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "363fe81095c349a5ae8fe305f0a5245e" + }, + { + "m_Id": "f187373df03240caaea071a67398afab" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "d46cd42db53849219f864ecb6c767427", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d4cb4e4a56b64dfdbe67ed308f46896a", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "x": 5.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_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "d7d11d5f2f464d7e93a1e5f8277b3db8", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Split", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -66.0, + "y": 620.0, + "width": 120.0, + "height": 149.0 + } + }, + "m_Slots": [ + { + "m_Id": "b1e0a0675d1445719b45f77d34fb08fb" + }, + { + "m_Id": "e09ba2b547a44dabaa0fc7a9420b82d2" + }, + { + "m_Id": "5bfd20d8a1ed42eab3073d80014227fe" + }, + { + "m_Id": "38f068e211124541a047eeafb93bbe22" + }, + { + "m_Id": "2665d991e3274418966d21530b8674cb" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "db609ff10fdf43a9b039f444c9772e02", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "dd8da4636af44f08a2ac6650c1b3f7e1", + "m_Id": 1, + "m_DisplayName": "X", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "X", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e09ba2b547a44dabaa0fc7a9420b82d2", + "m_Id": 1, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "e47e30d0c22e4959b91285e3e8fe462a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -985.0000610351563, + "y": 147.00003051757813, + "width": 160.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "77d2877abd344108a09ebc3d02c796f9" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "20cd827e2fd74009a9902fcbcc06f7e5" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e51894c1de5b413aac845b7e97138478", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "e53b4d63338145eeb2833732b2c161a3", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e6307746c18242afab12ba037188082e", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "e904483c220f4fa2a05563bb4973e06f", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "ead07e7cdbb346d599e4441f2ae0e58f", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "ec4bdcedd2434fcfbf233020366ac713", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -878.0000610351563, + "y": 248.0, + "width": 126.00000762939453, + "height": 118.00000762939453 + } + }, + "m_Slots": [ + { + "m_Id": "92b989a5037743ab91ecd02b05444555" + }, + { + "m_Id": "23d25d5f5c1343ffacccdac081c22c4e" + }, + { + "m_Id": "2eb601e704e4425e869691d73684e1e0" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f093e55d607c480093903eef04380efb", + "m_Id": 0, + "m_DisplayName": "Value", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f187373df03240caaea071a67398afab", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "f588bc734f3549348afcf45221ea9cc2", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -913.0, + "y": -204.00003051757813, + "width": 208.00001525878907, + "height": 314.0 + } + }, + "m_Slots": [ + { + "m_Id": "4b3067b631db4f798c9ee20619370b89" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "f6377eeb42a74b71a553b5a38aa1de6c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 222.99998474121095, + "y": 212.0, + "width": 208.0, + "height": 301.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "d46cd42db53849219f864ecb6c767427" + }, + { + "m_Id": "38903ecae5ce4295b4d7b6fc2b897dec" + }, + { + "m_Id": "19b17a59a67245feb003806dc4a277da" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + diff --git a/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Integer.shadersubgraph.meta b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Integer.shadersubgraph.meta new file mode 100644 index 00000000000..23434ddebc0 --- /dev/null +++ b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/Integer.shadersubgraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c049ee4319c71a64bb69f40e5fc38442 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} diff --git a/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/SubgraphTest.shadersubgraph b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/SubgraphTest.shadersubgraph new file mode 100644 index 00000000000..cebafba8bd3 --- /dev/null +++ b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/SubgraphTest.shadersubgraph @@ -0,0 +1,511 @@ +{ + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "3c1bcddb0a634ec3a975f0d14d786504", + "m_Version": 2, + "m_Properties": [ + { + "m_Id": "84041f54e2b8447c8b74c169514e3eb1" + } + ], + "m_Keywords": [], + "m_Nodes": [ + { + "m_Id": "4150cd966a8641e5978d38bcc9654977" + }, + { + "m_Id": "61dd0c1cc0e6422ab31e217315841a09" + }, + { + "m_Id": "d4538b4f83c04523bc574c34fac08176" + }, + { + "m_Id": "0160d7cb2b2e4f38978b0e5a7c542c36" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "0160d7cb2b2e4f38978b0e5a7c542c36" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4150cd966a8641e5978d38bcc9654977" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "61dd0c1cc0e6422ab31e217315841a09" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4150cd966a8641e5978d38bcc9654977" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "61dd0c1cc0e6422ab31e217315841a09" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d4538b4f83c04523bc574c34fac08176" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d4538b4f83c04523bc574c34fac08176" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4150cd966a8641e5978d38bcc9654977" + }, + "m_SlotId": 1 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Sub Graphs", + "m_ConcretePrecision": 0, + "m_OutputNode": { + "m_Id": "4150cd966a8641e5978d38bcc9654977" + }, + "m_ActiveTargets": [] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateNode", + "m_ObjectId": "0160d7cb2b2e4f38978b0e5a7c542c36", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sampler State", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -305.0, + "y": -202.0, + "width": 145.0, + "height": 140.0 + } + }, + "m_Slots": [ + { + "m_Id": "c838263a543446e1ada8cf43aedd76f3" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_filter": 2, + "m_wrap": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1ed575a103244638a3a4d4d9b79862e7", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2bdec023fe774852b65cdebc07693ff3", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode", + "m_ObjectId": "4150cd966a8641e5978d38bcc9654977", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Output", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 99.0, + "y": -112.0, + "width": 125.0, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "66a0c07e9a4b495f87414348d76f6977" + }, + { + "m_Id": "9ba0baba406c4ea09bd9600890b44dbd" + }, + { + "m_Id": "a901d2bd07e14d3893b4330f9cfa791f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "IsFirstSlotValid": true +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "54536bc9f3954207a9881ba9593ce04d", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "58f15ee032c0480883d7d64f8fa782ab", + "m_Id": 0, + "m_DisplayName": "In_Texture", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "61dd0c1cc0e6422ab31e217315841a09", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -512.0, + "y": -45.0, + "width": 138.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "58f15ee032c0480883d7d64f8fa782ab" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "84041f54e2b8447c8b74c169514e3eb1" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "66a0c07e9a4b495f87414348d76f6977", + "m_Id": 1, + "m_DisplayName": "Out_Value", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutValue", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "769dfdcd58444d91a5c9232dc60cb28d", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "84041f54e2b8447c8b74c169514e3eb1", + "m_Guid": { + "m_GuidSerialized": "513fe548-18be-4d82-be38-a661ccdc3849" + }, + "m_Name": "In_Texture", + "m_DefaultReferenceName": "Texture2D_84041f54e2b8447c8b74c169514e3eb1", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_Modifiable": true, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "9ba0baba406c4ea09bd9600890b44dbd", + "m_Id": 2, + "m_DisplayName": "Out_Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutTexture", + "m_StageCapability": 2, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "9ce051259caa425d8e6262348e493840", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "a901d2bd07e14d3893b4330f9cfa791f", + "m_Id": 3, + "m_DisplayName": "Out_SS", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutSS", + "m_StageCapability": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "b4f3005b27354b34883f897bf030985f", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c2e6ef34cdfd4b8290a86ddc9a7bb671", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "c838263a543446e1ada8cf43aedd76f3", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "d119742999c74202a164ef60e9422a88", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "d4538b4f83c04523bc574c34fac08176", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -278.0, + "y": 90.0, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "b4f3005b27354b34883f897bf030985f" + }, + { + "m_Id": "c2e6ef34cdfd4b8290a86ddc9a7bb671" + }, + { + "m_Id": "1ed575a103244638a3a4d4d9b79862e7" + }, + { + "m_Id": "2bdec023fe774852b65cdebc07693ff3" + }, + { + "m_Id": "54536bc9f3954207a9881ba9593ce04d" + }, + { + "m_Id": "769dfdcd58444d91a5c9232dc60cb28d" + }, + { + "m_Id": "d119742999c74202a164ef60e9422a88" + }, + { + "m_Id": "9ce051259caa425d8e6262348e493840" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + diff --git a/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/SubgraphTest.shadersubgraph.meta b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/SubgraphTest.shadersubgraph.meta new file mode 100644 index 00000000000..d36e5d88a0a --- /dev/null +++ b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/SubgraphTest.shadersubgraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 569ba86e116e56e42af2fa00828e80cb +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} diff --git a/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/TextureTest.shadergraph b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/TextureTest.shadergraph new file mode 100644 index 00000000000..111e5d8dcac --- /dev/null +++ b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/TextureTest.shadergraph @@ -0,0 +1,7447 @@ +{ + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "0f47876036a74ce895471ac3b2b21f04", + "m_Version": 2, + "m_Properties": [ + { + "m_Id": "7a9565a8e7e7414bab07a2958bb34036" + }, + { + "m_Id": "0074d215f44c48778ca9c4099ae6c48e" + }, + { + "m_Id": "c02b1b5156bc4a3a9e87d1b88786d252" + }, + { + "m_Id": "a89a7f023c7d45afb773c4f2c7d5ec92" + }, + { + "m_Id": "72540d8159c44cd8a7099923ccb07328" + } + ], + "m_Keywords": [], + "m_Nodes": [ + { + "m_Id": "acab2d9d153f48f59c4484d2fa2fb8d0" + }, + { + "m_Id": "3076e17cd4d2431ebb5b8e6b0f7da7c6" + }, + { + "m_Id": "db267cdafbc34fa9a5d12b3828f8f0fa" + }, + { + "m_Id": "cea5bdac25c74f3f9d33f70b82b8dbd7" + }, + { + "m_Id": "c7505edd1eba433baa975e983e2f816d" + }, + { + "m_Id": "ea5b69ced0a74143a60b4328aad208bd" + }, + { + "m_Id": "6554688f29dc427da955108e8d424081" + }, + { + "m_Id": "ea96fdd072de40c396f4f1dea1dbfd5f" + }, + { + "m_Id": "b9c04b35187b46129d408a5e5d514f43" + }, + { + "m_Id": "e0fd8383ed1546fdae3bd114e9738674" + }, + { + "m_Id": "0687c5af33034f118808ff072da764f3" + }, + { + "m_Id": "724ae962e2eb4ee5b57de5f963320fbe" + }, + { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + { + "m_Id": "3ea77bc7f34b476fa629ee5a29c8ce9d" + }, + { + "m_Id": "a81ed61e7bf94ed091c7cef6df1b4d47" + }, + { + "m_Id": "8a8c79c9d57041118d01600b34f478f3" + }, + { + "m_Id": "60ed838b816143f69f9a315ab734d0a4" + }, + { + "m_Id": "40936a6b4bc64d59a5dad9b5c0fb8436" + }, + { + "m_Id": "813391f01a194097a69da98a1cd645ab" + }, + { + "m_Id": "56b104e5292842b091590dedbaf119ba" + }, + { + "m_Id": "691bc59617dd4d7cab11f47fbd4cdfe5" + }, + { + "m_Id": "5e1e685db5a0474c9dfd42f8d276f1d2" + }, + { + "m_Id": "5380aae4fccb4ce9adbb12945eb63972" + }, + { + "m_Id": "4917e77349894b27b46536849817b8fd" + }, + { + "m_Id": "ede1f008426a40468fb36593a12f2094" + }, + { + "m_Id": "caec7a19327b42e0a9401f83a74970d5" + }, + { + "m_Id": "82607e74489f4295a9b5cbe39ec57218" + }, + { + "m_Id": "354b7b38cae24951b39d4358097beb95" + }, + { + "m_Id": "fe5663d2e4dd486f9bd983bff8732fc9" + }, + { + "m_Id": "f26c450e7b41415cb493784338d6998e" + }, + { + "m_Id": "7885226dd6d34513af9f64307d2c5ac4" + }, + { + "m_Id": "491d1399a4b14dcfbd013d1b04530be8" + }, + { + "m_Id": "824314d5960f47c0912af894b6919147" + }, + { + "m_Id": "e9448216e6b0424bb55ff81916069464" + }, + { + "m_Id": "cb65ee68a00c4a20b963e286ea69a617" + }, + { + "m_Id": "3d9fd8cd261e47d5bc079c7bf26322b9" + }, + { + "m_Id": "63527d8fd4324cfbb947050ee1aa018f" + }, + { + "m_Id": "9b9b4792cea54beab7f63e35a4f8569c" + }, + { + "m_Id": "730844cda427430f9d739ed16125b4da" + }, + { + "m_Id": "66c53902494c442283e35904148f53da" + }, + { + "m_Id": "91fc957e4bc2494b8576a08c9ad067c9" + }, + { + "m_Id": "c49105ad005a48809e249f54b185d1ff" + }, + { + "m_Id": "8a15c9a9b70b47af9b05a104b866ce1f" + }, + { + "m_Id": "4f3464b7ae1741828c0ff38f3c03f194" + }, + { + "m_Id": "941c285b125642cdb799108176943088" + }, + { + "m_Id": "93544dd93c6f47c28fc426213347c88d" + }, + { + "m_Id": "261f332bfc7842208db46b2c1edf1a40" + }, + { + "m_Id": "9891792562c1479aaded1b44a5f4220b" + }, + { + "m_Id": "807573e75437409e9e9a40aa49d37e52" + }, + { + "m_Id": "60c063fb32da48adb97406bf6de333e0" + }, + { + "m_Id": "ae8f4d03febc4053aab496a47f575cfe" + }, + { + "m_Id": "e6876df28ef6450db0feeeba571b5285" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "0687c5af33034f118808ff072da764f3" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 6 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "354b7b38cae24951b39d4358097beb95" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 11 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3d9fd8cd261e47d5bc079c7bf26322b9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "caec7a19327b42e0a9401f83a74970d5" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "3ea77bc7f34b476fa629ee5a29c8ce9d" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "40936a6b4bc64d59a5dad9b5c0fb8436" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 13 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4917e77349894b27b46536849817b8fd" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5380aae4fccb4ce9adbb12945eb63972" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "491d1399a4b14dcfbd013d1b04530be8" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "82607e74489f4295a9b5cbe39ec57218" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "491d1399a4b14dcfbd013d1b04530be8" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "caec7a19327b42e0a9401f83a74970d5" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "491d1399a4b14dcfbd013d1b04530be8" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ede1f008426a40468fb36593a12f2094" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "4f3464b7ae1741828c0ff38f3c03f194" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 18 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5380aae4fccb4ce9adbb12945eb63972" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 16 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "56b104e5292842b091590dedbaf119ba" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "40936a6b4bc64d59a5dad9b5c0fb8436" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "56b104e5292842b091590dedbaf119ba" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5e1e685db5a0474c9dfd42f8d276f1d2" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "56b104e5292842b091590dedbaf119ba" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "691bc59617dd4d7cab11f47fbd4cdfe5" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5e1e685db5a0474c9dfd42f8d276f1d2" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 15 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "60c063fb32da48adb97406bf6de333e0" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9891792562c1479aaded1b44a5f4220b" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "60c063fb32da48adb97406bf6de333e0" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ae8f4d03febc4053aab496a47f575cfe" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "60c063fb32da48adb97406bf6de333e0" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e6876df28ef6450db0feeeba571b5285" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "60ed838b816143f69f9a315ab734d0a4" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5e1e685db5a0474c9dfd42f8d276f1d2" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "60ed838b816143f69f9a315ab734d0a4" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "691bc59617dd4d7cab11f47fbd4cdfe5" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "60ed838b816143f69f9a315ab734d0a4" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a81ed61e7bf94ed091c7cef6df1b4d47" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "63527d8fd4324cfbb947050ee1aa018f" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f26c450e7b41415cb493784338d6998e" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "63527d8fd4324cfbb947050ee1aa018f" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f26c450e7b41415cb493784338d6998e" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6554688f29dc427da955108e8d424081" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "66c53902494c442283e35904148f53da" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "91fc957e4bc2494b8576a08c9ad067c9" + }, + "m_SlotId": -2021607636 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "66c53902494c442283e35904148f53da" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "730844cda427430f9d739ed16125b4da" + }, + "m_SlotId": -2021607636 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "691bc59617dd4d7cab11f47fbd4cdfe5" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 14 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "724ae962e2eb4ee5b57de5f963320fbe" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0687c5af33034f118808ff072da764f3" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7885226dd6d34513af9f64307d2c5ac4" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "82607e74489f4295a9b5cbe39ec57218" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "807573e75437409e9e9a40aa49d37e52" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ae8f4d03febc4053aab496a47f575cfe" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "813391f01a194097a69da98a1cd645ab" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "40936a6b4bc64d59a5dad9b5c0fb8436" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "813391f01a194097a69da98a1cd645ab" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "40936a6b4bc64d59a5dad9b5c0fb8436" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "824314d5960f47c0912af894b6919147" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "491d1399a4b14dcfbd013d1b04530be8" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "82607e74489f4295a9b5cbe39ec57218" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 7 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "8a15c9a9b70b47af9b05a104b866ce1f" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 17 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "8a8c79c9d57041118d01600b34f478f3" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "a81ed61e7bf94ed091c7cef6df1b4d47" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "cea5bdac25c74f3f9d33f70b82b8dbd7" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "91fc957e4bc2494b8576a08c9ad067c9" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8a15c9a9b70b47af9b05a104b866ce1f" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "93544dd93c6f47c28fc426213347c88d" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4f3464b7ae1741828c0ff38f3c03f194" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "941c285b125642cdb799108176943088" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "93544dd93c6f47c28fc426213347c88d" + }, + "m_SlotId": -2021607636 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "941c285b125642cdb799108176943088" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "261f332bfc7842208db46b2c1edf1a40" + }, + "m_SlotId": -2021607636 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9891792562c1479aaded1b44a5f4220b" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e6876df28ef6450db0feeeba571b5285" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "9b9b4792cea54beab7f63e35a4f8569c" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "caec7a19327b42e0a9401f83a74970d5" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a81ed61e7bf94ed091c7cef6df1b4d47" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 12 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ae8f4d03febc4053aab496a47f575cfe" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "9891792562c1479aaded1b44a5f4220b" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ae8f4d03febc4053aab496a47f575cfe" + }, + "m_SlotId": 4 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e6876df28ef6450db0feeeba571b5285" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b9c04b35187b46129d408a5e5d514f43" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c49105ad005a48809e249f54b185d1ff" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8a15c9a9b70b47af9b05a104b866ce1f" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c7505edd1eba433baa975e983e2f816d" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ea96fdd072de40c396f4f1dea1dbfd5f" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "caec7a19327b42e0a9401f83a74970d5" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 9 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "cb65ee68a00c4a20b963e286ea69a617" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ede1f008426a40468fb36593a12f2094" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e0fd8383ed1546fdae3bd114e9738674" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 5 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e6876df28ef6450db0feeeba571b5285" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "4f3464b7ae1741828c0ff38f3c03f194" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e9448216e6b0424bb55ff81916069464" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ede1f008426a40468fb36593a12f2094" + }, + "m_SlotId": 3 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ea5b69ced0a74143a60b4328aad208bd" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6554688f29dc427da955108e8d424081" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ea96fdd072de40c396f4f1dea1dbfd5f" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 4 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ede1f008426a40468fb36593a12f2094" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 8 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f26c450e7b41415cb493784338d6998e" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "8f3cb5fb034b47b68ec2dbe8a92070e5" + }, + "m_SlotId": 10 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "fe5663d2e4dd486f9bd983bff8732fc9" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "354b7b38cae24951b39d4358097beb95" + }, + "m_SlotId": 1 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 1316.0001220703125, + "y": 352.99993896484377 + }, + "m_Blocks": [ + { + "m_Id": "acab2d9d153f48f59c4484d2fa2fb8d0" + }, + { + "m_Id": "3076e17cd4d2431ebb5b8e6b0f7da7c6" + }, + { + "m_Id": "db267cdafbc34fa9a5d12b3828f8f0fa" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 1316.0001220703125, + "y": 553.0 + }, + "m_Blocks": [ + { + "m_Id": "cea5bdac25c74f3f9d33f70b82b8dbd7" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"fileID\":10210,\"guid\":\"0000000000000000e000000000000000\",\"type\":0}}", + "m_Guid": "" + } + }, + "m_Path": "Shader Graphs", + "m_ConcretePrecision": 0, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "1c897c13bf6a46898006ec62ee633730" + } + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "0074d215f44c48778ca9c4099ae6c48e", + "m_Guid": { + "m_GuidSerialized": "016f128b-9ea6-43ad-8ff3-86aa5bd516e9" + }, + "m_Name": "TexProp2", + "m_DefaultReferenceName": "Texture2D_0074d215f44c48778ca9c4099ae6c48e", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_Modifiable": true, + "m_DefaultType": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "01ad754e21d743ea9d2e13a4140e71bf", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "044ff6cc2a614bd29b32121a3e82bc07", + "m_Id": 2, + "m_DisplayName": "sum", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "sum", + "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_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "05120c562e264abab67d0d22b1b1d314", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "060cb660e1954ca79825f5e299a7e7d7", + "m_Id": -2021607636, + "m_DisplayName": "Value", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_9c9afe9c6d854d25bf0e3a296657a9ab", + "m_StageCapability": 2, + "m_Value": 1128745.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "0642a99f6f43448d9a0e9f77bcd5724e", + "m_Id": 0, + "m_DisplayName": "tex", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "tex", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"53ee4b410c7f7564b8fd0ff023cfc560\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "067fcf2b26a847bd897b036423643ad9", + "m_Id": -2021607636, + "m_DisplayName": "Value", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_9c9afe9c6d854d25bf0e3a296657a9ab", + "m_StageCapability": 2, + "m_Value": 1128745.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "0687c5af33034f118808ff072da764f3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1784.00048828125, + "y": -1345.0, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "f142c2ead76d432d8e32171a429ba1e6" + }, + { + "m_Id": "01ad754e21d743ea9d2e13a4140e71bf" + }, + { + "m_Id": "b04c4467cce64164b632ba6705db8443" + }, + { + "m_Id": "f86324b498ea4fe4adbc98f88e118dd8" + }, + { + "m_Id": "91d9ff024ed349d09521a802d2e18e71" + }, + { + "m_Id": "29acfbef1e2b482aad351da2b31b8c08" + }, + { + "m_Id": "61a3ed97a4084af691482d5c5f5a48ed" + }, + { + "m_Id": "eb654aa0d10e44b2aba68e62e4d1389f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "085c6ed232924665b0dde113da304648", + "m_Id": 1, + "m_DisplayName": "ss", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "ss", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "0a059d9c5fb34360b563ea3b4788e360", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "0afb2c4042ae4ac6930b75cb9078f8b8", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "0b51e82f30c44f14816bacff5e5728be" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "0bb77a408d5d4300b56b0ab64ea1e943", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "0d17a7143d404d3fa3b61f288bdc9108", + "m_Id": 0, + "m_DisplayName": "TexProp", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "0d80c4e852d94fb2af67eaa1da31c3a3", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "0ef14e3ac55c45e9943d2db1ade8cee0", + "m_Id": 0, + "m_DisplayName": "TexProp4", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "0fbd3c28e13b4e8881a3a4e3de8533b8", + "m_Id": -276715389, + "m_DisplayName": "In_Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture2D_84041f54e2b8447c8b74c169514e3eb1", + "m_StageCapability": 2, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"53ee4b410c7f7564b8fd0ff023cfc560\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "0ff74c892c7f4238bcecdcd41cdd317b", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "18a626982a3b491d932c6327a8a8e07a", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "19d041c8f162432fa3d55381cc31b7db", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"4178de12098ce6e4da6ff9f539f2cd9f\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "1a1e94e268c145bcbd932d67f75167ee", + "m_Id": 0, + "m_DisplayName": "tex", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "tex", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"4ea79c9c5cb5bf344a4c46bd8e87b35f\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "1b0a85f2f0354964a546ecc60200b00d", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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": [ + "X", + "Y", + "Z" + ], + "m_Space": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1b57b612521b4428aa9dd8ae29c4a484", + "m_Id": -1547857929, + "m_DisplayName": "DigitsToDisplay", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_20cd827e2fd74009a9902fcbcc06f7e5", + "m_StageCapability": 2, + "m_Value": 5.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1bc358c7310844eea81532001e0d031e", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1bfb245535fd476ea918b1da01c65a1c", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1c4ce73ef2174a03bfcbc80dbbb7c3eb", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "1c897c13bf6a46898006ec62ee633730", + "m_ActiveSubTarget": { + "m_Id": "0b51e82f30c44f14816bacff5e5728be" + }, + "m_SurfaceType": 0, + "m_AlphaMode": 0, + "m_TwoSided": false, + "m_AlphaClip": false, + "m_CustomEditorGUI": "" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "1f4a2f7f5eb24ee4b3a8976f19a7674c", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "214506e1e25d47c8a6f49945732f1314", + "m_Id": 2, + "m_DisplayName": "Height", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Height", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "21f386ad0e3e4c94a2075a84222a966a", + "m_Id": 17, + "m_DisplayName": "p", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "p", + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "22815522b1d444cbb1f8ebeb144966e7", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "22ed0257ea9d4d06a21909a28706e9fe", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "245d0244bb89411aaa06482450599c82", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2568bd86e2574f1ebe21f2c33271172d", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "261047da8e1e48bc9b12b9cde7dd539c", + "m_Id": 1, + "m_DisplayName": "Number", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Number", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", + "m_ObjectId": "261f332bfc7842208db46b2c1edf1a40", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integer", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5017.0, + "y": 2050.999755859375, + "width": 226.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "e49794f2b3b14147a5ebc2c28e700200" + }, + { + "m_Id": "65f3b1a4da3840948c05402e13dcc057" + }, + { + "m_Id": "e1919580870a4be980173c83d77f22a0" + }, + { + "m_Id": "78346d54f8d149ac8864ffcf7b1bfc50" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"c049ee4319c71a64bb69f40e5fc38442\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "09603004-0120-45b9-8dad-231076812a11", + "d53af356-c9ba-44c2-9439-9b6b62de21b8", + "4080c0c9-8c3d-4fd1-953a-6f6a1f5e67ef" + ], + "m_PropertyIds": [ + 725644716, + -2021607636, + -1547857929 + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "267230747f84453299097c0aea7f01a1", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "27e7c9db101a452c8bb5d435a49e0e82", + "m_Id": 1, + "m_DisplayName": "b", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "29564e6d367a41f0b8f0170351bc8967", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "29acfbef1e2b482aad351da2b31b8c08", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "2c889cc263eb4e9283276ddf10e6a6c7", + "m_Id": 2, + "m_DisplayName": "val", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "val", + "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_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "2d8b0dc36c7f4c90b5425c46cc2ede41", + "m_Id": 2, + "m_DisplayName": "Out_Texture", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutTexture", + "m_StageCapability": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "2e709603c5764e44b02008fee39ca327", + "m_Id": 9, + "m_DisplayName": "h", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "h", + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "2f38fc02b5954d759a14806f7fc9acb6", + "m_Id": 2, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "2fc7c0b401fe4f1abe968b11cb30c13a", + "m_Id": 19, + "m_DisplayName": "r", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "r", + "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_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "30683976e6a64a269fe47ffb4def2e45", + "m_Id": 2, + "m_DisplayName": "Out_Texture", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutTexture", + "m_StageCapability": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "3076e17cd4d2431ebb5b8e6b0f7da7c6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_NodeVersion": 0, + "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": "c170fb3d08104a7f845b9d88e809e81a" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "332222d33134457597f4aeec2abfaa63", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "354b7b38cae24951b39d4358097beb95", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3243.000244140625, + "y": 404.000244140625, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "7167705df2f240d4a25bac2e93bbac0f" + }, + { + "m_Id": "aa1dabd12e5b4da186dc0fbcbac9e60b" + }, + { + "m_Id": "1bc358c7310844eea81532001e0d031e" + }, + { + "m_Id": "a9ccee6ffb744389a5a3cddb4448557a" + }, + { + "m_Id": "d78a6deefe774280b2fbb88e9fb542cf" + }, + { + "m_Id": "22ed0257ea9d4d06a21909a28706e9fe" + }, + { + "m_Id": "f0516f491b5748c88d544196379f9b59" + }, + { + "m_Id": "7602e8e5c1e847ba92691ec35acb9aa4" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "3590e4a8252e448e88c4f6e788360b72", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"4178de12098ce6e4da6ff9f539f2cd9f\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "35c01b319a75438982ba05f147c6f868", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "3822557e83874824b72d93294071d802", + "m_Id": -276715389, + "m_DisplayName": "In_Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture2D_84041f54e2b8447c8b74c169514e3eb1", + "m_StageCapability": 2, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"53ee4b410c7f7564b8fd0ff023cfc560\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "38cf92fe3b8b4c8cb263b21cc69ce7c3", + "m_Id": 1, + "m_DisplayName": "ss", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "ss", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "3abb0f524e6647bbb2a6ac72050a8ea1", + "m_Id": 2, + "m_DisplayName": "val", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "val", + "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_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "3afb2f984b7344139405c2d597ccc4a2", + "m_Id": 0, + "m_DisplayName": "TexProp2", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "3b9d27355ac54017abc715c56d696a1c", + "m_Id": 6, + "m_DisplayName": "e", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "e", + "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_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3c2bef4199b94be79e75d107894fedc8", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "3cfa5d790823465081ee456f4154c86f", + "m_Id": 10, + "m_DisplayName": "i", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "i", + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "3d632357e3dc43d0a0a8fcd11f7fade8", + "m_Id": 1, + "m_DisplayName": "Out_Value", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutValue", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "3d9fd8cd261e47d5bc079c7bf26322b9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3558.000244140625, + "y": -470.9999694824219, + "width": 136.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "0ef14e3ac55c45e9943d2db1ade8cee0" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "a89a7f023c7d45afb773c4f2c7d5ec92" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "3ea77bc7f34b476fa629ee5a29c8ce9d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 568.9999389648438, + "y": -102.00001525878906, + "width": 208.0, + "height": 314.0 + } + }, + "m_Slots": [ + { + "m_Id": "6125ca52b75949ef8a01d298b1b20af4" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "3f85c51a79ab4969877b46a525493a6b", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "40936a6b4bc64d59a5dad9b5c0fb8436", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1679.9998779296875, + "y": 2522.999755859375, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "0642a99f6f43448d9a0e9f77bcd5724e" + }, + { + "m_Id": "fdffdaa86a8c453391b350f45d04e91d" + }, + { + "m_Id": "af3414cd4f394ddea4c708c3b979012d" + }, + { + "m_Id": "956fd26705474c3b98d3d229f12070c9" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "Tex2DLOD", + "m_FunctionSource": "", + "m_FunctionBody": "val = SAMPLE_TEXTURE2D_LOD(tex, ss, uv, 0.5);" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "41d5f08b27c142398c06d8748ce423bd", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "44439053f87a405d8d00166c4101741d", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "46f6991da7d1434f8dc3dbda10033be1", + "m_Id": 0, + "m_DisplayName": "tex", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "tex", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"940df6ba508f64540a3ffd2c5c43c91a\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "471d0ca0c9c7450cb8ec5a80d7fb1d92", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "4782b963c27e4af981efabe6b5148f76", + "m_Id": 2, + "m_DisplayName": "Out_Texture", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutTexture", + "m_StageCapability": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "4917e77349894b27b46536849817b8fd", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2289.0, + "y": 3613.0, + "width": 208.00001525878907, + "height": 314.0 + } + }, + "m_Slots": [ + { + "m_Id": "8a1600fd82cf46fdb6286d8d05825ea8" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.RotateNode", + "m_ObjectId": "491d1399a4b14dcfbd013d1b04530be8", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Rotate", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3800.0, + "y": -1270.0001220703125, + "width": 208.0, + "height": 362.0 + } + }, + "m_Slots": [ + { + "m_Id": "70878a25d5f446eb87f0708e1ce2cfcf" + }, + { + "m_Id": "dd8d4237b4134bcd94a91708fa1eee3b" + }, + { + "m_Id": "ee4db98456324bfb8bad846d9a839687" + }, + { + "m_Id": "e91c0f02662a41dab19a559ad1302dbd" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Unit": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "4cf0f29d6e824e12bc2cc455f8aaeee3", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "4d5285e9f2ea47b888daf92360bc1180", + "m_Id": 3, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "4f169500586c4adba0e4d30f43a2f6a7", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "4f3464b7ae1741828c0ff38f3c03f194", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -4618.0, + "y": 1899.9998779296875, + "width": 207.99998474121095, + "height": 301.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "7083b612f8264953816fb8aecaa123b5" + }, + { + "m_Id": "4cf0f29d6e824e12bc2cc455f8aaeee3" + }, + { + "m_Id": "baf58eeb67af4b2cb85a29ff9ebafdde" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "4f3a879a6cab4dfe88d8c29f57590e2d", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "4f40c13bf7a045d6826e1f5e23864802", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "535e3598a0d5463b82b03c8d1a4d36ce", + "m_Id": -276715389, + "m_DisplayName": "In_Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture2D_84041f54e2b8447c8b74c169514e3eb1", + "m_StageCapability": 2, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"940df6ba508f64540a3ffd2c5c43c91a\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "5380aae4fccb4ce9adbb12945eb63972", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1679.9998779296875, + "y": 3581.999755859375, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "af646132d4044f39bebbce1d2fafc431" + }, + { + "m_Id": "f58c9d662e9540948f9eb2bd0de5bcae" + }, + { + "m_Id": "6e138f58538e4c2fa81048fcad2b7d5a" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "Tex2DLoad", + "m_FunctionSource": "", + "m_FunctionBody": "val = LOAD_TEXTURE2D_LOD(tex, uv * 22.0, 0);" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "558ebbc71e35495cb392fd491784b12f", + "m_Id": 7, + "m_DisplayName": "f", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "f", + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "5601f2e943a74d6b8003de209301e095", + "m_Id": 1, + "m_DisplayName": "Out_Value", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutValue", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode", + "m_ObjectId": "56b104e5292842b091590dedbaf119ba", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Tiling And Offset", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2288.999755859375, + "y": 2823.0, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "35c01b319a75438982ba05f147c6f868" + }, + { + "m_Id": "d81ce6759bca481ca18ed80dd1bc5ecc" + }, + { + "m_Id": "8d9795c7ef1848e389c4b8897b34870f" + }, + { + "m_Id": "cf9dd538ef6448ff8e5610fd3a7b5a5c" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "57b2bc7461bd4505a815e9115effb560", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "57d42b72772b48fc80596f9593ebdaa3", + "m_Id": 8, + "m_DisplayName": "g", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "g", + "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_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "5b255844b9dd43a7ae77027e462ed454", + "m_Id": 1, + "m_DisplayName": "ss", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "ss", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "5be239bcb3d94f80a81c8be071b3f221", + "m_Id": 3, + "m_DisplayName": "Out_SS", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutSS", + "m_StageCapability": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "5c1b1325f4d6462d9c19049cdb691747", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "5d0918d66a45421292eb7c52206e366d", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "5e1e685db5a0474c9dfd42f8d276f1d2", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1679.9998779296875, + "y": 3174.999755859375, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "8371e151d6444c4b9e9008a13b92c69a" + }, + { + "m_Id": "e7b8db27fc9448b38e335a51340f90b8" + }, + { + "m_Id": "d636885d376a4406b962b31b352f09c6" + }, + { + "m_Id": "4d5285e9f2ea47b888daf92360bc1180" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "Tex2DGrad", + "m_FunctionSource": "", + "m_FunctionBody": "float dx = 0.1f;\nfloat dy = 0.1f;\nval = SAMPLE_TEXTURE2D_GRAD(tex, ss, uv, dx, dy);" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5f85608e1a3d41418963f6262daa1aaf", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "602a9132601e482da39ab29055bbb994", + "m_Id": 1, + "m_DisplayName": "ss", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "ss", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "603de55702114fbdad4163747d77c879", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "6060922599754648b9fd9721bf0b755f", + "m_Id": 0, + "m_DisplayName": "Width", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Width", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode", + "m_ObjectId": "60c063fb32da48adb97406bf6de333e0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Tiling And Offset", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -6672.0, + "y": 2039.0001220703125, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "a47e1275981b4ddabb0f24f9650112ba" + }, + { + "m_Id": "9170778083264a76ae7cebcc0a632da5" + }, + { + "m_Id": "79fab705a0c843c599d54ad2f4047c03" + }, + { + "m_Id": "0afb2c4042ae4ac6930b75cb9078f8b8" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateNode", + "m_ObjectId": "60ed838b816143f69f9a315ab734d0a4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sampler State", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2226.0, + "y": 2101.99951171875, + "width": 144.99998474121095, + "height": 140.0 + } + }, + "m_Slots": [ + { + "m_Id": "4f169500586c4adba0e4d30f43a2f6a7" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_filter": 1, + "m_wrap": 1 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "6125ca52b75949ef8a01d298b1b20af4", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "61a3ed97a4084af691482d5c5f5a48ed", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "623209ac56ee47adacb83ae6899bf730", + "m_Id": -1547857929, + "m_DisplayName": "DigitsToDisplay", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_20cd827e2fd74009a9902fcbcc06f7e5", + "m_StageCapability": 2, + "m_Value": 5.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", + "m_ObjectId": "63527d8fd4324cfbb947050ee1aa018f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SubgraphTest", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3870.000244140625, + "y": 46.000030517578128, + "width": 234.00001525878907, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "3d632357e3dc43d0a0a8fcd11f7fade8" + }, + { + "m_Id": "535e3598a0d5463b82b03c8d1a4d36ce" + }, + { + "m_Id": "30683976e6a64a269fe47ffb4def2e45" + }, + { + "m_Id": "fe8914b4252444c7a66fcf0775dd22fb" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"569ba86e116e56e42af2fa00828e80cb\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "513fe548-18be-4d82-be38-a661ccdc3849" + ], + "m_PropertyIds": [ + -276715389 + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "6554688f29dc427da955108e8d424081", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1784.00048828125, + "y": -2657.0, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "603de55702114fbdad4163747d77c879" + }, + { + "m_Id": "41d5f08b27c142398c06d8748ce423bd" + }, + { + "m_Id": "1bfb245535fd476ea918b1da01c65a1c" + }, + { + "m_Id": "d86758c7656243a7af3fb133713e8830" + }, + { + "m_Id": "9ff714ee327044ec872000552543ac9b" + }, + { + "m_Id": "29564e6d367a41f0b8f0170351bc8967" + }, + { + "m_Id": "d704f6be9f404b5d8a467557017151fc" + }, + { + "m_Id": "fc60743724754dba8e13131adb9f3b93" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "65f3b1a4da3840948c05402e13dcc057", + "m_Id": -2021607636, + "m_DisplayName": "Value", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_9c9afe9c6d854d25bf0e3a296657a9ab", + "m_StageCapability": 2, + "m_Value": 1128745.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DPropertiesNode", + "m_ObjectId": "66c53902494c442283e35904148f53da", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Texel Size", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5477.99951171875, + "y": 1036.999755859375, + "width": 184.0, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "6e195e642d454be485fe58ff0be58e0f" + }, + { + "m_Id": "214506e1e25d47c8a6f49945732f1314" + }, + { + "m_Id": "b627d18bd78d474080b13ad3bf988df2" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "67abaa59ecf3402b90def22611fa739a", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "680470d1ba734df686008717a80be6c0", + "m_Id": 4, + "m_DisplayName": "c", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "c", + "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_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "691bc59617dd4d7cab11f47fbd4cdfe5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1680.0, + "y": 2849.000244140625, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "46f6991da7d1434f8dc3dbda10033be1" + }, + { + "m_Id": "085c6ed232924665b0dde113da304648" + }, + { + "m_Id": "cea379d7a3e242ad860b54a19e07efaf" + }, + { + "m_Id": "9001d514f64e4d7681371d593d115135" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "Tex2DBias", + "m_FunctionSource": "", + "m_FunctionBody": "val = SAMPLE_TEXTURE2D_BIAS(tex, ss, uv, 3.0);" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "6e138f58538e4c2fa81048fcad2b7d5a", + "m_Id": 3, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "6e195e642d454be485fe58ff0be58e0f", + "m_Id": 0, + "m_DisplayName": "Width", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Width", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7065410b2a664a4cb8cce8bade453fd0", + "m_Id": 1, + "m_DisplayName": "Number", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Number", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "7083b612f8264953816fb8aecaa123b5", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "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_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "70878a25d5f446eb87f0708e1ce2cfcf", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "7167705df2f240d4a25bac2e93bbac0f", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Texture2DAssetNode", + "m_ObjectId": "724ae962e2eb4ee5b57de5f963320fbe", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Texture 2D Asset", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2077.999755859375, + "y": -1345.0, + "width": 143.0, + "height": 106.0 + } + }, + "m_Slots": [ + { + "m_Id": "aa31be6ea6fd497486fcae3de8795251" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"d2be28188f7455b4bbef6bda86eb7410\",\"type\":3}}", + "m_Guid": "" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateShaderProperty", + "m_ObjectId": "72540d8159c44cd8a7099923ccb07328", + "m_Guid": { + "m_GuidSerialized": "98a93bbf-32e6-4fe2-99e3-5151d0d1608a" + }, + "m_Name": "SSProp", + "m_DefaultReferenceName": "", + "m_OverrideReferenceName": "SamplerState_Point_MirrorOnce", + "m_GeneratePropertyBlock": false, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "m_filter": 1, + "m_wrap": 3 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", + "m_ObjectId": "730844cda427430f9d739ed16125b4da", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integer", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5017.0, + "y": 1200.999755859375, + "width": 225.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "914dcfd207294aacb39dbe3cc00148d3" + }, + { + "m_Id": "067fcf2b26a847bd897b036423643ad9" + }, + { + "m_Id": "623209ac56ee47adacb83ae6899bf730" + }, + { + "m_Id": "7065410b2a664a4cb8cce8bade453fd0" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"c049ee4319c71a64bb69f40e5fc38442\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "09603004-0120-45b9-8dad-231076812a11", + "d53af356-c9ba-44c2-9439-9b6b62de21b8", + "4080c0c9-8c3d-4fd1-953a-6f6a1f5e67ef" + ], + "m_PropertyIds": [ + 725644716, + -2021607636, + -1547857929 + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "74d48b07913446e9b2f799ac25cfb093", + "m_Id": 2, + "m_DisplayName": "val", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "val", + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "752935ebc93f4803b51ac9f28d27b025", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "7602e8e5c1e847ba92691ec35acb9aa4", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "78346d54f8d149ac8864ffcf7b1bfc50", + "m_Id": 1, + "m_DisplayName": "Number", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Number", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "7885226dd6d34513af9f64307d2c5ac4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3468.000244140625, + "y": -1195.0001220703125, + "width": 114.00000762939453, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "7a7617ed8b8647929fbe8622fd4d97e7" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "72540d8159c44cd8a7099923ccb07328" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "78e6199cbca849cda4b34e94690aa926", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "79e8f3e9c1e343e6a7d93420c76f5715", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "79fab705a0c843c599d54ad2f4047c03", + "m_Id": 2, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": 0.25, + "y": 0.25 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7a4107081b544d3e9d3595f54bcf824b", + "m_Id": -1547857929, + "m_DisplayName": "DigitsToDisplay", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_20cd827e2fd74009a9902fcbcc06f7e5", + "m_StageCapability": 2, + "m_Value": 5.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "7a7617ed8b8647929fbe8622fd4d97e7", + "m_Id": 0, + "m_DisplayName": "SSProp", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "7a9565a8e7e7414bab07a2958bb34036", + "m_Guid": { + "m_GuidSerialized": "315b75e7-e4fa-42e7-9ab9-8bf32b42d5c7" + }, + "m_Name": "TexProp", + "m_DefaultReferenceName": "Texture2D_7a9565a8e7e7414bab07a2958bb34036", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_Modifiable": true, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "7f702c6542064ca2886ccb9e8c4283ae", + "m_Id": 12, + "m_DisplayName": "k", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "k", + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7ff3b84a327c4f6181d6101854b507a8", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateNode", + "m_ObjectId": "807573e75437409e9e9a40aa49d37e52", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sampler State", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -6567.99951171875, + "y": 1848.0, + "width": 145.0, + "height": 140.0 + } + }, + "m_Slots": [ + { + "m_Id": "5c1b1325f4d6462d9c19049cdb691747" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_filter": 1, + "m_wrap": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "8114ffee059f47b6b5b5bc735e5eb408", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", + "m_ObjectId": "813391f01a194097a69da98a1cd645ab", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SubgraphTest", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2664.0, + "y": 2550.999755859375, + "width": 233.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "a09c91cd5477486aba85a57d1d1c51a9" + }, + { + "m_Id": "0fbd3c28e13b4e8881a3a4e3de8533b8" + }, + { + "m_Id": "2d8b0dc36c7f4c90b5425c46cc2ede41" + }, + { + "m_Id": "5be239bcb3d94f80a81c8be071b3f221" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"569ba86e116e56e42af2fa00828e80cb\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "513fe548-18be-4d82-be38-a661ccdc3849" + ], + "m_PropertyIds": [ + -276715389 + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "820b1e75d33943a1ae10b6ab452b5376", + "m_Id": 11, + "m_DisplayName": "j", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "j", + "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_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode", + "m_ObjectId": "824314d5960f47c0912af894b6919147", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Tiling And Offset", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -4112.4501953125, + "y": -1361.4500732421875, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "8540421be52d4ed5b7909306157691e8" + }, + { + "m_Id": "cc9c41e9c7c2468294ad9f5920a954c5" + }, + { + "m_Id": "2f38fc02b5954d759a14806f7fc9acb6" + }, + { + "m_Id": "971ef80ad730496bb317779849a06969" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "82607e74489f4295a9b5cbe39ec57218", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3243.000244140625, + "y": -1345.0, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "4f3a879a6cab4dfe88d8c29f57590e2d" + }, + { + "m_Id": "1c4ce73ef2174a03bfcbc80dbbb7c3eb" + }, + { + "m_Id": "862a2d199451424cb7fa3f3883bd3da4" + }, + { + "m_Id": "a2723f0a13834bca8c44be2eeba63952" + }, + { + "m_Id": "44439053f87a405d8d00166c4101741d" + }, + { + "m_Id": "3590e4a8252e448e88c4f6e788360b72" + }, + { + "m_Id": "e992ba014b264c81aec1315ac0afda91" + }, + { + "m_Id": "8efe8f76f7cc4ef79c484816aa0d00cb" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "82839c67d29743499e599214ae499867", + "m_Id": 725644716, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector2_64bed4c1d817457d9eee6dd11af4d56c", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "8371e151d6444c4b9e9008a13b92c69a", + "m_Id": 0, + "m_DisplayName": "tex", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "tex", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"4ea79c9c5cb5bf344a4c46bd8e87b35f\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "8540421be52d4ed5b7909306157691e8", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "862a2d199451424cb7fa3f3883bd3da4", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "895bb44fd4bd40189886a9cae4166ad7", + "m_Id": 3, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "896f74c0fca6482c94b717cc2bdb894d", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.AddNode", + "m_ObjectId": "8a15c9a9b70b47af9b05a104b866ce1f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Add", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -4618.0, + "y": 1049.999755859375, + "width": 207.99998474121095, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "267230747f84453299097c0aea7f01a1" + }, + { + "m_Id": "3c2bef4199b94be79e75d107894fedc8" + }, + { + "m_Id": "8ee2a2d721a7490a80a01770e8e6373b" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "8a1600fd82cf46fdb6286d8d05825ea8", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "8a8c79c9d57041118d01600b34f478f3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2288.999755859375, + "y": 2256.999755859375, + "width": 207.99998474121095, + "height": 313.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "22815522b1d444cbb1f8ebeb144966e7" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "8d560493d65d400eb337d5f3c55b4a04", + "m_Id": 15, + "m_DisplayName": "n", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "n", + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "8d9795c7ef1848e389c4b8897b34870f", + "m_Id": 2, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8ee2a2d721a7490a80a01770e8e6373b", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "8efe8f76f7cc4ef79c484816aa0d00cb", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "8f3cb5fb034b47b68ec2dbe8a92070e5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 879.0, + "y": 490.99993896484377, + "width": 208.0, + "height": 662.0 + } + }, + "m_Slots": [ + { + "m_Id": "044ff6cc2a614bd29b32121a3e82bc07" + }, + { + "m_Id": "895bb44fd4bd40189886a9cae4166ad7" + }, + { + "m_Id": "f49b0ec515774034b6770e521c13d2cb" + }, + { + "m_Id": "27e7c9db101a452c8bb5d435a49e0e82" + }, + { + "m_Id": "680470d1ba734df686008717a80be6c0" + }, + { + "m_Id": "94b15ba6b40146d1a55dead76d1ff52e" + }, + { + "m_Id": "3b9d27355ac54017abc715c56d696a1c" + }, + { + "m_Id": "558ebbc71e35495cb392fd491784b12f" + }, + { + "m_Id": "57d42b72772b48fc80596f9593ebdaa3" + }, + { + "m_Id": "2e709603c5764e44b02008fee39ca327" + }, + { + "m_Id": "3cfa5d790823465081ee456f4154c86f" + }, + { + "m_Id": "820b1e75d33943a1ae10b6ab452b5376" + }, + { + "m_Id": "7f702c6542064ca2886ccb9e8c4283ae" + }, + { + "m_Id": "91b31de8014b494fb1fa92d45f12aa8b" + }, + { + "m_Id": "9f61b6e7eebb4a97ac9d5a04ab101613" + }, + { + "m_Id": "8d560493d65d400eb337d5f3c55b4a04" + }, + { + "m_Id": "bb1f5c452a9c4e0aa99d21f55142e08a" + }, + { + "m_Id": "21f386ad0e3e4c94a2075a84222a966a" + }, + { + "m_Id": "f533055efba44dc7b67de10ac38ea884" + }, + { + "m_Id": "2fc7c0b401fe4f1abe968b11cb30c13a" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "MySum", + "m_FunctionSource": "", + "m_FunctionBody": "sum = 0.0f;\n\nsum.rgb += frac(a * uv.x * 1.1f);\nsum.rgb += frac(b * uv.y * 1.2f);\nsum.rgb += frac(c * uv.x * 1.3f);\n\nsum.rgb += frac(d * uv.x * 1.4f);\nsum.rgb += frac(e * uv.y * 1.5f);\nsum.rgb += frac(f * uv.x * 1.6f);\n\nsum.rgb += frac(g * uv.x * 1.7f);\nsum.rgb += frac(h * uv.y * 1.8f);\nsum.rgb += frac(i * uv.x * 1.9f);\n\nsum.rgb += frac(j * uv.x * 2.05f);\nsum.rgb += frac(k * uv.y * 2.15f);\nsum.rgb += frac(l * uv.x * 2.25f);\n\nsum.rgb += frac(m * uv.x * 2.35f);\nsum.rgb += frac(n * uv.y * 2.45f);\nsum.rgb += frac(o * uv.y * 2.55f);\n\nsum.rgb += frac(p * uv.x * 2.65f);\nsum.rgb += frac(q * uv.y * 2.75f);\nsum.rgb += frac(r * uv.y * 2.85f);\n\nsum = frac(sum);\n" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "9001d514f64e4d7681371d593d115135", + "m_Id": 3, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "905acf3a9bb04519a7649e25f4bc3b98", + "m_Id": 3, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "914dcfd207294aacb39dbe3cc00148d3", + "m_Id": 725644716, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector2_64bed4c1d817457d9eee6dd11af4d56c", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "9170778083264a76ae7cebcc0a632da5", + "m_Id": 1, + "m_DisplayName": "Tiling", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Tiling", + "m_StageCapability": 3, + "m_Value": { + "x": 6.0, + "y": 5.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "91b31de8014b494fb1fa92d45f12aa8b", + "m_Id": 13, + "m_DisplayName": "l", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "l", + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "91be6192317f41c4ab76c79bfce1b032", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "91d9ff024ed349d09521a802d2e18e71", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", + "m_ObjectId": "91fc957e4bc2494b8576a08c9ad067c9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integer", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5017.0, + "y": 835.9998779296875, + "width": 225.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "82839c67d29743499e599214ae499867" + }, + { + "m_Id": "060cb660e1954ca79825f5e299a7e7d7" + }, + { + "m_Id": "7a4107081b544d3e9d3595f54bcf824b" + }, + { + "m_Id": "261047da8e1e48bc9b12b9cde7dd539c" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"c049ee4319c71a64bb69f40e5fc38442\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "09603004-0120-45b9-8dad-231076812a11", + "d53af356-c9ba-44c2-9439-9b6b62de21b8", + "4080c0c9-8c3d-4fd1-953a-6f6a1f5e67ef" + ], + "m_PropertyIds": [ + 725644716, + -2021607636, + -1547857929 + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "928349ce0b0f411baa8ddd61d1004159", + "m_Id": 3, + "m_DisplayName": "Out_SS", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutSS", + "m_StageCapability": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", + "m_ObjectId": "93544dd93c6f47c28fc426213347c88d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Integer", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5017.0, + "y": 1685.9998779296875, + "width": 226.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "f2bb68ba53df47ed964203312dbaf5b3" + }, + { + "m_Id": "a7bf41adb47a42f8b3784468834e6863" + }, + { + "m_Id": "1b57b612521b4428aa9dd8ae29c4a484" + }, + { + "m_Id": "fb00e361af264e5bbb08074117547cb5" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"c049ee4319c71a64bb69f40e5fc38442\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "09603004-0120-45b9-8dad-231076812a11", + "d53af356-c9ba-44c2-9439-9b6b62de21b8", + "4080c0c9-8c3d-4fd1-953a-6f6a1f5e67ef" + ], + "m_PropertyIds": [ + 725644716, + -2021607636, + -1547857929 + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "935ed7d0b55e4103b66be28e5bd93d45", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DPropertiesNode", + "m_ObjectId": "941c285b125642cdb799108176943088", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Texel Size", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5478.0, + "y": 1747.0, + "width": 184.0, + "height": 101.0 + } + }, + "m_Slots": [ + { + "m_Id": "6060922599754648b9fd9721bf0b755f" + }, + { + "m_Id": "c4e6aa6a9b9341ce883bea742bc5124f" + }, + { + "m_Id": "19d041c8f162432fa3d55381cc31b7db" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "94b15ba6b40146d1a55dead76d1ff52e", + "m_Id": 5, + "m_DisplayName": "d", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "d", + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "956fd26705474c3b98d3d229f12070c9", + "m_Id": 3, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "963d17ab757e4c2b8e04d58277d453f7", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "968e6cea36804e6caa9dd935b267b292", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "9701e1c7a65e4fd9aff3397d658122b7", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "971ef80ad730496bb317779849a06969", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "9891792562c1479aaded1b44a5f4220b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5806.0, + "y": 1927.0, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "f0cc304f824d4f1db7d5e3860422b80d" + }, + { + "m_Id": "5b255844b9dd43a7ae77027e462ed454" + }, + { + "m_Id": "2c889cc263eb4e9283276ddf10e6a6c7" + }, + { + "m_Id": "d99b4c37f84e4b898fedf5f2114fec41" + }, + { + "m_Id": "a1c21c2f3d624c6bbe0f7dfaa140487e" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "PassThrough", + "m_FunctionSource": "", + "m_FunctionBody": "val = SAMPLE_TEXTURE2D(tex, ss, uv);\noutTex= tex;" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "98a907c755f04bcab1fc11f203adc27e", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateNode", + "m_ObjectId": "9b9b4792cea54beab7f63e35a4f8569c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sampler State", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3635.999755859375, + "y": -318.00006103515627, + "width": 145.0, + "height": 140.0 + } + }, + "m_Slots": [ + { + "m_Id": "935ed7d0b55e4103b66be28e5bd93d45" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_filter": 1, + "m_wrap": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "9f61b6e7eebb4a97ac9d5a04ab101613", + "m_Id": 14, + "m_DisplayName": "m", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "m", + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "9ff714ee327044ec872000552543ac9b", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "a0790cf24bb148679fd1561aa3c6dc3f", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "a09c91cd5477486aba85a57d1d1c51a9", + "m_Id": 1, + "m_DisplayName": "Out_Value", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutValue", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "a19917c9eb134f5b99286d4bdb807309", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a1a7ea40a8434477b3dad33b27eda0ea", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "a1c21c2f3d624c6bbe0f7dfaa140487e", + "m_Id": 4, + "m_DisplayName": "outTex", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "outTex", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "a1e2efc9ccd3468fa4b288c8509102de", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"940df6ba508f64540a3ffd2c5c43c91a\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a2723f0a13834bca8c44be2eeba63952", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "a2fd7bed3b104f56a252d24bc537f63b", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "a47e1275981b4ddabb0f24f9650112ba", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a7bf41adb47a42f8b3784468834e6863", + "m_Id": -2021607636, + "m_DisplayName": "Value", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_9c9afe9c6d854d25bf0e3a296657a9ab", + "m_StageCapability": 2, + "m_Value": 1128745.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "a81ed61e7bf94ed091c7cef6df1b4d47", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1679.9998779296875, + "y": 2196.999755859375, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "1a1e94e268c145bcbd932d67f75167ee" + }, + { + "m_Id": "38cf92fe3b8b4c8cb263b21cc69ce7c3" + }, + { + "m_Id": "3abb0f524e6647bbb2a6ac72050a8ea1" + }, + { + "m_Id": "b2d1344026aa49aab9714c0eabd9b635" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "Tex2D", + "m_FunctionSource": "", + "m_FunctionBody": "val = SAMPLE_TEXTURE2D(tex, ss, uv);" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "a89a7f023c7d45afb773c4f2c7d5ec92", + "m_Guid": { + "m_GuidSerialized": "bbdca87e-0461-477f-a7c5-0a40551e8465" + }, + "m_Name": "TexProp4", + "m_DefaultReferenceName": "Texture2D_a89a7f023c7d45afb773c4f2c7d5ec92", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"53ee4b410c7f7564b8fd0ff023cfc560\",\"type\":3}}", + "m_Guid": "" + }, + "m_Modifiable": true, + "m_DefaultType": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a9ccee6ffb744389a5a3cddb4448557a", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "aa1dabd12e5b4da186dc0fbcbac9e60b", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "aa31be6ea6fd497486fcae3de8795251", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "aaf279c20b6047ce832d35f716f7b538", + "m_Id": 0, + "m_DisplayName": "TexProp3", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "acab2d9d153f48f59c4484d2fa2fb8d0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_NodeVersion": 0, + "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": "b696d5189e44430e8656c3238a91ed8c" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "ae8f4d03febc4053aab496a47f575cfe", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -6186.99951171875, + "y": 1927.0, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "ce0a7826a6384d06baab9107b1c89774" + }, + { + "m_Id": "602a9132601e482da39ab29055bbb994" + }, + { + "m_Id": "74d48b07913446e9b2f799ac25cfb093" + }, + { + "m_Id": "905acf3a9bb04519a7649e25f4bc3b98" + }, + { + "m_Id": "b2e4106d6d5a4cf682943703df973a1b" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 1, + "m_FunctionName": "PassThroughSS", + "m_FunctionSource": "", + "m_FunctionBody": "val = SAMPLE_TEXTURE2D(tex, ss, uv);\noutSS= ss;" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "af3414cd4f394ddea4c708c3b979012d", + "m_Id": 2, + "m_DisplayName": "val", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "val", + "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_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "af646132d4044f39bebbce1d2fafc431", + "m_Id": 0, + "m_DisplayName": "tex", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "tex", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"d2be28188f7455b4bbef6bda86eb7410\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b04c4467cce64164b632ba6705db8443", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "b2d1344026aa49aab9714c0eabd9b635", + "m_Id": 3, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "b2e4106d6d5a4cf682943703df973a1b", + "m_Id": 4, + "m_DisplayName": "outSS", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "outSS", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "b3a119fddbee4141a2b766cbafb88115", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"33e7bdccd936e2a47965bf92082c7e5f\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "b627d18bd78d474080b13ad3bf988df2", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"940df6ba508f64540a3ffd2c5c43c91a\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "b696d5189e44430e8656c3238a91ed8c", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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": [ + "X", + "Y", + "Z" + ], + "m_Space": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b716d173a2994739812fcabbd3f9eeb2", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "b8b5113b5e8240b591a5964e5c27b52c", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "b9c04b35187b46129d408a5e5d514f43", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1784.00048828125, + "y": -3094.0, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "f9249b2646914a979a0eb842cea0d886" + }, + { + "m_Id": "332222d33134457597f4aeec2abfaa63" + }, + { + "m_Id": "91be6192317f41c4ab76c79bfce1b032" + }, + { + "m_Id": "c19bf2e7e7d24b3496f5e7eecdb51df4" + }, + { + "m_Id": "c13417e96f5b42208f4da7fbf21897b6" + }, + { + "m_Id": "1f4a2f7f5eb24ee4b3a8976f19a7674c" + }, + { + "m_Id": "c6f6153c0ca440dd8b64ab0096cb18c3" + }, + { + "m_Id": "57b2bc7461bd4505a815e9115effb560" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "ba3d0aae8c3b496f80605305bc468393", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "baf58eeb67af4b2cb85a29ff9ebafdde", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "bb1f5c452a9c4e0aa99d21f55142e08a", + "m_Id": 16, + "m_DisplayName": "o", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "o", + "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_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "bf7a207eb6444dca86507251ed933464", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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": [ + "X", + "Y", + "Z" + ], + "m_ColorMode": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "c02b1b5156bc4a3a9e87d1b88786d252", + "m_Guid": { + "m_GuidSerialized": "623ccf0f-a1b2-451d-9b5c-933a691d727b" + }, + "m_Name": "TexProp3", + "m_DefaultReferenceName": "Texture2D_c02b1b5156bc4a3a9e87d1b88786d252", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"4ea79c9c5cb5bf344a4c46bd8e87b35f\",\"type\":3}}", + "m_Guid": "" + }, + "m_Modifiable": true, + "m_DefaultType": 2 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c13417e96f5b42208f4da7fbf21897b6", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "c153d19e1dbe4b889fdea48afc259f0f", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "c170fb3d08104a7f845b9d88e809e81a", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Priority": 2147483647, + "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": [ + "X", + "Y", + "Z" + ], + "m_Space": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c19bf2e7e7d24b3496f5e7eecdb51df4", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c469d2d66bcb48079180ceac70ec1edf", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SubGraphNode", + "m_ObjectId": "c49105ad005a48809e249f54b185d1ff", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SubgraphTest", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5888.0, + "y": 1137.9998779296875, + "width": 234.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "5601f2e943a74d6b8003de209301e095" + }, + { + "m_Id": "3822557e83874824b72d93294071d802" + }, + { + "m_Id": "4782b963c27e4af981efabe6b5148f76" + }, + { + "m_Id": "928349ce0b0f411baa8ddd61d1004159" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"569ba86e116e56e42af2fa00828e80cb\",\n \"type\": 3\n }\n}", + "m_PropertyGuids": [ + "513fe548-18be-4d82-be38-a661ccdc3849" + ], + "m_PropertyIds": [ + -276715389 + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c4e6aa6a9b9341ce883bea742bc5124f", + "m_Id": 2, + "m_DisplayName": "Height", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Height", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "c6f6153c0ca440dd8b64ab0096cb18c3", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "c7505edd1eba433baa975e983e2f816d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -2007.0003662109375, + "y": -2180.0, + "width": 136.00001525878907, + "height": 34.000003814697269 + } + }, + "m_Slots": [ + { + "m_Id": "3afb2f984b7344139405c2d597ccc4a2" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "0074d215f44c48778ca9c4099ae6c48e" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "c8d6d6580e924ba8842edb1bd1c7716c", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "caec7a19327b42e0a9401f83a74970d5", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3243.000244140625, + "y": -470.9999084472656, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "9701e1c7a65e4fd9aff3397d658122b7" + }, + { + "m_Id": "e2e5d13c67704fa4818b140e25d51bfa" + }, + { + "m_Id": "2568bd86e2574f1ebe21f2c33271172d" + }, + { + "m_Id": "18a626982a3b491d932c6327a8a8e07a" + }, + { + "m_Id": "b8b5113b5e8240b591a5964e5c27b52c" + }, + { + "m_Id": "0ff74c892c7f4238bcecdcd41cdd317b" + }, + { + "m_Id": "79e8f3e9c1e343e6a7d93420c76f5715" + }, + { + "m_Id": "0d80c4e852d94fb2af67eaa1da31c3a3" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "cb60687e23e14453b0ed5d6a64fbbef4", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "cb65ee68a00c4a20b963e286ea69a617", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3489.999755859375, + "y": -880.9999389648438, + "width": 135.99998474121095, + "height": 33.999996185302737 + } + }, + "m_Slots": [ + { + "m_Id": "aaf279c20b6047ce832d35f716f7b538" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "c02b1b5156bc4a3a9e87d1b88786d252" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "cbe142254ad949fb829a6bcef46637ae", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "cc9c41e9c7c2468294ad9f5920a954c5", + "m_Id": 1, + "m_DisplayName": "Tiling", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Tiling", + "m_StageCapability": 3, + "m_Value": { + "x": 3.0, + "y": 3.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "ce0a7826a6384d06baab9107b1c89774", + "m_Id": 0, + "m_DisplayName": "tex", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "tex", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"d2be28188f7455b4bbef6bda86eb7410\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "cea379d7a3e242ad860b54a19e07efaf", + "m_Id": 2, + "m_DisplayName": "val", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "val", + "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_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "cea5bdac25c74f3f9d33f70b82b8dbd7", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_NodeVersion": 0, + "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": "bf7a207eb6444dca86507251ed933464" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "cf9dd538ef6448ff8e5610fd3a7b5a5c", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "d0d54bd60e08481eaf65e25770421327", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "d636885d376a4406b962b31b352f09c6", + "m_Id": 2, + "m_DisplayName": "val", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "val", + "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_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "d704f6be9f404b5d8a467557017151fc", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d78a6deefe774280b2fbb88e9fb542cf", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "d81ce6759bca481ca18ed80dd1bc5ecc", + "m_Id": 1, + "m_DisplayName": "Tiling", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Tiling", + "m_StageCapability": 3, + "m_Value": { + "x": 3.0, + "y": 3.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d86758c7656243a7af3fb133713e8830", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "d99b4c37f84e4b898fedf5f2114fec41", + "m_Id": 3, + "m_DisplayName": "uv", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "uv", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "dabfb7cba6574b5db83205774fd4097f", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "db267cdafbc34fa9a5d12b3828f8f0fa", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_NodeVersion": 0, + "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": "1b0a85f2f0354964a546ecc60200b00d" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "dd8d4237b4134bcd94a91708fa1eee3b", + "m_Id": 1, + "m_DisplayName": "Center", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Center", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 1.2000000476837159 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "e0fd8383ed1546fdae3bd114e9738674", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1784.00048828125, + "y": -1782.0, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "a2fd7bed3b104f56a252d24bc537f63b" + }, + { + "m_Id": "4f40c13bf7a045d6826e1f5e23864802" + }, + { + "m_Id": "0bb77a408d5d4300b56b0ab64ea1e943" + }, + { + "m_Id": "c469d2d66bcb48079180ceac70ec1edf" + }, + { + "m_Id": "ba3d0aae8c3b496f80605305bc468393" + }, + { + "m_Id": "b3a119fddbee4141a2b766cbafb88115" + }, + { + "m_Id": "e460b49e2a0a41c88103578890358744" + }, + { + "m_Id": "ee5f9d394f9c4294a603c6688ba67295" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 1, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e1919580870a4be980173c83d77f22a0", + "m_Id": -1547857929, + "m_DisplayName": "DigitsToDisplay", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector1_20cd827e2fd74009a9902fcbcc06f7e5", + "m_StageCapability": 2, + "m_Value": 5.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e28548a1555f418ca8cc327fc03adc28", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e2e5d13c67704fa4818b140e25d51bfa", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "e460b49e2a0a41c88103578890358744", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "e49794f2b3b14147a5ebc2c28e700200", + "m_Id": 725644716, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector2_64bed4c1d817457d9eee6dd11af4d56c", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "e4acd2dc904043a8a1938e2842ae54eb", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e5d2ec662d35412593e3110f759642f2", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e637199237514230bff66b1faab71228", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "e6876df28ef6450db0feeeba571b5285", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -5398.0, + "y": 2051.0, + "width": 208.00001525878907, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "a19917c9eb134f5b99286d4bdb807309" + }, + { + "m_Id": "e28548a1555f418ca8cc327fc03adc28" + }, + { + "m_Id": "98a907c755f04bcab1fc11f203adc27e" + }, + { + "m_Id": "968e6cea36804e6caa9dd935b267b292" + }, + { + "m_Id": "e637199237514230bff66b1faab71228" + }, + { + "m_Id": "d0d54bd60e08481eaf65e25770421327" + }, + { + "m_Id": "e4acd2dc904043a8a1938e2842ae54eb" + }, + { + "m_Id": "67abaa59ecf3402b90def22611fa739a" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "e7b8db27fc9448b38e335a51340f90b8", + "m_Id": 1, + "m_DisplayName": "ss", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "ss", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "e91c0f02662a41dab19a559ad1302dbd", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateNode", + "m_ObjectId": "e9448216e6b0424bb55ff81916069464", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sampler State", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3539.000244140625, + "y": -766.0, + "width": 145.00001525878907, + "height": 140.0 + } + }, + "m_Slots": [ + { + "m_Id": "c153d19e1dbe4b889fdea48afc259f0f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_filter": 2, + "m_wrap": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "e992ba014b264c81aec1315ac0afda91", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "ea5b69ced0a74143a60b4328aad208bd", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1998.000244140625, + "y": -2617.0, + "width": 129.0, + "height": 34.000003814697269 + } + }, + "m_Slots": [ + { + "m_Id": "0d17a7143d404d3fa3b61f288bdc9108" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "7a9565a8e7e7414bab07a2958bb34036" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "ea96fdd072de40c396f4f1dea1dbfd5f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1784.00048828125, + "y": -2220.0, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "dabfb7cba6574b5db83205774fd4097f" + }, + { + "m_Id": "245d0244bb89411aaa06482450599c82" + }, + { + "m_Id": "752935ebc93f4803b51ac9f28d27b025" + }, + { + "m_Id": "78e6199cbca849cda4b34e94690aa926" + }, + { + "m_Id": "7ff3b84a327c4f6181d6101854b507a8" + }, + { + "m_Id": "8114ffee059f47b6b5b5bc735e5eb408" + }, + { + "m_Id": "c8d6d6580e924ba8842edb1bd1c7716c" + }, + { + "m_Id": "f557aade7076494ba05667bd57ab3952" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "eb654aa0d10e44b2aba68e62e4d1389f", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "ed132322d9fb42b7b674efa20e37a8ae", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "ede1f008426a40468fb36593a12f2094", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3243.000244140625, + "y": -908.0, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "cb60687e23e14453b0ed5d6a64fbbef4" + }, + { + "m_Id": "896f74c0fca6482c94b717cc2bdb894d" + }, + { + "m_Id": "b716d173a2994739812fcabbd3f9eeb2" + }, + { + "m_Id": "f1f167bd5ace4d9daa4c145337c4396f" + }, + { + "m_Id": "3f85c51a79ab4969877b46a525493a6b" + }, + { + "m_Id": "471d0ca0c9c7450cb8ec5a80d7fb1d92" + }, + { + "m_Id": "963d17ab757e4c2b8e04d58277d453f7" + }, + { + "m_Id": "a0790cf24bb148679fd1561aa3c6dc3f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "ee4db98456324bfb8bad846d9a839687", + "m_Id": 2, + "m_DisplayName": "Rotation", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Rotation", + "m_StageCapability": 3, + "m_Value": 1.899999976158142, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "ee5f9d394f9c4294a603c6688ba67295", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "f0516f491b5748c88d544196379f9b59", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ], + "m_Channel": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "f0cc304f824d4f1db7d5e3860422b80d", + "m_Id": 0, + "m_DisplayName": "tex", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "tex", + "m_StageCapability": 3, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"4ea79c9c5cb5bf344a4c46bd8e87b35f\",\"type\":3}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "f142c2ead76d432d8e32171a429ba1e6", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f1f167bd5ace4d9daa4c145337c4396f", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "f26c450e7b41415cb493784338d6998e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3243.000244140625, + "y": -33.000003814697269, + "width": 208.0, + "height": 437.0 + } + }, + "m_Slots": [ + { + "m_Id": "5d0918d66a45421292eb7c52206e366d" + }, + { + "m_Id": "ed132322d9fb42b7b674efa20e37a8ae" + }, + { + "m_Id": "5f85608e1a3d41418963f6262daa1aaf" + }, + { + "m_Id": "a1a7ea40a8434477b3dad33b27eda0ea" + }, + { + "m_Id": "e5d2ec662d35412593e3110f759642f2" + }, + { + "m_Id": "a1e2efc9ccd3468fa4b288c8509102de" + }, + { + "m_Id": "cbe142254ad949fb829a6bcef46637ae" + }, + { + "m_Id": "0a059d9c5fb34360b563ea3b4788e360" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 1, + "m_NormalMapSpace": 1 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "f2bb68ba53df47ed964203312dbaf5b3", + "m_Id": 725644716, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Vector2_64bed4c1d817457d9eee6dd11af4d56c", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [ + "X", + "Y" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "f49b0ec515774034b6770e521c13d2cb", + "m_Id": 0, + "m_DisplayName": "a", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "a", + "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_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "f533055efba44dc7b67de10ac38ea884", + "m_Id": 18, + "m_DisplayName": "q", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "q", + "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_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "f557aade7076494ba05667bd57ab3952", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "f58c9d662e9540948f9eb2bd0de5bcae", + "m_Id": 2, + "m_DisplayName": "val", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "val", + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f86324b498ea4fe4adbc98f88e118dd8", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "f9249b2646914a979a0eb842cea0d886", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "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_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "fb00e361af264e5bbb08074117547cb5", + "m_Id": 1, + "m_DisplayName": "Number", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Number", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "fc60743724754dba8e13131adb9f3b93", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "fdffdaa86a8c453391b350f45d04e91d", + "m_Id": 1, + "m_DisplayName": "ss", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "ss", + "m_StageCapability": 3 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Texture2DAssetNode", + "m_ObjectId": "fe5663d2e4dd486f9bd983bff8732fc9", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Texture 2D Asset", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -3537.000244140625, + "y": 404.000244140625, + "width": 143.00001525878907, + "height": 106.0 + } + }, + "m_Slots": [ + { + "m_Id": "05120c562e264abab67d0d22b1b1d314" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"fileID\":2800000,\"guid\":\"0cca700aac7c2a9498c86edf66f943f8\",\"type\":3}}", + "m_Guid": "" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "fe8914b4252444c7a66fcf0775dd22fb", + "m_Id": 3, + "m_DisplayName": "Out_SS", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "OutSS", + "m_StageCapability": 2 +} + diff --git a/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/TextureTest.shadergraph.meta b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/TextureTest.shadergraph.meta new file mode 100644 index 00000000000..3a9d81cadff --- /dev/null +++ b/TestProjects/ShaderGraph/PreviousGraphVersions/10.x.x/TextureTest/TextureTest.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bc7113f7c2ebfd746b898e2883628d60 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index 1ab930a6162..351b9e31d38 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -7,6 +7,8 @@ #define SAMPLERDECL(n) SAMPLER(n); #endif +SAMPLER(default_sampler_Linear_Repeat); + struct GLES2UnsupportedSamplerState { }; @@ -35,8 +37,41 @@ struct UnityTexture2D SAMPLERDECL(samplerstate) float4 texelSize; float4 scaleTranslate; + + // these functions allows users to convert code using Texture2D to UnityTexture2D by simply changing the type of the variable + // the existing texture macros will call these functions, which will forward the call to the texture appropriately + float4 Sample(UnitySamplerState s, float2 uv) { return SAMPLE_TEXTURE2D(tex, s.samplerstate, uv); } + float4 SampleLevel(UnitySamplerState s, float2 uv, float lod) { return SAMPLE_TEXTURE2D_LOD(tex, s.samplerstate, uv, lod); } + float4 SampleBias(UnitySamplerState s, float2 uv, float bias) { return SAMPLE_TEXTURE2D_BIAS(tex, s.samplerstate, uv, bias); } + float4 SampleGrad(UnitySamplerState s, float2 uv, float dpdx, float dpdy) { return SAMPLE_TEXTURE2D_GRAD(tex, s.samplerstate, uv, dpdx, dpdy); } + +#ifndef SHADER_API_GLES + float4 Gather(UnitySamplerState s, float2 uv) { return GATHER_TEXTURE2D(tex, s.samplerstate, uv); } + float4 GatherRed(UnitySamplerState s, float2 uv) { return GATHER_RED_TEXTURE2D(tex, s.samplerstate, uv); } + float4 GatherGreen(UnitySamplerState s, float2 uv) { return GATHER_GREEN_TEXTURE2D(tex, s.samplerstate, uv); } + float4 GatherBlue(UnitySamplerState s, float2 uv) { return GATHER_BLUE_TEXTURE2D(tex, s.samplerstate, uv); } + float4 GatherAlpha(UnitySamplerState s, float2 uv) { return GATHER_ALPHA_TEXTURE2D(tex, s.samplerstate, uv); } + float CalculateLevelOfDetail(UnitySamplerState s, float2 uv) { return CALCULATE_TEXTURE2D_LOD(tex, s.samplerstate, uv); } + + float4 Sample(SAMPLER(s), float2 uv) { return SAMPLE_TEXTURE2D(tex, s, uv); } + float4 SampleLevel(SAMPLER(s), float2 uv, float lod) { return SAMPLE_TEXTURE2D_LOD(tex, s, uv, lod); } + float4 SampleBias(SAMPLER(s), float2 uv, float bias) { return SAMPLE_TEXTURE2D_BIAS(tex, s, uv, bias); } + float4 SampleGrad(SAMPLER(s), float2 uv, float dpdx, float dpdy) { return SAMPLE_TEXTURE2D_GRAD(tex, s, uv, dpdx, dpdy); } + float4 SampleCmpLevelZero(SAMPLER_CMP(s), float2 uv, float cmp) { return SAMPLE_TEXTURE2D_SHADOW(tex, s, float3(uv, cmp)); } + float4 Load(int3 pixel) { return LOAD_TEXTURE2D_LOD(tex, pixel.xy, pixel.z); } + float4 Gather(SAMPLER(s), float2 uv) { return GATHER_TEXTURE2D(tex, s, uv); } + float4 GatherRed(SAMPLER(s), float2 uv) { return GATHER_RED_TEXTURE2D(tex, s, uv); } + float4 GatherGreen(SAMPLER(s), float2 uv) { return GATHER_GREEN_TEXTURE2D(tex, s, uv); } + float4 GatherBlue(SAMPLER(s), float2 uv) { return GATHER_BLUE_TEXTURE2D(tex, s, uv); } + float4 GatherAlpha(SAMPLER(s), float2 uv) { return GATHER_ALPHA_TEXTURE2D(tex, s, uv); } + float CalculateLevelOfDetail(SAMPLER(s), float2 uv) { return CALCULATE_TEXTURE2D_LOD(tex, s, uv); } +#endif }; +float4 tex2D(UnityTexture2D tex, float2 uv) { return SAMPLE_TEXTURE2D(tex.tex, tex.samplerstate, uv); } +float4 tex2Dlod(UnityTexture2D tex, float4 uv0l) { return SAMPLE_TEXTURE2D_LOD(tex.tex, tex.samplerstate, uv0l.xy, uv0l.w); } +float4 tex2Dbias(UnityTexture2D tex, float4 uv0b) { return SAMPLE_TEXTURE2D_BIAS(tex.tex, tex.samplerstate, uv0b.xy, uv0b.w); } + #define UnityBuildTexture2DStruct(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, n##_ST) #define UnityBuildTexture2DStructNoScale(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, float4(1, 1, 0, 0)) UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate) @@ -53,6 +88,22 @@ struct UnityTexture2DArray { TEXTURE2D_ARRAY(tex); SAMPLERDECL(samplerstate) + + // these functions allows users to convert code using Texture2DArray to UnityTexture2DArray by simply changing the type of the variable + // the existing texture macros will call these functions, which will forward the call to the texture appropriately +#ifndef SHADER_API_GLES + float4 Sample(UnitySamplerState s, float3 uv) { return SAMPLE_TEXTURE2D_ARRAY(tex, s.samplerstate, uv.xy, uv.z); } + float4 SampleLevel(UnitySamplerState s, float3 uv, float lod) { return SAMPLE_TEXTURE2D_ARRAY_LOD(tex, s.samplerstate, uv.xy, uv.z, lod); } + float4 SampleBias(UnitySamplerState s, float3 uv, float bias) { return SAMPLE_TEXTURE2D_ARRAY_BIAS(tex, s.samplerstate, uv.xy, uv.z, bias); } + float4 SampleGrad(UnitySamplerState s, float3 uv, float dpdx, float dpdy) { return SAMPLE_TEXTURE2D_ARRAY_GRAD(tex, s.samplerstate, uv.xy, uv.z, dpdx, dpdy); } + + float4 Sample(SAMPLER(s), float3 uv) { return SAMPLE_TEXTURE2D_ARRAY(tex, s, uv.xy, uv.z); } + float4 SampleLevel(SAMPLER(s), float3 uv, float lod) { return SAMPLE_TEXTURE2D_ARRAY_LOD(tex, s, uv.xy, uv.z, lod); } + float4 SampleBias(SAMPLER(s), float3 uv, float bias) { return SAMPLE_TEXTURE2D_ARRAY_BIAS(tex, s, uv.xy, uv.z, bias); } + float4 SampleGrad(SAMPLER(s), float3 uv, float dpdx, float dpdy) { return SAMPLE_TEXTURE2D_ARRAY_GRAD(tex, s, uv.xy, uv.z, dpdx, dpdy); } + float4 SampleCmpLevelZero(SAMPLER_CMP(s), float3 uv, float cmp) { return SAMPLE_TEXTURE2D_ARRAY_SHADOW(tex, s, float3(uv.xy, cmp), uv.z); } + float4 Load(int4 pixel) { return LOAD_TEXTURE2D_ARRAY(tex, pixel.xy, pixel.z); } +#endif }; #define UnityBuildTexture2DArrayStruct(n) UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_ARGS(n, sampler##n)) @@ -69,8 +120,26 @@ struct UnityTextureCube { TEXTURECUBE(tex); SAMPLERDECL(samplerstate) + + // these functions allows users to convert code using TextureCube to UnityTextureCube by simply changing the type of the variable + // the existing texture macros will call these functions, which will forward the call to the texture appropriately + float4 Sample(UnitySamplerState s, float3 dir) { return SAMPLE_TEXTURECUBE(tex, s.samplerstate, dir); } + float4 SampleLevel(UnitySamplerState s, float3 dir, float lod) { return SAMPLE_TEXTURECUBE_LOD(tex, s.samplerstate, dir, lod); } + float4 SampleBias(UnitySamplerState s, float3 dir, float bias) { return SAMPLE_TEXTURECUBE_BIAS(tex, s.samplerstate, dir, bias); } + +#ifndef SHADER_API_GLES + float4 Gather(UnitySamplerState s, float3 dir) { return GATHER_TEXTURECUBE(tex, s.samplerstate, dir); } + + float4 Sample(SAMPLER(s), float3 dir) { return SAMPLE_TEXTURECUBE(tex, s, dir); } + float4 SampleLevel(SAMPLER(s), float3 dir, float lod) { return SAMPLE_TEXTURECUBE_LOD(tex, s, dir, lod); } + float4 SampleBias(SAMPLER(s), float3 dir, float bias) { return SAMPLE_TEXTURECUBE_BIAS(tex, s, dir, bias); } + float4 Gather(SAMPLER(s), float3 dir) { return GATHER_TEXTURECUBE(tex, s, dir); } +#endif }; +float4 texCUBE(UnityTextureCube tex, float3 dir) { return SAMPLE_TEXTURECUBE(tex.tex, tex.samplerstate, dir); } +float4 texCUBEbias(UnityTextureCube tex, float4 dirBias) { return SAMPLE_TEXTURECUBE_BIAS(tex.tex, tex.samplerstate, dirBias.xyz, dirBias.w); } + #define UnityBuildTextureCubeStruct(n) UnityBuildTextureCubeStructInternal(TEXTURECUBE_ARGS(n, sampler##n)) UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samplerstate)) { @@ -85,8 +154,21 @@ struct UnityTexture3D { TEXTURE3D(tex); SAMPLERDECL(samplerstate) + + // these functions allows users to convert code using Texture3D to UnityTexture3D by simply changing the type of the variable + // the existing texture macros will call these functions, which will forward the call to the texture appropriately + float4 Sample(UnitySamplerState s, float3 uvw) { return SAMPLE_TEXTURE3D(tex, s.samplerstate, uvw); } + float4 SampleLevel(UnitySamplerState s, float3 uvw, float lod) { return SAMPLE_TEXTURE3D_LOD(tex, s.samplerstate, uvw, lod); } + +#ifndef SHADER_API_GLES + float4 Sample(SAMPLER(s), float3 uvw) { return SAMPLE_TEXTURE2D(tex, s, uvw); } + float4 SampleLevel(SAMPLER(s), float3 uvw, float lod) { return SAMPLE_TEXTURE2D_LOD(tex, s, uvw, lod); } + float4 Load(int4 pixel) { return LOAD_TEXTURE3D_LOD(tex, pixel.xyz, pixel.w); } +#endif }; +float4 tex3D(UnityTexture3D tex, float3 uvw) { return SAMPLE_TEXTURE3D(tex.tex, tex.samplerstate, uvw); } + #define UnityBuildTexture3DStruct(n) UnityBuildTexture3DStructInternal(TEXTURE3D_ARGS(n, sampler##n)) UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplerstate)) { diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs index 9cd64d04db3..98b042104b1 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapInputMaterialSlot.cs @@ -79,7 +79,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) if (slot != null) { m_Cubemap = slot.m_Cubemap; - m_BareResource = slot.m_BareResource; + bareResource = slot.bareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs index 49c685264e3..1ac9c1f207b 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs @@ -21,7 +21,7 @@ public CubemapMaterialSlot( {} [SerializeField] - internal bool m_BareResource = false; + bool m_BareResource = false; internal override bool bareResource { get { return m_BareResource; } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs index d2674d593fb..e670007972e 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs @@ -23,7 +23,7 @@ public SamplerStateMaterialSlot( } [SerializeField] - internal bool m_BareResource = false; + bool m_BareResource = false; internal override bool bareResource { get { return m_BareResource; } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs index c3504548ac2..df3f5e41592 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayInputMaterialSlot.cs @@ -78,7 +78,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) if (slot != null) { m_TextureArray = slot.m_TextureArray; - m_BareResource = slot.m_BareResource; + bareResource = slot.bareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs index 1bf92f0858c..ffc38a246e7 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs @@ -21,7 +21,7 @@ public Texture2DArrayMaterialSlot( {} [SerializeField] - internal bool m_BareResource = false; + bool m_BareResource = false; internal override bool bareResource { get { return m_BareResource; } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs index e3e7c095cfb..c3906c27a18 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DInputMaterialSlot.cs @@ -89,7 +89,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) if (slot != null) { m_Texture = slot.m_Texture; - m_BareResource = slot.m_BareResource; + bareResource = slot.bareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs index fcb6dc5b59e..1437b9a212b 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs @@ -21,7 +21,7 @@ public Texture2DMaterialSlot( {} [SerializeField] - internal bool m_BareResource = false; + bool m_BareResource = false; internal override bool bareResource { get { return m_BareResource; } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs index 60019c7fe9b..a45064bfe86 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DInputMaterialSlot.cs @@ -78,7 +78,7 @@ public override void CopyValuesFrom(MaterialSlot foundSlot) if (slot != null) { m_Texture = slot.m_Texture; - m_BareResource = slot.m_BareResource; + bareResource = slot.bareResource; } } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs index 38e21acc77b..3eb379adbf4 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs @@ -21,7 +21,7 @@ public Texture3DMaterialSlot( {} [SerializeField] - internal bool m_BareResource = false; + bool m_BareResource = false; internal override bool bareResource { get { return m_BareResource; } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs index a9c8781dda0..7e6706ff56c 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs @@ -129,11 +129,14 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo } // declare output variables - foreach (var argument in outputSlots) + foreach (var output in outputSlots) { sb.AppendLine("{0} {1};", - argument.concreteValueType.ToShaderString(), - GetVariableNameForSlot(argument.id)); + output.concreteValueType.ToShaderString(), + GetVariableNameForSlot(output.id)); + + if (output.bareResource) + AssignDefaultBareResource(output, sb); } // call function @@ -142,45 +145,77 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.Append("_$precision("); bool first = true; - foreach (var argument in inputSlots) + foreach (var input in inputSlots) { if (!first) sb.Append(", "); first = false; - sb.Append(SlotInputValue(argument, generationMode)); // TODO: need to differentiate Texture2D from UnityTexture2D + sb.Append(SlotInputValue(input, generationMode)); - // fixup input for Bare texture types - if (argument.bareResource) - if (argument is SamplerStateMaterialSlot) + // fixup input for Bare types + if (input.bareResource) + { + if (input is SamplerStateMaterialSlot) sb.Append(".samplerstate"); else sb.Append(".tex"); + } } - foreach (var argument in outputSlots) + foreach (var output in outputSlots) { if (!first) sb.Append(", "); first = false; - sb.Append(GetVariableNameForSlot(argument.id)); + sb.Append(GetVariableNameForSlot(output.id)); - if (argument.bareResource) - if (argument is SamplerStateMaterialSlot) + // fixup output for Bare types + if (output.bareResource) + { + if (output is SamplerStateMaterialSlot) sb.Append(".samplerstate"); else sb.Append(".tex"); + } } sb.Append(");"); sb.AppendNewLine(); + } + } - foreach (var output in outputSlots) - { - if (output.bareResource) + void AssignDefaultBareResource(MaterialSlot slot, ShaderStringBuilder sb) + { + switch (slot.concreteValueType) + { + case ConcreteSlotValueType.Texture2D: { - // fill in other values - sampler state, etc ?? + var slotVariable = GetVariableNameForSlot(slot.id); + sb.AppendIndentation(); + sb.Append(slotVariable); + sb.Append(".samplerstate = default_sampler_Linear_Repeat;"); + sb.AppendNewLine(); + sb.AppendIndentation(); + sb.Append(slotVariable); + sb.Append(".texelSize = float4(1.0f/128.0f, 1.0f/128.0f, 128.0f, 128.0f);"); + sb.AppendNewLine(); + sb.AppendIndentation(); + sb.Append(slotVariable); + sb.Append(".scaleTranslate = float4(1.0f, 1.0f, 0.0f, 0.0f);"); + sb.AppendNewLine(); } - } + break; + case ConcreteSlotValueType.Texture3D: + case ConcreteSlotValueType.Texture2DArray: + case ConcreteSlotValueType.Cubemap: + { + var slotVariable = GetVariableNameForSlot(slot.id); + sb.AppendIndentation(); + sb.Append(slotVariable); + sb.Append(".samplerstate = default_sampler_Linear_Repeat;"); + sb.AppendNewLine(); + } + break; } } @@ -339,7 +374,7 @@ void ValidateBareTextureSlots() { if (slot.bareResource) { - owner.AddValidationError(objectId, "This node uses Bare Texture or SamplerState outputs, which may not work when fed to other nodes. Please convert the node to use full struct-based outputs (see the structs defined in com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl)", ShaderCompilerMessageSeverity.Warning); + owner.AddValidationError(objectId, "This node uses Bare Texture or SamplerState outputs, which may produce unexpected results when fed to other nodes. Please convert the node to use the non-Bare struct-based outputs (see the structs defined in com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl)", ShaderCompilerMessageSeverity.Warning); break; } } From 796dc2da01e2fcdb099383b52ac3432acb693ff5 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 23 Nov 2020 15:43:13 -0800 Subject: [PATCH 24/28] Fix for GLES2 compilation --- .../ShaderLibrary/Texture.hlsl | 23 +++++++++---------- .../Editor/Data/Graphs/CubemapMaterialSlot.cs | 10 +++++--- .../Editor/Data/Graphs/MaterialSlot.cs | 6 +++-- .../Data/Graphs/SamplerStateMaterialSlot.cs | 12 +++++++--- .../Data/Graphs/Texture2DArrayMaterialSlot.cs | 10 +++++--- .../Data/Graphs/Texture2DMaterialSlot.cs | 10 +++++--- .../Data/Graphs/Texture3DMaterialSlot.cs | 10 +++++--- .../Data/Nodes/Utility/CustomFunctionNode.cs | 8 ++----- 8 files changed, 54 insertions(+), 35 deletions(-) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index 351b9e31d38..86f87adfe0c 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -2,20 +2,20 @@ #define UNITY_TEXTURE_INCLUDED #ifdef SHADER_API_GLES - #define SAMPLERDECL(n) GLES2UnsupportedSamplerState n; + #define UNITY_BARE_SAMPLER(n) GLES2UnsupportedSamplerState n #else - #define SAMPLERDECL(n) SAMPLER(n); + #define UNITY_BARE_SAMPLER(n) SAMPLER(n) #endif -SAMPLER(default_sampler_Linear_Repeat); - struct GLES2UnsupportedSamplerState { }; +UNITY_BARE_SAMPLER(default_sampler_Linear_Repeat); + struct UnitySamplerState { - SAMPLERDECL(samplerstate) + UNITY_BARE_SAMPLER(samplerstate); }; #ifdef SHADER_API_GLES @@ -34,7 +34,7 @@ UnitySamplerState UnityBuildSamplerStateStructInternal(SAMPLER(samplerstate)) struct UnityTexture2D { TEXTURE2D(tex); - SAMPLERDECL(samplerstate) + UNITY_BARE_SAMPLER(samplerstate); float4 texelSize; float4 scaleTranslate; @@ -87,7 +87,7 @@ UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplersta struct UnityTexture2DArray { TEXTURE2D_ARRAY(tex); - SAMPLERDECL(samplerstate) + UNITY_BARE_SAMPLER(samplerstate); // these functions allows users to convert code using Texture2DArray to UnityTexture2DArray by simply changing the type of the variable // the existing texture macros will call these functions, which will forward the call to the texture appropriately @@ -119,7 +119,7 @@ UnityTexture2DArray UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_PARAM struct UnityTextureCube { TEXTURECUBE(tex); - SAMPLERDECL(samplerstate) + UNITY_BARE_SAMPLER(samplerstate); // these functions allows users to convert code using TextureCube to UnityTextureCube by simply changing the type of the variable // the existing texture macros will call these functions, which will forward the call to the texture appropriately @@ -153,14 +153,15 @@ UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samp struct UnityTexture3D { TEXTURE3D(tex); - SAMPLERDECL(samplerstate) + UNITY_BARE_SAMPLER(samplerstate); // these functions allows users to convert code using Texture3D to UnityTexture3D by simply changing the type of the variable // the existing texture macros will call these functions, which will forward the call to the texture appropriately float4 Sample(UnitySamplerState s, float3 uvw) { return SAMPLE_TEXTURE3D(tex, s.samplerstate, uvw); } - float4 SampleLevel(UnitySamplerState s, float3 uvw, float lod) { return SAMPLE_TEXTURE3D_LOD(tex, s.samplerstate, uvw, lod); } #ifndef SHADER_API_GLES + float4 SampleLevel(UnitySamplerState s, float3 uvw, float lod) { return SAMPLE_TEXTURE3D_LOD(tex, s.samplerstate, uvw, lod); } + float4 Sample(SAMPLER(s), float3 uvw) { return SAMPLE_TEXTURE2D(tex, s, uvw); } float4 SampleLevel(SAMPLER(s), float3 uvw, float lod) { return SAMPLE_TEXTURE2D_LOD(tex, s, uvw, lod); } float4 Load(int4 pixel) { return LOAD_TEXTURE3D_LOD(tex, pixel.xyz, pixel.w); } @@ -178,6 +179,4 @@ UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplersta return result; } -#undef SAMPLERDECL - #endif // UNITY_TEXTURE_INCLUDED diff --git a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs index 1ac9c1f207b..7fe4c25ff6d 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/CubemapMaterialSlot.cs @@ -28,12 +28,16 @@ internal override bool bareResource set { m_BareResource = value; } } - public override string GetHLSLVariableType() + public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, string paramName) { if (m_BareResource) - return "TextureCube"; + { + sb.Append("TEXTURECUBE("); + sb.Append(paramName); + sb.Append(")"); + } else - return concreteValueType.ToShaderString(); + base.AppendHLSLParameterDeclaration(sb, paramName); } public override SlotValueType valueType { get { return SlotValueType.Cubemap; } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs index c46c7ea34c9..a37ca168ce7 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs @@ -291,9 +291,11 @@ public virtual void GetPreviewProperties(List properties, strin properties.Add(default(PreviewProperty)); } - public virtual string GetHLSLVariableType() + public virtual void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, string paramName) { - return concreteValueType.ToShaderString(); + sb.Append(concreteValueType.ToShaderString()); + sb.Append(" "); + sb.Append(paramName); } public abstract void CopyValuesFrom(MaterialSlot foundSlot); diff --git a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs index e670007972e..b3ad8267a65 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/SamplerStateMaterialSlot.cs @@ -30,12 +30,18 @@ internal override bool bareResource set { m_BareResource = value; } } - public override string GetHLSLVariableType() + public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, string paramName) { if (m_BareResource) - return "SamplerState"; + { + // we have to use our modified macro declaration here, to ensure that something is declared for GLES2 platforms + // (the standard SAMPLER macro doesn't declare anything, so the commas will be messed up in the parameter list) + sb.Append("UNITY_BARE_SAMPLER("); + sb.Append(paramName); + sb.Append(")"); + } else - return concreteValueType.ToShaderString(); + base.AppendHLSLParameterDeclaration(sb, paramName); } public override string GetDefaultValue(GenerationMode generationMode) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs index ffc38a246e7..86190a9966f 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DArrayMaterialSlot.cs @@ -28,12 +28,16 @@ internal override bool bareResource set { m_BareResource = value; } } - public override string GetHLSLVariableType() + public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, string paramName) { if (m_BareResource) - return "Texture2DArray"; + { + sb.Append("TEXTURE2D_ARRAY("); + sb.Append(paramName); + sb.Append(")"); + } else - return concreteValueType.ToShaderString(); + base.AppendHLSLParameterDeclaration(sb, paramName); } public override SlotValueType valueType { get { return SlotValueType.Texture2DArray; } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs index 1437b9a212b..1d15c8c8e58 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture2DMaterialSlot.cs @@ -28,12 +28,16 @@ internal override bool bareResource set { m_BareResource = value; } } - public override string GetHLSLVariableType() + public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, string paramName) { if (m_BareResource) - return "Texture2D"; + { + sb.Append("TEXTURE2D("); + sb.Append(paramName); + sb.Append(")"); + } else - return concreteValueType.ToShaderString(); + base.AppendHLSLParameterDeclaration(sb, paramName); } public override SlotValueType valueType { get { return SlotValueType.Texture2D; } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs index 3eb379adbf4..eb29e94c198 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/Texture3DMaterialSlot.cs @@ -28,12 +28,16 @@ internal override bool bareResource set { m_BareResource = value; } } - public override string GetHLSLVariableType() + public override void AppendHLSLParameterDeclaration(ShaderStringBuilder sb, string paramName) { if (m_BareResource) - return "Texture3D"; + { + sb.Append("TEXTURE3D("); + sb.Append(paramName); + sb.Append(")"); + } else - return concreteValueType.ToShaderString(); + base.AppendHLSLParameterDeclaration(sb, paramName); } public override SlotValueType valueType { get { return SlotValueType.Texture3D; } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs index 7e6706ff56c..71fe2c911f9 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs @@ -283,9 +283,7 @@ void GetFunctionHeader(ShaderStringBuilder sb) if (!first) sb.Append(", "); first = false; - sb.Append(argument.GetHLSLVariableType()); - sb.Append(" "); - sb.Append(argument.shaderOutputName); + argument.AppendHLSLParameterDeclaration(sb, argument.shaderOutputName); } foreach (var argument in outputSlots) @@ -294,9 +292,7 @@ void GetFunctionHeader(ShaderStringBuilder sb) sb.Append(", "); first = false; sb.Append("out "); - sb.Append(argument.GetHLSLVariableType()); - sb.Append(" "); - sb.Append(argument.shaderOutputName); + argument.AppendHLSLParameterDeclaration(sb, argument.shaderOutputName); } sb.Append(")"); From 6452658cf94b4dec81c4aa32a5a2a2c617ac8a09 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 24 Nov 2020 08:32:04 -0800 Subject: [PATCH 25/28] Fix for OpenGL Core --- .../ShaderLibrary/Texture.hlsl | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index 86f87adfe0c..c355311ede7 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -46,11 +46,6 @@ struct UnityTexture2D float4 SampleGrad(UnitySamplerState s, float2 uv, float dpdx, float dpdy) { return SAMPLE_TEXTURE2D_GRAD(tex, s.samplerstate, uv, dpdx, dpdy); } #ifndef SHADER_API_GLES - float4 Gather(UnitySamplerState s, float2 uv) { return GATHER_TEXTURE2D(tex, s.samplerstate, uv); } - float4 GatherRed(UnitySamplerState s, float2 uv) { return GATHER_RED_TEXTURE2D(tex, s.samplerstate, uv); } - float4 GatherGreen(UnitySamplerState s, float2 uv) { return GATHER_GREEN_TEXTURE2D(tex, s.samplerstate, uv); } - float4 GatherBlue(UnitySamplerState s, float2 uv) { return GATHER_BLUE_TEXTURE2D(tex, s.samplerstate, uv); } - float4 GatherAlpha(UnitySamplerState s, float2 uv) { return GATHER_ALPHA_TEXTURE2D(tex, s.samplerstate, uv); } float CalculateLevelOfDetail(UnitySamplerState s, float2 uv) { return CALCULATE_TEXTURE2D_LOD(tex, s.samplerstate, uv); } float4 Sample(SAMPLER(s), float2 uv) { return SAMPLE_TEXTURE2D(tex, s, uv); } @@ -59,12 +54,21 @@ struct UnityTexture2D float4 SampleGrad(SAMPLER(s), float2 uv, float dpdx, float dpdy) { return SAMPLE_TEXTURE2D_GRAD(tex, s, uv, dpdx, dpdy); } float4 SampleCmpLevelZero(SAMPLER_CMP(s), float2 uv, float cmp) { return SAMPLE_TEXTURE2D_SHADOW(tex, s, float3(uv, cmp)); } float4 Load(int3 pixel) { return LOAD_TEXTURE2D_LOD(tex, pixel.xy, pixel.z); } + float CalculateLevelOfDetail(SAMPLER(s), float2 uv) { return CALCULATE_TEXTURE2D_LOD(tex, s, uv); } +#endif + +#ifdef PLATFORM_SUPPORT_GATHER + float4 Gather(UnitySamplerState s, float2 uv) { return GATHER_TEXTURE2D(tex, s.samplerstate, uv); } + float4 GatherRed(UnitySamplerState s, float2 uv) { return GATHER_RED_TEXTURE2D(tex, s.samplerstate, uv); } + float4 GatherGreen(UnitySamplerState s, float2 uv) { return GATHER_GREEN_TEXTURE2D(tex, s.samplerstate, uv); } + float4 GatherBlue(UnitySamplerState s, float2 uv) { return GATHER_BLUE_TEXTURE2D(tex, s.samplerstate, uv); } + float4 GatherAlpha(UnitySamplerState s, float2 uv) { return GATHER_ALPHA_TEXTURE2D(tex, s.samplerstate, uv); } + float4 Gather(SAMPLER(s), float2 uv) { return GATHER_TEXTURE2D(tex, s, uv); } float4 GatherRed(SAMPLER(s), float2 uv) { return GATHER_RED_TEXTURE2D(tex, s, uv); } float4 GatherGreen(SAMPLER(s), float2 uv) { return GATHER_GREEN_TEXTURE2D(tex, s, uv); } float4 GatherBlue(SAMPLER(s), float2 uv) { return GATHER_BLUE_TEXTURE2D(tex, s, uv); } float4 GatherAlpha(SAMPLER(s), float2 uv) { return GATHER_ALPHA_TEXTURE2D(tex, s, uv); } - float CalculateLevelOfDetail(SAMPLER(s), float2 uv) { return CALCULATE_TEXTURE2D_LOD(tex, s, uv); } #endif }; @@ -128,11 +132,13 @@ struct UnityTextureCube float4 SampleBias(UnitySamplerState s, float3 dir, float bias) { return SAMPLE_TEXTURECUBE_BIAS(tex, s.samplerstate, dir, bias); } #ifndef SHADER_API_GLES - float4 Gather(UnitySamplerState s, float3 dir) { return GATHER_TEXTURECUBE(tex, s.samplerstate, dir); } - float4 Sample(SAMPLER(s), float3 dir) { return SAMPLE_TEXTURECUBE(tex, s, dir); } float4 SampleLevel(SAMPLER(s), float3 dir, float lod) { return SAMPLE_TEXTURECUBE_LOD(tex, s, dir, lod); } float4 SampleBias(SAMPLER(s), float3 dir, float bias) { return SAMPLE_TEXTURECUBE_BIAS(tex, s, dir, bias); } +#endif + +#ifdef PLATFORM_SUPPORT_GATHER + float4 Gather(UnitySamplerState s, float3 dir) { return GATHER_TEXTURECUBE(tex, s.samplerstate, dir); } float4 Gather(SAMPLER(s), float3 dir) { return GATHER_TEXTURECUBE(tex, s, dir); } #endif }; @@ -164,7 +170,11 @@ struct UnityTexture3D float4 Sample(SAMPLER(s), float3 uvw) { return SAMPLE_TEXTURE2D(tex, s, uvw); } float4 SampleLevel(SAMPLER(s), float3 uvw, float lod) { return SAMPLE_TEXTURE2D_LOD(tex, s, uvw, lod); } + + #ifndef SHADER_API_GLCORE + // this macro is not defined in SHADER_API_GLCORE -- once that is fixed we can remove this restriction float4 Load(int4 pixel) { return LOAD_TEXTURE3D_LOD(tex, pixel.xyz, pixel.w); } + #endif #endif }; From babacdd3122395aaecd74b943ec6b2d20b72b1c9 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 24 Nov 2020 09:15:12 -0800 Subject: [PATCH 26/28] Adding GLCore support for LOAD_TEXTURE3D and LOAD_TEXTURE3D_LOD --- com.unity.render-pipelines.core/ShaderLibrary/API/GLCore.hlsl | 2 ++ com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/API/GLCore.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/API/GLCore.hlsl index 45de79471dd..5a7fa164732 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/API/GLCore.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/API/GLCore.hlsl @@ -136,6 +136,8 @@ #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) +#define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) +#define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) #if OPENGL4_1_SM5 #define PLATFORM_SUPPORT_GATHER diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index c355311ede7..fce7a0b2977 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -170,11 +170,7 @@ struct UnityTexture3D float4 Sample(SAMPLER(s), float3 uvw) { return SAMPLE_TEXTURE2D(tex, s, uvw); } float4 SampleLevel(SAMPLER(s), float3 uvw, float lod) { return SAMPLE_TEXTURE2D_LOD(tex, s, uvw, lod); } - - #ifndef SHADER_API_GLCORE - // this macro is not defined in SHADER_API_GLCORE -- once that is fixed we can remove this restriction float4 Load(int4 pixel) { return LOAD_TEXTURE3D_LOD(tex, pixel.xyz, pixel.w); } - #endif #endif }; From 3347c9a4b9726da88a339841176a6aa75fa0ff49 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 24 Nov 2020 14:58:55 -0800 Subject: [PATCH 27/28] Fix for consoles --- .../ShaderLibrary/Texture.hlsl | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index fce7a0b2977..7b75658c019 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -27,7 +27,9 @@ struct UnitySamplerState UnitySamplerState UnityBuildSamplerStateStructInternal(SAMPLER(samplerstate)) { UnitySamplerState result; - ASSIGN_SAMPLER(result.samplerstate, samplerstate); +#ifndef SHADER_API_GLES + result.samplerstate = samplerstate; +#endif return result; } @@ -82,7 +84,9 @@ UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplersta { UnityTexture2D result; result.tex = tex; - ASSIGN_SAMPLER(result.samplerstate, samplerstate); +#ifndef SHADER_API_GLES + result.samplerstate = samplerstate; +#endif result.texelSize = texelSize; result.scaleTranslate = scaleTranslate; return result; @@ -115,7 +119,9 @@ UnityTexture2DArray UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_PARAM { UnityTexture2DArray result; result.tex = tex; - ASSIGN_SAMPLER(result.samplerstate, samplerstate); +#ifndef SHADER_API_GLES + result.samplerstate = samplerstate; +#endif return result; } @@ -151,7 +157,9 @@ UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samp { UnityTextureCube result; result.tex = tex; - ASSIGN_SAMPLER(result.samplerstate, samplerstate); +#ifndef SHADER_API_GLES + result.samplerstate = samplerstate; +#endif return result; } @@ -181,7 +189,9 @@ UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplersta { UnityTexture3D result; result.tex = tex; - ASSIGN_SAMPLER(result.samplerstate, samplerstate); +#ifndef SHADER_API_GLES + result.samplerstate = samplerstate; +#endif return result; } From 684e3bbb18aa34fc05acb548cc857e79556c139c Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Tue, 24 Nov 2020 17:45:15 -0800 Subject: [PATCH 28/28] Disallow creating v0 of custom function node (which will upgrade incorrectly when saved/loaded) --- .../Editor/Data/Nodes/AbstractMaterialNode.cs | 3 +++ .../Editor/Data/Nodes/Utility/CustomFunctionNode.cs | 2 ++ .../Editor/Drawing/SearchWindowProvider.cs | 9 +++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index 8a9e4ad92ab..8777a5f2fcb 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -128,6 +128,9 @@ public bool previewExpanded } } + // by default, if this returns null, the system will allow creation of any previous version + public virtual IEnumerable allowedNodeVersions => null; + // Nodes that want to have a preview area can override this and return true public virtual bool hasPreview { diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs index 71fe2c911f9..b2cf400bc89 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/CustomFunctionNode.cs @@ -19,6 +19,8 @@ class CustomFunctionNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesF // 1 differentiate between struct-based UnityTexture2D and bare Texture2D resources (for all texture and samplerstate resources) public override int latestVersion => 1; + public override IEnumerable allowedNodeVersions => new int[] { 1 }; + [Serializable] public class MinimalCustomFunctionNode : IHasDependencies { diff --git a/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs b/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs index 4f30f122619..1ceac8ce4cf 100644 --- a/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs +++ b/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs @@ -113,11 +113,16 @@ public void GenerateNodeEntries() var node = (AbstractMaterialNode) Activator.CreateInstance(type); if(ShaderGraphPreferences.allowDeprecatedBehaviors && node.latestVersion > 0) { - for(int i = 0; i <= node.latestVersion; ++i) + var versions = node.allowedNodeVersions ?? Enumerable.Range(0, node.latestVersion + 1); + bool multiple = (versions.Count() > 1); + foreach (int i in versions) { var depNode = (AbstractMaterialNode)Activator.CreateInstance(type); depNode.ChangeVersion(i); - AddEntries(depNode, titleAttribute.title.Append($"V{i}").ToArray(), nodeEntries); + if (multiple) + AddEntries(depNode, titleAttribute.title.Append($"V{i}").ToArray(), nodeEntries); + else + AddEntries(depNode, titleAttribute.title, nodeEntries); } } else