From 8f2d5f1a8187441a30f2eefccd1028f7cc081f69 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 24 Jul 2020 10:18:29 -0500 Subject: [PATCH 01/34] first pass code - needs cleanup, going to change 2 classes to instead use 1 class with version number --- .../Material/ShaderGraph/SurfaceSubTarget.cs | 2 +- .../Editor/ShaderGUI/ParticleGUI.cs | 10 ++- .../Data/Graphs/AbstractShaderProperty.cs | 13 +++ .../Editor/Data/Graphs/ColorMaterialSlot.cs | 4 +- .../Data/Graphs/ColorRGBMaterialSlot.cs | 4 +- .../Editor/Data/Graphs/ColorShaderProperty.cs | 83 ++++++++++++++++++- .../Editor/Data/Graphs/GraphData.cs | 32 ++++++- .../Editor/Data/Graphs/PreviewProperty.cs | 10 +-- .../Data/Nodes/Input/Basic/ColorNode.cs | 6 +- .../Editor/Data/Nodes/Input/PropertyNode.cs | 5 +- .../Editor/Data/Nodes/Utility/SubGraphNode.cs | 2 +- .../Editor/Data/Util/PropertyUtil.cs | 4 +- .../Drawing/Blackboard/BlackboardFieldView.cs | 5 +- .../Drawing/Blackboard/BlackboardProvider.cs | 4 +- .../Editor/Drawing/Inspector/InspectorView.cs | 8 +- .../ShaderInputPropertyDrawer.cs | 50 ++++++++++- .../Drawing/Views/HelpBoxDeprecatedRow.cs | 36 ++++++++ .../Views/HelpBoxDeprecatedRow.cs.meta | 11 +++ .../Editor/Drawing/Views/HelpBoxRow.cs | 3 +- .../Editor/Drawing/Views/PropertyNodeView.cs | 5 +- .../Generation/Enumerations/PropertyType.cs | 3 +- .../Resources/Styles/HelpBoxDeprecatedRow.uss | 56 +++++++++++++ .../Styles/HelpBoxDeprecatedRow.uss.meta | 11 +++ .../VFXShaderGraphParticleOutput.cs | 4 +- 24 files changed, 336 insertions(+), 35 deletions(-) create mode 100644 com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs create mode 100644 com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs.meta create mode 100644 com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss create mode 100644 com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs index d9152711ffd..da2d59e1519 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs @@ -274,7 +274,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera // The user will then need to explicitly disable emissive GI if it is not needed. // To be able to automatically disable emission based on the ShaderGraph config when emission is black, // we will need a more general way to communicate this to the engine (not directly tied to a material property). - collector.AddShaderProperty(new ColorShaderProperty() + collector.AddShaderProperty(new ColorShaderProperty_V1() { overrideReferenceName = "_EmissionColor", hidden = true, diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs index ca14e3711e5..f17079453a1 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs @@ -255,7 +255,7 @@ public static void DoVertexStreamsArea(Material material, List 0) { if (!renderers[0].enableGPUInstancing || renderers[0].renderMode != ParticleSystemRenderMode.Mesh) @@ -316,8 +316,10 @@ public static void DoVertexStreamsArea(Material material, List false; + + public string GetPropertyTypeString() + { + switch(propertyType) + { + case PropertyType.Color_V0: + return "Color (Deprecated)"; + case PropertyType.Color_V1: + return "Color"; + default: + return propertyType.ToString(); + } + } } [Serializable] diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs index 8c9c6781654..6b15f0c5713 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs @@ -48,7 +48,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation if (matOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - var property = new ColorShaderProperty() + var property = new ColorShaderProperty_V1() { overrideReferenceName = matOwner.GetVariableNameForSlot(id), generatePropertyBlock = false, @@ -59,7 +59,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation public override void GetPreviewProperties(List properties, string name) { - var pp = new PreviewProperty(PropertyType.Color) + var pp = new PreviewProperty(PropertyType.Color_V0) { name = name, colorValue = new Color(value.x, value.y, value.z, value.w), diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs index 7cf37bcdcbb..14594675595 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs @@ -58,7 +58,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation if (matOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - var property = new ColorShaderProperty() + var property = new ColorShaderProperty_V1() { overrideReferenceName = matOwner.GetVariableNameForSlot(id), generatePropertyBlock = false, @@ -69,7 +69,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation public override void GetPreviewProperties(List properties, string name) { - var pp = new PreviewProperty(PropertyType.Color) + var pp = new PreviewProperty(PropertyType.Color_V1) { name = name, colorValue = new Color(value.x, value.y, value.z, 1), diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index 77532e9723a..14a123be277 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -5,16 +5,91 @@ namespace UnityEditor.ShaderGraph.Internal { + [Serializable] + public sealed class ColorShaderProperty_V1 : AbstractShaderProperty + { + internal ColorShaderProperty_V1() + { + displayName = "Color"; + } + + public ColorShaderProperty_V1(ColorShaderProperty_V0 colorProperty) + { + displayName = colorProperty.displayName; + hidden = colorProperty.hidden; + value = colorProperty.value; + colorMode = colorProperty.colorMode; + precision = colorProperty.precision; + gpuInstanced = colorProperty.gpuInstanced; + } + + public override PropertyType propertyType => PropertyType.Color_V1; + + internal override bool isBatchable => true; + internal override bool isExposable => true; + internal override bool isRenamable => true; + internal override bool isGpuInstanceable => true; + + internal string hdrTagString => colorMode == ColorMode.HDR ? "[HDR]" : ""; + + internal override string GetPropertyBlockString() + { + return $"{hideTagString}{hdrTagString}{referenceName}(\"{displayName}\", Color) = ({NodeUtils.FloatToShaderValue(value.r)}, {NodeUtils.FloatToShaderValue(value.g)}, {NodeUtils.FloatToShaderValue(value.b)}, {NodeUtils.FloatToShaderValue(value.a)})"; + } + + public override string GetDefaultReferenceName() + { + return $"Color_{objectId}"; + } + + [SerializeField] + ColorMode m_ColorMode; + + public ColorMode colorMode + { + get => m_ColorMode; + set => m_ColorMode = value; + } + + internal override AbstractMaterialNode ToConcreteNode() + { + return new ColorNode { color = new ColorNode.Color(value, colorMode) }; + } + + internal override PreviewProperty GetPreviewMaterialProperty() + { + return new PreviewProperty(propertyType) + { + name = referenceName, + colorValue = value + }; + } + + internal override ShaderInput Copy() + { + return new ColorShaderProperty_V1() + { + displayName = displayName, + hidden = hidden, + value = value, + colorMode = colorMode, + precision = precision, + gpuInstanced = gpuInstanced, + }; + } + } + [Serializable] [FormerName("UnityEditor.ShaderGraph.ColorShaderProperty")] - public sealed class ColorShaderProperty : AbstractShaderProperty + [FormerName("UnityEditor.ShaderGraph.Internal.ColorShaderProperty")] + public sealed class ColorShaderProperty_V0 : AbstractShaderProperty { - internal ColorShaderProperty() + internal ColorShaderProperty_V0() { displayName = "Color"; } - public override PropertyType propertyType => PropertyType.Color; + public override PropertyType propertyType => PropertyType.Color_V0; internal override bool isBatchable => true; internal override bool isExposable => true; @@ -58,7 +133,7 @@ internal override PreviewProperty GetPreviewMaterialProperty() internal override ShaderInput Copy() { - return new ColorShaderProperty() + return new ColorShaderProperty_V0() { displayName = displayName, hidden = hidden, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs index 585ee2b3985..1ca130409fc 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs @@ -275,6 +275,8 @@ public string path public MessageManager messageManager { get; set; } public bool isSubGraph { get; set; } + public bool hasChangedViewData { get; set; } + [SerializeField] private ConcretePrecision m_ConcretePrecision = ConcretePrecision.Float; @@ -1167,6 +1169,32 @@ public void RemoveGraphInput(ShaderInput input) ValidateGraph(); } + public void AddAndReplaceGraphInput(ShaderInput oldInput, ShaderInput newInput) + { + if(oldInput.concreteShaderValueType != newInput.concreteShaderValueType) + { + return; + } + + owner.RegisterCompleteObjectUndo("Replace graph input"); + int idx = m_Properties.IndexOf(oldInput as AbstractShaderProperty); + AddGraphInput(newInput, idx); + + if(oldInput is AbstractShaderProperty oldProp && newInput is AbstractShaderProperty newProp) + { + foreach(var propNode in GetNodes()) + { + if(propNode.property == oldProp) + { + propNode.property = newProp; + } + } + } + + RemoveGraphInput(oldInput); + hasChangedViewData = true; + } + public void MoveProperty(AbstractShaderProperty property, int newIndex) { if (newIndex > m_Properties.Count || newIndex < 0) @@ -1716,7 +1744,7 @@ public override void OnAfterDeserialize(string json) if (string.IsNullOrEmpty((string)defaultReferenceNameField.GetValue(property))) { // ColorShaderProperty is the only Property case where `GetDefaultReferenceName` was overriden - if (MultiJson.ParseType(serializedProperty.typeInfo.fullName) == typeof(ColorShaderProperty)) + if (MultiJson.ParseType(serializedProperty.typeInfo.fullName) == typeof(ColorShaderProperty_V1) || MultiJson.ParseType(serializedProperty.typeInfo.fullName) == typeof(ColorShaderProperty_V0)) { defaultReferenceNameField.SetValue(property, $"Color_{GuidEncoder.Encode(Guid.Parse(input0.m_Guid.m_GuidSerialized))}"); } @@ -2082,7 +2110,7 @@ void DeserializeContextData(ContextData contextData, ShaderStage stage) } - private void ReplaceNodeWithNode(LegacyUnknownTypeNode nodeToReplace, AbstractMaterialNode nodeReplacement) + private void ReplaceNodeWithNode(AbstractMaterialNode nodeToReplace, AbstractMaterialNode nodeReplacement) { var oldSlots = new List(); nodeToReplace.GetSlots(oldSlots); diff --git a/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs index d5aeb085518..06ff17db45c 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs @@ -51,14 +51,14 @@ public Color colorValue { get { - if (propType != PropertyType.Color) - throw new ArgumentException(string.Format(k_GetErrorMessage, PropertyType.Color, propType)); + if (propType != PropertyType.Color_V0 && propType != PropertyType.Color_V1) + throw new ArgumentException(string.Format(k_GetErrorMessage, PropertyType.Color_V1, propType)); return m_StructData.colorValue; } set { - if (propType != PropertyType.Color) - throw new ArgumentException(string.Format(k_SetErrorMessage, PropertyType.Color, propType)); + if (propType != PropertyType.Color_V0 && propType != PropertyType.Color_V1) + throw new ArgumentException(string.Format(k_SetErrorMessage, PropertyType.Color_V1, propType)); m_StructData.colorValue = value; } } @@ -201,7 +201,7 @@ public void SetValueOnMaterialPropertyBlock(MaterialPropertyBlock mat) mat.SetTexture(name, m_ClassData.textureValue); else if (propType == PropertyType.Cubemap && cubemapValue != null) mat.SetTexture(name, m_ClassData.cubemapValue); - else if (propType == PropertyType.Color) + else if (propType == PropertyType.Color_V0 || propType == PropertyType.Color_V1) mat.SetColor(name, m_StructData.colorValue); else if (propType == PropertyType.Vector2 || propType == PropertyType.Vector3 || propType == PropertyType.Vector4) mat.SetVector(name, m_StructData.vector4Value); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index 7072d8b70f3..d50201d4040 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -79,7 +79,7 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener if (!generationMode.IsPreview()) return; - properties.AddShaderProperty(new ColorShaderProperty() + properties.AddShaderProperty(new ColorShaderProperty_V1() { overrideReferenceName = GetVariableNameForNode(), generatePropertyBlock = false, @@ -108,7 +108,7 @@ public override string GetVariableNameForSlot(int slotId) public override void CollectPreviewMaterialProperties(List properties) { - properties.Add(new PreviewProperty(PropertyType.Color) + properties.Add(new PreviewProperty(PropertyType.Color_V1) { name = GetVariableNameForNode(), colorValue = PlayerSettings.colorSpace == ColorSpace.Linear ? color.color.linear : color.color @@ -117,7 +117,7 @@ public override void CollectPreviewMaterialProperties(List prop public AbstractShaderProperty AsShaderProperty() { - return new ColorShaderProperty { value = color.color, colorMode = color.mode }; + return new ColorShaderProperty_V1 { value = color.color, colorMode = color.mode }; } public int outputSlotId { get { return OutputSlotId; } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs index 9bdf9bba7a0..f529b954339 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs @@ -150,9 +150,12 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo case PropertyType.Vector4: sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); break; - case PropertyType.Color: + case PropertyType.Color_V0: sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); break; + case PropertyType.Color_V1: + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? {property.referenceName} : SRGBToLinear({property.referenceName});"); + break; case PropertyType.Matrix2: sb.AppendLine($"$precision2x2 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); break; diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs index e76544a9a6c..08f520b1061 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs @@ -368,7 +368,7 @@ public virtual void UpdateSlots() { var tSlot = slot as Vector4MaterialSlot; var vector4Prop = prop as Vector4ShaderProperty; - var colorProp = prop as ColorShaderProperty; + var colorProp = prop as ColorShaderProperty_V1; if (tSlot != null && vector4Prop != null) tSlot.value = vector4Prop.value; else if (tSlot != null && colorProp != null) diff --git a/com.unity.shadergraph/Editor/Data/Util/PropertyUtil.cs b/com.unity.shadergraph/Editor/Data/Util/PropertyUtil.cs index 381a4b8ad55..ca36b5700a9 100644 --- a/com.unity.shadergraph/Editor/Data/Util/PropertyUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/PropertyUtil.cs @@ -38,7 +38,9 @@ public static ConcreteSlotValueType ToConcreteShaderValueType(this PropertyType return ConcreteSlotValueType.Vector1; case PropertyType.Boolean: return ConcreteSlotValueType.Boolean; - case PropertyType.Color: + case PropertyType.Color_V0: + return ConcreteSlotValueType.Vector4; + case PropertyType.Color_V1: return ConcreteSlotValueType.Vector4; case PropertyType.VirtualTexture: return ConcreteSlotValueType.VirtualTexture; diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs index f5b217e1ae6..f0102baf400 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs @@ -211,7 +211,10 @@ void ChangePropertyValue(object newValue) case Vector4ShaderProperty vector4Property: vector4Property.value = (Vector4) newValue; break; - case ColorShaderProperty colorProperty: + case ColorShaderProperty_V0 colorProperty: + colorProperty.value = (Color) newValue; + break; + case ColorShaderProperty_V1 colorProperty: colorProperty.value = (Color) newValue; break; case Texture2DShaderProperty texture2DProperty: diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs index c8798d62738..d6d368b48e0 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs @@ -206,7 +206,7 @@ void AddPropertyItems(GenericMenu gm) gm.AddItem(new GUIContent($"Vector2"), false, () => AddInputRow(new Vector2ShaderProperty(), true)); gm.AddItem(new GUIContent($"Vector3"), false, () => AddInputRow(new Vector3ShaderProperty(), true)); gm.AddItem(new GUIContent($"Vector4"), false, () => AddInputRow(new Vector4ShaderProperty(), true)); - gm.AddItem(new GUIContent($"Color"), false, () => AddInputRow(new ColorShaderProperty(), true)); + gm.AddItem(new GUIContent($"Color"), false, () => AddInputRow(new ColorShaderProperty_V1(), true)); gm.AddItem(new GUIContent($"Texture2D"), false, () => AddInputRow(new Texture2DShaderProperty(), true)); gm.AddItem(new GUIContent($"Texture2D Array"), false, () => AddInputRow(new Texture2DArrayShaderProperty(), true)); gm.AddItem(new GUIContent($"Texture3D"), false, () => AddInputRow(new Texture3DShaderProperty(), true)); @@ -349,7 +349,7 @@ void AddInputRow(ShaderInput input, bool create = false, int index = -1) case AbstractShaderProperty property: { var icon = (m_Graph.isSubGraph || (property.isExposable && property.generatePropertyBlock)) ? exposedIcon : null; - field = new BlackboardFieldView(m_Graph, property, UpdateBlackboardView, icon, property.displayName, property.propertyType.ToString()) { userData = property }; + field = new BlackboardFieldView(m_Graph, property, UpdateBlackboardView, icon, property.displayName, property.GetPropertyTypeString()) { userData = property }; field.RegisterCallback(UpdateSelectionAfterUndoRedo); row = new BlackboardRow(field, null); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs index 89196d4531d..47e25801d75 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -91,7 +91,13 @@ public void InitializeGraphSettings() // If any of the selected items are no longer selected, inspector requires an update public bool DoesInspectorNeedUpdate() { + var needUpdate = !m_CachedSelectionList.SequenceEqual(selection); + if(graphView is MaterialGraphView mgv && mgv.graph.hasChangedViewData) + { + needUpdate = true; + mgv.graph.hasChangedViewData = false; + } return needUpdate; } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index 2f4548b91b3..f264706a501 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -226,7 +226,10 @@ void BuildPropertyFields(PropertySheet propertySheet) case Vector4ShaderProperty vector4Property: HandleVector4ShaderProperty(propertySheet, vector4Property); break; - case ColorShaderProperty colorProperty: + case ColorShaderProperty_V0 colorProperty: + HandleDeprecatedColorProperty(propertySheet, colorProperty); + break; + case ColorShaderProperty_V1 colorProperty: HandleColorProperty(propertySheet, colorProperty); break; case Texture2DShaderProperty texture2DProperty: @@ -446,7 +449,7 @@ void HandleVector4ShaderProperty(PropertySheet propertySheet, Vector4ShaderPrope out var propertyVec4Field)); } - void HandleColorProperty(PropertySheet propertySheet, ColorShaderProperty colorProperty) + void HandleColorProperty(PropertySheet propertySheet, ColorShaderProperty_V1 colorProperty) { var colorPropertyDrawer = new ColorPropertyDrawer(); @@ -482,6 +485,49 @@ void HandleColorProperty(PropertySheet propertySheet, ColorShaderProperty colorP } } + void HandleDeprecatedColorProperty(PropertySheet propertySheet, ColorShaderProperty_V0 colorProperty) + { + var colorPropertyDrawer = new ColorPropertyDrawer(); + propertySheet.Add(colorPropertyDrawer.CreateGUI( + newValue => + { + this._preChangeValueCallback("Change property value"); + this._changeValueCallback(newValue); + this._postChangeValueCallback(); + }, + colorProperty.value, + "Default", + out var propertyColorField)); + + var colorField = (ColorField)propertyColorField; + colorField.hdr = colorProperty.colorMode == ColorMode.HDR; + + if (!isSubGraph) + { + var enumPropertyDrawer = new EnumPropertyDrawer(); + + propertySheet.Add(enumPropertyDrawer.CreateGUI( + newValue => + { + this._preChangeValueCallback("Change Color Mode"); + colorProperty.colorMode = (ColorMode)newValue; + this._postChangeValueCallback(true, ModificationScope.Graph); + }, + colorProperty.colorMode, + "Mode", + ColorMode.Default, + out var colorModeField)); + } + var dep = new HelpBoxDeprecated("The Color Property has new updates. This version maintains the old behavior. If you update a Color Property, you can use Undo to change it back. See the Color Property documentation for more information.", + graphData.owner, + () => + { + var newCol = new ColorShaderProperty_V1(colorProperty); + graphData.AddAndReplaceGraphInput(colorProperty, newCol); + }); + propertySheet.Insert(0, dep); + } + void HandleTexture2DProperty(PropertySheet propertySheet, Texture2DShaderProperty texture2DProperty) { var texture2DPropertyDrawer = new Texture2DPropertyDrawer(); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs new file mode 100644 index 00000000000..d7fb21dfc44 --- /dev/null +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs @@ -0,0 +1,36 @@ +using System; +using System.Linq; +using UnityEngine; +using UnityEngine.UIElements; + +namespace UnityEditor.ShaderGraph.Drawing +{ + // Similar in function to the old EditorGUILayout.HelpBox + class HelpBoxDeprecated : VisualElement + { + VisualElement m_ContentContainer; + VisualElement m_LabelContainer; + + public override VisualElement contentContainer + { + get { return m_ContentContainer; } + } + + public HelpBoxDeprecated(string tooltip, UnityEngine.Object target, Action upgrade) + { + styleSheets.Add(Resources.Load("Styles/HelpBoxDeprecatedRow")); + VisualElement container = new VisualElement { name = "container" }; + m_ContentContainer = new VisualElement { name = "content" }; + m_LabelContainer = new VisualElement { name = "label" }; + + container.AddToClassList("help-box-deprecated-row-style-warning"); + container.Add(m_LabelContainer); + container.Add(m_ContentContainer); + hierarchy.Add(container); + var button = new Button(upgrade.Invoke) { text = "Update" }; + var label = new Label("DEPRECATED: Hover for info") { tooltip = tooltip }; + Add(label); + Add(button); + } + } +} diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs.meta b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs.meta new file mode 100644 index 00000000000..9b5abc62d3c --- /dev/null +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d5e43d7a1f3a85449b64e010b05cc7b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs index 321f897a082..731d8f715a0 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs @@ -10,6 +10,7 @@ class HelpBoxRow : VisualElement VisualElement m_ContentContainer; VisualElement m_LabelContainer; + protected VisualElement container; public override VisualElement contentContainer { get { return m_ContentContainer; } @@ -18,7 +19,7 @@ public override VisualElement contentContainer public HelpBoxRow(MessageType type) { styleSheets.Add(Resources.Load("Styles/HelpBoxRow")); - VisualElement container = new VisualElement {name = "container"}; + container = new VisualElement {name = "container"}; m_ContentContainer = new VisualElement { name = "content" }; m_LabelContainer = new VisualElement {name = "label" }; diff --git a/com.unity.shadergraph/Editor/Drawing/Views/PropertyNodeView.cs b/com.unity.shadergraph/Editor/Drawing/Views/PropertyNodeView.cs index 0b985554f68..b919038e94e 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/PropertyNodeView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/PropertyNodeView.cs @@ -177,7 +177,10 @@ void ChangePropertyValue(object newValue) case Vector4ShaderProperty vector4Property: vector4Property.value = (Vector4) newValue; break; - case ColorShaderProperty colorProperty: + case ColorShaderProperty_V0 colorProperty: + colorProperty.value = (Color) newValue; + break; + case ColorShaderProperty_V1 colorProperty: colorProperty.value = (Color) newValue; break; case Texture2DShaderProperty texture2DProperty: diff --git a/com.unity.shadergraph/Editor/Generation/Enumerations/PropertyType.cs b/com.unity.shadergraph/Editor/Generation/Enumerations/PropertyType.cs index 8536749b539..0e0405c0ad6 100644 --- a/com.unity.shadergraph/Editor/Generation/Enumerations/PropertyType.cs +++ b/com.unity.shadergraph/Editor/Generation/Enumerations/PropertyType.cs @@ -3,7 +3,8 @@ namespace UnityEditor.ShaderGraph.Internal [GenerationAPI] public enum PropertyType { - Color, + Color_V0, + Color_V1, Texture2D, Texture2DArray, Texture3D, diff --git a/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss b/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss new file mode 100644 index 00000000000..2d38973fb1d --- /dev/null +++ b/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss @@ -0,0 +1,56 @@ +HelpBoxDeprecatedRow > #container{ + flex-grow: 1; + margin-left: 8px; + margin-right: 8px; + padding-left: 8px; + padding-right: 8px; + flex-direction: row; +} + +HelpBoxDeprecatedRow > #container > #label { + width : 20px; + height : 20px; + align-self: center; + margin-right: 8px; +} + +HelpBoxDeprecatedRow > #container > #content { + flex-grow: 1; + justify-content: center; +} + +HelpBoxDeprecatedRow > * +{ + color:#584308; + white-space: normal; +} + +.help-box-deprecated-row-style-info +{ + background-color: #6ed7fc; +} + +.help-box-deprecated-row-style-info #label +{ + background-image : resource("console.infoicon"); +} + +.help-box-deprecated-row-style-warning +{ + background-color: #fcd76e; +} + +.help-box-deprecated-row-style-warning #label +{ + background-image : resource("console.warnicon"); +} + +.help-box-deprecated-row-style-error +{ + background-color: #fc6e6e; +} + +.help-box-deprecated-row-style-error #label +{ + background-image : resource("console.erroricon"); +} diff --git a/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss.meta b/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss.meta new file mode 100644 index 00000000000..5c6d5ba6627 --- /dev/null +++ b/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8bf9f4c67d6efb14791b1fca97eae7cb +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs index a7e5619d53d..1c65b769c07 100644 --- a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs +++ b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs @@ -49,7 +49,9 @@ static Type GetSGPropertyType(AbstractShaderProperty property) { switch (property.propertyType) { - case PropertyType.Color: + case PropertyType.Color_V0: + return typeof(Color); + case PropertyType.Color_V1: return typeof(Color); case PropertyType.Texture2D: return typeof(Texture2D); From 772ceddbe3e5823867b94bd2dcc38ebdce2ae260 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 24 Jul 2020 13:10:31 -0500 Subject: [PATCH 02/34] code cleanup and better way of deprecating --- .../Data/Graphs/AbstractShaderProperty.cs | 42 +++++-- .../Editor/Data/Graphs/ColorMaterialSlot.cs | 4 +- .../Data/Graphs/ColorRGBMaterialSlot.cs | 4 +- .../Editor/Data/Graphs/ColorShaderProperty.cs | 88 +++----------- .../Editor/Data/Graphs/GraphData.cs | 2 +- .../Editor/Data/Graphs/PreviewProperty.cs | 10 +- .../Data/Nodes/Input/Basic/ColorNode.cs | 6 +- .../Editor/Data/Nodes/Input/PropertyNode.cs | 14 ++- .../Editor/Data/Nodes/Utility/SubGraphNode.cs | 2 +- .../Editor/Data/Util/PropertyUtil.cs | 4 +- .../Drawing/Blackboard/BlackboardFieldView.cs | 5 +- .../Drawing/Blackboard/BlackboardProvider.cs | 9 +- .../ShaderInputPropertyDrawer.cs | 115 +++++++++++------- .../Drawing/Views/HelpBoxDeprecatedRow.cs | 14 ++- .../Editor/Drawing/Views/PropertyNodeView.cs | 5 +- .../Generation/Enumerations/PropertyType.cs | 3 +- .../Editor/ShaderGraphPreferences.cs | 17 ++- 17 files changed, 179 insertions(+), 165 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs index c8e9d0259c6..a7f1a8d5ea5 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs @@ -7,6 +7,36 @@ namespace UnityEditor.ShaderGraph.Internal [Serializable] public abstract class AbstractShaderProperty : ShaderInput { + + public virtual int latestVersion { get; } = 0; + public virtual int version { get; protected set; } = 0; + + internal protected delegate void VersionChange(int newVersion); + internal protected VersionChange onBeforeVersionChange; + internal protected Action onAfterVersionChange; + + internal void ChangeVersion(int newVersion) + { + if(newVersion == version) + { + return; + } + if(newVersion < 0) + { + Debug.LogError("Cant downgrade past version 0"); + return; + } + if(newVersion > latestVersion) + { + Debug.LogError("Cant upgrade to a version >= the current latest version"); + return; + } + + onBeforeVersionChange?.Invoke(newVersion); + version = newVersion; + onAfterVersionChange?.Invoke(); + } + public abstract PropertyType propertyType { get; } internal override ConcreteSlotValueType concreteShaderValueType => propertyType.ToConcreteShaderValueType(); @@ -109,17 +139,9 @@ internal virtual string GetPropertyAsArgumentString() internal abstract PreviewProperty GetPreviewMaterialProperty(); internal virtual bool isGpuInstanceable => false; - public string GetPropertyTypeString() + public virtual string GetPropertyTypeString() { - switch(propertyType) - { - case PropertyType.Color_V0: - return "Color (Deprecated)"; - case PropertyType.Color_V1: - return "Color"; - default: - return propertyType.ToString(); - } + return propertyType.ToString() + (version < latestVersion ? " (Deprecated)" : ""); } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs index 6b15f0c5713..8c9c6781654 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs @@ -48,7 +48,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation if (matOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - var property = new ColorShaderProperty_V1() + var property = new ColorShaderProperty() { overrideReferenceName = matOwner.GetVariableNameForSlot(id), generatePropertyBlock = false, @@ -59,7 +59,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation public override void GetPreviewProperties(List properties, string name) { - var pp = new PreviewProperty(PropertyType.Color_V0) + var pp = new PreviewProperty(PropertyType.Color) { name = name, colorValue = new Color(value.x, value.y, value.z, value.w), diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs index 14594675595..7cf37bcdcbb 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs @@ -58,7 +58,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation if (matOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - var property = new ColorShaderProperty_V1() + var property = new ColorShaderProperty() { overrideReferenceName = matOwner.GetVariableNameForSlot(id), generatePropertyBlock = false, @@ -69,7 +69,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation public override void GetPreviewProperties(List properties, string name) { - var pp = new PreviewProperty(PropertyType.Color_V1) + var pp = new PreviewProperty(PropertyType.Color) { name = name, colorValue = new Color(value.x, value.y, value.z, 1), diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index 14a123be277..6b80c0bf7e6 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -6,90 +6,32 @@ namespace UnityEditor.ShaderGraph.Internal { [Serializable] - public sealed class ColorShaderProperty_V1 : AbstractShaderProperty + [FormerName("UnityEditor.ShaderGraph.ColorShaderProperty")] + public sealed class ColorShaderProperty : AbstractShaderProperty { - internal ColorShaderProperty_V1() - { - displayName = "Color"; - } - - public ColorShaderProperty_V1(ColorShaderProperty_V0 colorProperty) - { - displayName = colorProperty.displayName; - hidden = colorProperty.hidden; - value = colorProperty.value; - colorMode = colorProperty.colorMode; - precision = colorProperty.precision; - gpuInstanced = colorProperty.gpuInstanced; - } - - public override PropertyType propertyType => PropertyType.Color_V1; - - internal override bool isBatchable => true; - internal override bool isExposable => true; - internal override bool isRenamable => true; - internal override bool isGpuInstanceable => true; - - internal string hdrTagString => colorMode == ColorMode.HDR ? "[HDR]" : ""; - - internal override string GetPropertyBlockString() - { - return $"{hideTagString}{hdrTagString}{referenceName}(\"{displayName}\", Color) = ({NodeUtils.FloatToShaderValue(value.r)}, {NodeUtils.FloatToShaderValue(value.g)}, {NodeUtils.FloatToShaderValue(value.b)}, {NodeUtils.FloatToShaderValue(value.a)})"; - } - - public override string GetDefaultReferenceName() - { - return $"Color_{objectId}"; - } + public override int latestVersion => 1; [SerializeField] - ColorMode m_ColorMode; - - public ColorMode colorMode - { - get => m_ColorMode; - set => m_ColorMode = value; - } + private int m_Version = 0; - internal override AbstractMaterialNode ToConcreteNode() + public override int version { - return new ColorNode { color = new ColorNode.Color(value, colorMode) }; + get => m_Version; + protected set => m_Version = value; } - internal override PreviewProperty GetPreviewMaterialProperty() + internal ColorShaderProperty() { - return new PreviewProperty(propertyType) - { - name = referenceName, - colorValue = value - }; - } - - internal override ShaderInput Copy() - { - return new ColorShaderProperty_V1() - { - displayName = displayName, - hidden = hidden, - value = value, - colorMode = colorMode, - precision = precision, - gpuInstanced = gpuInstanced, - }; + displayName = "Color"; + version = 0; } - } - [Serializable] - [FormerName("UnityEditor.ShaderGraph.ColorShaderProperty")] - [FormerName("UnityEditor.ShaderGraph.Internal.ColorShaderProperty")] - public sealed class ColorShaderProperty_V0 : AbstractShaderProperty - { - internal ColorShaderProperty_V0() + internal ColorShaderProperty(int version) : base() { - displayName = "Color"; + this.version = version; } - public override PropertyType propertyType => PropertyType.Color_V0; + public override PropertyType propertyType => PropertyType.Color; internal override bool isBatchable => true; internal override bool isExposable => true; @@ -116,7 +58,7 @@ public ColorMode colorMode get => m_ColorMode; set => m_ColorMode = value; } - + internal override AbstractMaterialNode ToConcreteNode() { return new ColorNode { color = new ColorNode.Color(value, colorMode) }; @@ -133,7 +75,7 @@ internal override PreviewProperty GetPreviewMaterialProperty() internal override ShaderInput Copy() { - return new ColorShaderProperty_V0() + return new ColorShaderProperty() { displayName = displayName, hidden = hidden, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs index 1ca130409fc..04c1d85ce9f 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs @@ -1744,7 +1744,7 @@ public override void OnAfterDeserialize(string json) if (string.IsNullOrEmpty((string)defaultReferenceNameField.GetValue(property))) { // ColorShaderProperty is the only Property case where `GetDefaultReferenceName` was overriden - if (MultiJson.ParseType(serializedProperty.typeInfo.fullName) == typeof(ColorShaderProperty_V1) || MultiJson.ParseType(serializedProperty.typeInfo.fullName) == typeof(ColorShaderProperty_V0)) + if (MultiJson.ParseType(serializedProperty.typeInfo.fullName) == typeof(ColorShaderProperty)) { defaultReferenceNameField.SetValue(property, $"Color_{GuidEncoder.Encode(Guid.Parse(input0.m_Guid.m_GuidSerialized))}"); } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs index 06ff17db45c..d5aeb085518 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/PreviewProperty.cs @@ -51,14 +51,14 @@ public Color colorValue { get { - if (propType != PropertyType.Color_V0 && propType != PropertyType.Color_V1) - throw new ArgumentException(string.Format(k_GetErrorMessage, PropertyType.Color_V1, propType)); + if (propType != PropertyType.Color) + throw new ArgumentException(string.Format(k_GetErrorMessage, PropertyType.Color, propType)); return m_StructData.colorValue; } set { - if (propType != PropertyType.Color_V0 && propType != PropertyType.Color_V1) - throw new ArgumentException(string.Format(k_SetErrorMessage, PropertyType.Color_V1, propType)); + if (propType != PropertyType.Color) + throw new ArgumentException(string.Format(k_SetErrorMessage, PropertyType.Color, propType)); m_StructData.colorValue = value; } } @@ -201,7 +201,7 @@ public void SetValueOnMaterialPropertyBlock(MaterialPropertyBlock mat) mat.SetTexture(name, m_ClassData.textureValue); else if (propType == PropertyType.Cubemap && cubemapValue != null) mat.SetTexture(name, m_ClassData.cubemapValue); - else if (propType == PropertyType.Color_V0 || propType == PropertyType.Color_V1) + else if (propType == PropertyType.Color) mat.SetColor(name, m_StructData.colorValue); else if (propType == PropertyType.Vector2 || propType == PropertyType.Vector3 || propType == PropertyType.Vector4) mat.SetVector(name, m_StructData.vector4Value); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index d50201d4040..5b7d2eee28a 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -79,7 +79,7 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener if (!generationMode.IsPreview()) return; - properties.AddShaderProperty(new ColorShaderProperty_V1() + properties.AddShaderProperty(new ColorShaderProperty() { overrideReferenceName = GetVariableNameForNode(), generatePropertyBlock = false, @@ -108,7 +108,7 @@ public override string GetVariableNameForSlot(int slotId) public override void CollectPreviewMaterialProperties(List properties) { - properties.Add(new PreviewProperty(PropertyType.Color_V1) + properties.Add(new PreviewProperty(PropertyType.Color) { name = GetVariableNameForNode(), colorValue = PlayerSettings.colorSpace == ColorSpace.Linear ? color.color.linear : color.color @@ -117,7 +117,7 @@ public override void CollectPreviewMaterialProperties(List prop public AbstractShaderProperty AsShaderProperty() { - return new ColorShaderProperty_V1 { value = color.color, colorMode = color.mode }; + return new ColorShaderProperty{ value = color.color, colorMode = color.mode }; } public int outputSlotId { get { return OutputSlotId; } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs index f529b954339..e48d9670c76 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs @@ -150,11 +150,15 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo case PropertyType.Vector4: sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); break; - case PropertyType.Color_V0: - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); - break; - case PropertyType.Color_V1: - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? {property.referenceName} : SRGBToLinear({property.referenceName});"); + case PropertyType.Color: + if (property.version == 0) + { + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + } + else + { + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? {property.referenceName} : SRGBToLinear({property.referenceName});"); + } break; case PropertyType.Matrix2: sb.AppendLine($"$precision2x2 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs index 08f520b1061..e76544a9a6c 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Utility/SubGraphNode.cs @@ -368,7 +368,7 @@ public virtual void UpdateSlots() { var tSlot = slot as Vector4MaterialSlot; var vector4Prop = prop as Vector4ShaderProperty; - var colorProp = prop as ColorShaderProperty_V1; + var colorProp = prop as ColorShaderProperty; if (tSlot != null && vector4Prop != null) tSlot.value = vector4Prop.value; else if (tSlot != null && colorProp != null) diff --git a/com.unity.shadergraph/Editor/Data/Util/PropertyUtil.cs b/com.unity.shadergraph/Editor/Data/Util/PropertyUtil.cs index ca36b5700a9..381a4b8ad55 100644 --- a/com.unity.shadergraph/Editor/Data/Util/PropertyUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/PropertyUtil.cs @@ -38,9 +38,7 @@ public static ConcreteSlotValueType ToConcreteShaderValueType(this PropertyType return ConcreteSlotValueType.Vector1; case PropertyType.Boolean: return ConcreteSlotValueType.Boolean; - case PropertyType.Color_V0: - return ConcreteSlotValueType.Vector4; - case PropertyType.Color_V1: + case PropertyType.Color: return ConcreteSlotValueType.Vector4; case PropertyType.VirtualTexture: return ConcreteSlotValueType.VirtualTexture; diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs index f0102baf400..f5b217e1ae6 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs @@ -211,10 +211,7 @@ void ChangePropertyValue(object newValue) case Vector4ShaderProperty vector4Property: vector4Property.value = (Vector4) newValue; break; - case ColorShaderProperty_V0 colorProperty: - colorProperty.value = (Color) newValue; - break; - case ColorShaderProperty_V1 colorProperty: + case ColorShaderProperty colorProperty: colorProperty.value = (Color) newValue; break; case Texture2DShaderProperty texture2DProperty: diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs index d6d368b48e0..ba22e76cc16 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs @@ -206,7 +206,7 @@ void AddPropertyItems(GenericMenu gm) gm.AddItem(new GUIContent($"Vector2"), false, () => AddInputRow(new Vector2ShaderProperty(), true)); gm.AddItem(new GUIContent($"Vector3"), false, () => AddInputRow(new Vector3ShaderProperty(), true)); gm.AddItem(new GUIContent($"Vector4"), false, () => AddInputRow(new Vector4ShaderProperty(), true)); - gm.AddItem(new GUIContent($"Color"), false, () => AddInputRow(new ColorShaderProperty_V1(), true)); + gm.AddItem(new GUIContent($"Color"), false, () => AddInputRow(new ColorShaderProperty(), true)); gm.AddItem(new GUIContent($"Texture2D"), false, () => AddInputRow(new Texture2DShaderProperty(), true)); gm.AddItem(new GUIContent($"Texture2D Array"), false, () => AddInputRow(new Texture2DArrayShaderProperty(), true)); gm.AddItem(new GUIContent($"Texture3D"), false, () => AddInputRow(new Texture3DShaderProperty(), true)); @@ -351,6 +351,13 @@ void AddInputRow(ShaderInput input, bool create = false, int index = -1) var icon = (m_Graph.isSubGraph || (property.isExposable && property.generatePropertyBlock)) ? exposedIcon : null; field = new BlackboardFieldView(m_Graph, property, UpdateBlackboardView, icon, property.displayName, property.GetPropertyTypeString()) { userData = property }; field.RegisterCallback(UpdateSelectionAfterUndoRedo); + property.onBeforeVersionChange += (_) => m_Graph.owner.RegisterCompleteObjectUndo($"Change {property.displayName} Version"); + void UpdateField() + { + field.typeText = property.GetPropertyTypeString(); + field.InspectorUpdateTrigger(); + } + property.onAfterVersionChange += UpdateField; row = new BlackboardRow(field, null); if (index < 0 || index > m_InputRows.Count) diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index f264706a501..6c8ad7e0637 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -101,6 +101,29 @@ public VisualElement DrawProperty( { var propertySheet = new PropertySheet(); shaderInput = actualObject as ShaderInput; + if (shaderInput is AbstractShaderProperty property) + { + if (property.version < property.latestVersion) + { + var typeString = property.propertyType.ToString(); + if (ShaderGraphPreferences.allowDeprecatedBehaviors) + { + propertySheet.Add(new HelpBoxDeprecated( + $"The {typeString} Property has new updates. This version maintains the old behavior. See the {typeString} Property documentation for more information.", + property.latestVersion, + property.ChangeVersion)); + + } + else + { + + propertySheet.Add(new HelpBoxDeprecated( + $"The {typeString} Property has new updates. This version maintains the old behavior. If you update a {typeString} Property, you can use Undo to change it back. See the {typeString} Property documentation for more information.", + () => property.ChangeVersion(property.latestVersion))); + } + } + } + BuildPropertyNameLabel(propertySheet); BuildExposedField(propertySheet); BuildDisplayNameField(propertySheet); @@ -226,10 +249,7 @@ void BuildPropertyFields(PropertySheet propertySheet) case Vector4ShaderProperty vector4Property: HandleVector4ShaderProperty(propertySheet, vector4Property); break; - case ColorShaderProperty_V0 colorProperty: - HandleDeprecatedColorProperty(propertySheet, colorProperty); - break; - case ColorShaderProperty_V1 colorProperty: + case ColorShaderProperty colorProperty: HandleColorProperty(propertySheet, colorProperty); break; case Texture2DShaderProperty texture2DProperty: @@ -449,7 +469,7 @@ void HandleVector4ShaderProperty(PropertySheet propertySheet, Vector4ShaderPrope out var propertyVec4Field)); } - void HandleColorProperty(PropertySheet propertySheet, ColorShaderProperty_V1 colorProperty) + void HandleColorProperty(PropertySheet propertySheet, ColorShaderProperty colorProperty) { var colorPropertyDrawer = new ColorPropertyDrawer(); @@ -483,51 +503,52 @@ void HandleColorProperty(PropertySheet propertySheet, ColorShaderProperty_V1 col ColorMode.Default, out var colorModeField)); } - } - - void HandleDeprecatedColorProperty(PropertySheet propertySheet, ColorShaderProperty_V0 colorProperty) - { - var colorPropertyDrawer = new ColorPropertyDrawer(); - propertySheet.Add(colorPropertyDrawer.CreateGUI( - newValue => - { - this._preChangeValueCallback("Change property value"); - this._changeValueCallback(newValue); - this._postChangeValueCallback(); - }, - colorProperty.value, - "Default", - out var propertyColorField)); - - var colorField = (ColorField)propertyColorField; - colorField.hdr = colorProperty.colorMode == ColorMode.HDR; - - if (!isSubGraph) - { - var enumPropertyDrawer = new EnumPropertyDrawer(); - propertySheet.Add(enumPropertyDrawer.CreateGUI( - newValue => - { - this._preChangeValueCallback("Change Color Mode"); - colorProperty.colorMode = (ColorMode)newValue; - this._postChangeValueCallback(true, ModificationScope.Graph); - }, - colorProperty.colorMode, - "Mode", - ColorMode.Default, - out var colorModeField)); - } - var dep = new HelpBoxDeprecated("The Color Property has new updates. This version maintains the old behavior. If you update a Color Property, you can use Undo to change it back. See the Color Property documentation for more information.", - graphData.owner, - () => - { - var newCol = new ColorShaderProperty_V1(colorProperty); - graphData.AddAndReplaceGraphInput(colorProperty, newCol); - }); - propertySheet.Insert(0, dep); } + //void HandleDeprecatedColorProperty(PropertySheet propertySheet, ColorShaderProperty_V0 colorProperty) + //{ + // var colorPropertyDrawer = new ColorPropertyDrawer(); + // propertySheet.Add(colorPropertyDrawer.CreateGUI( + // newValue => + // { + // this._preChangeValueCallback("Change property value"); + // this._changeValueCallback(newValue); + // this._postChangeValueCallback(); + // }, + // colorProperty.value, + // "Default", + // out var propertyColorField)); + + // var colorField = (ColorField)propertyColorField; + // colorField.hdr = colorProperty.colorMode == ColorMode.HDR; + + // if (!isSubGraph) + // { + // var enumPropertyDrawer = new EnumPropertyDrawer(); + + // propertySheet.Add(enumPropertyDrawer.CreateGUI( + // newValue => + // { + // this._preChangeValueCallback("Change Color Mode"); + // colorProperty.colorMode = (ColorMode)newValue; + // this._postChangeValueCallback(true, ModificationScope.Graph); + // }, + // colorProperty.colorMode, + // "Mode", + // ColorMode.Default, + // out var colorModeField)); + // } + // var dep = new HelpBoxDeprecated("The Color Property has new updates. This version maintains the old behavior. If you update a Color Property, you can use Undo to change it back. See the Color Property documentation for more information.", + // graphData.owner, + // () => + // { + // var newCol = new ColorShaderProperty_V1(colorProperty); + // graphData.AddAndReplaceGraphInput(colorProperty, newCol); + // }); + // propertySheet.Insert(0, dep); + //} + void HandleTexture2DProperty(PropertySheet propertySheet, Texture2DShaderProperty texture2DProperty) { var texture2DPropertyDrawer = new Texture2DPropertyDrawer(); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs index d7fb21dfc44..f17171828eb 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs @@ -16,7 +16,7 @@ public override VisualElement contentContainer get { return m_ContentContainer; } } - public HelpBoxDeprecated(string tooltip, UnityEngine.Object target, Action upgrade) + private void Setup() { styleSheets.Add(Resources.Load("Styles/HelpBoxDeprecatedRow")); VisualElement container = new VisualElement { name = "container" }; @@ -27,10 +27,22 @@ public HelpBoxDeprecated(string tooltip, UnityEngine.Object target, Action upgra container.Add(m_LabelContainer); container.Add(m_ContentContainer); hierarchy.Add(container); + } + + public HelpBoxDeprecated(string tooltip, Action upgrade) + { + Setup(); var button = new Button(upgrade.Invoke) { text = "Update" }; var label = new Label("DEPRECATED: Hover for info") { tooltip = tooltip }; Add(label); Add(button); } + + public HelpBoxDeprecated(string tooltip, int numVersions, Action setNewVersion) + { + Setup(); + Add(new Label("Need a way to select version number here")); + //OnVersionSelection setNewVersion(selection); + } } } diff --git a/com.unity.shadergraph/Editor/Drawing/Views/PropertyNodeView.cs b/com.unity.shadergraph/Editor/Drawing/Views/PropertyNodeView.cs index b919038e94e..0b985554f68 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/PropertyNodeView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/PropertyNodeView.cs @@ -177,10 +177,7 @@ void ChangePropertyValue(object newValue) case Vector4ShaderProperty vector4Property: vector4Property.value = (Vector4) newValue; break; - case ColorShaderProperty_V0 colorProperty: - colorProperty.value = (Color) newValue; - break; - case ColorShaderProperty_V1 colorProperty: + case ColorShaderProperty colorProperty: colorProperty.value = (Color) newValue; break; case Texture2DShaderProperty texture2DProperty: diff --git a/com.unity.shadergraph/Editor/Generation/Enumerations/PropertyType.cs b/com.unity.shadergraph/Editor/Generation/Enumerations/PropertyType.cs index 0e0405c0ad6..8536749b539 100644 --- a/com.unity.shadergraph/Editor/Generation/Enumerations/PropertyType.cs +++ b/com.unity.shadergraph/Editor/Generation/Enumerations/PropertyType.cs @@ -3,8 +3,7 @@ namespace UnityEditor.ShaderGraph.Internal [GenerationAPI] public enum PropertyType { - Color_V0, - Color_V1, + Color, Texture2D, Texture2DArray, Texture3D, diff --git a/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs b/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs index 13a3f9c5719..7574bdea913 100644 --- a/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs +++ b/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs @@ -1,4 +1,4 @@ -using UnityEngine; +using UnityEngine; namespace UnityEditor.ShaderGraph { @@ -8,6 +8,7 @@ static class Keys { internal const string variantLimit = "UnityEditor.ShaderGraph.VariantLimit"; internal const string autoAddRemoveBlocks = "UnityEditor.ShaderGraph.AutoAddRemoveBlocks"; + internal const string allowDeprecatedBehaviors = "UnityEditor.ShaderGraph.AllowDeprecatedBehaviors"; } static bool m_Loaded = false; @@ -33,6 +34,13 @@ internal static bool autoAddRemoveBlocks set => TrySave(ref m_AutoAddRemoveBlocks, value, Keys.autoAddRemoveBlocks); } + static bool m_AllowDeprecatedBehaviors = false; + internal static bool allowDeprecatedBehaviors + { + get => m_AllowDeprecatedBehaviors; + set => TrySave(ref m_AllowDeprecatedBehaviors, value, Keys.allowDeprecatedBehaviors); + } + static ShaderGraphPreferences() { Load(); @@ -71,6 +79,13 @@ static void OpenGUI() autoAddRemoveBlocks = autoAddRemoveBlocksValue; } + EditorGUI.BeginChangeCheck(); + var allowDeprecatedBehaviorsValue = EditorGUILayout.Toggle("Allow the use of deprecated versions of properties and nodes", allowDeprecatedBehaviors); + if(EditorGUI.EndChangeCheck()) + { + allowDeprecatedBehaviors = allowDeprecatedBehaviorsValue; + } + EditorGUIUtility.labelWidth = previousLabelWidth; } From 0bf0a3f4f8af779b238514884db99460bde567cb Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 24 Jul 2020 13:17:57 -0500 Subject: [PATCH 03/34] revert uneccesary changes --- .../Material/ShaderGraph/SurfaceSubTarget.cs | 2 +- .../Editor/ShaderGUI/ParticleGUI.cs | 10 ++----- .../Editor/Data/Graphs/GraphData.cs | 30 +------------------ .../Data/Nodes/Input/Basic/ColorNode.cs | 2 +- .../Editor/Drawing/Inspector/InspectorView.cs | 8 +---- .../Editor/Drawing/Views/HelpBoxRow.cs | 3 +- .../VFXShaderGraphParticleOutput.cs | 4 +-- 7 files changed, 9 insertions(+), 50 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs index da2d59e1519..d9152711ffd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/SurfaceSubTarget.cs @@ -274,7 +274,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera // The user will then need to explicitly disable emissive GI if it is not needed. // To be able to automatically disable emission based on the ShaderGraph config when emission is black, // we will need a more general way to communicate this to the engine (not directly tied to a material property). - collector.AddShaderProperty(new ColorShaderProperty_V1() + collector.AddShaderProperty(new ColorShaderProperty() { overrideReferenceName = "_EmissionColor", hidden = true, diff --git a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs index f17079453a1..ca14e3711e5 100644 --- a/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs +++ b/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs @@ -255,7 +255,7 @@ public static void DoVertexStreamsArea(Material material, List 0) { if (!renderers[0].enableGPUInstancing || renderers[0].renderMode != ParticleSystemRenderMode.Mesh) @@ -316,10 +316,8 @@ public static void DoVertexStreamsArea(Material material, List()) - { - if(propNode.property == oldProp) - { - propNode.property = newProp; - } - } - } - - RemoveGraphInput(oldInput); - hasChangedViewData = true; - } - public void MoveProperty(AbstractShaderProperty property, int newIndex) { if (newIndex > m_Properties.Count || newIndex < 0) @@ -2110,7 +2082,7 @@ void DeserializeContextData(ContextData contextData, ShaderStage stage) } - private void ReplaceNodeWithNode(AbstractMaterialNode nodeToReplace, AbstractMaterialNode nodeReplacement) + private void ReplaceNodeWithNode(LegacyUnknownTypeNode nodeToReplace, AbstractMaterialNode nodeReplacement) { var oldSlots = new List(); nodeToReplace.GetSlots(oldSlots); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index 5b7d2eee28a..7072d8b70f3 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -117,7 +117,7 @@ public override void CollectPreviewMaterialProperties(List prop public AbstractShaderProperty AsShaderProperty() { - return new ColorShaderProperty{ value = color.color, colorMode = color.mode }; + return new ColorShaderProperty { value = color.color, colorMode = color.mode }; } public int outputSlotId { get { return OutputSlotId; } } diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs index 47e25801d75..89196d4531d 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/InspectorView.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -91,13 +91,7 @@ public void InitializeGraphSettings() // If any of the selected items are no longer selected, inspector requires an update public bool DoesInspectorNeedUpdate() { - var needUpdate = !m_CachedSelectionList.SequenceEqual(selection); - if(graphView is MaterialGraphView mgv && mgv.graph.hasChangedViewData) - { - needUpdate = true; - mgv.graph.hasChangedViewData = false; - } return needUpdate; } diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs index 731d8f715a0..321f897a082 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs @@ -10,7 +10,6 @@ class HelpBoxRow : VisualElement VisualElement m_ContentContainer; VisualElement m_LabelContainer; - protected VisualElement container; public override VisualElement contentContainer { get { return m_ContentContainer; } @@ -19,7 +18,7 @@ public override VisualElement contentContainer public HelpBoxRow(MessageType type) { styleSheets.Add(Resources.Load("Styles/HelpBoxRow")); - container = new VisualElement {name = "container"}; + VisualElement container = new VisualElement {name = "container"}; m_ContentContainer = new VisualElement { name = "content" }; m_LabelContainer = new VisualElement {name = "label" }; diff --git a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs index 1c65b769c07..a7e5619d53d 100644 --- a/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs +++ b/com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs @@ -49,9 +49,7 @@ static Type GetSGPropertyType(AbstractShaderProperty property) { switch (property.propertyType) { - case PropertyType.Color_V0: - return typeof(Color); - case PropertyType.Color_V1: + case PropertyType.Color: return typeof(Color); case PropertyType.Texture2D: return typeof(Texture2D); From 93f27b359287319de818fd5b27cf5db1a851ebe2 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 24 Jul 2020 13:18:50 -0500 Subject: [PATCH 04/34] removing commented out code --- .../ShaderInputPropertyDrawer.cs | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index 6c8ad7e0637..5320c8d08d7 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -506,49 +506,6 @@ void HandleColorProperty(PropertySheet propertySheet, ColorShaderProperty colorP } - //void HandleDeprecatedColorProperty(PropertySheet propertySheet, ColorShaderProperty_V0 colorProperty) - //{ - // var colorPropertyDrawer = new ColorPropertyDrawer(); - // propertySheet.Add(colorPropertyDrawer.CreateGUI( - // newValue => - // { - // this._preChangeValueCallback("Change property value"); - // this._changeValueCallback(newValue); - // this._postChangeValueCallback(); - // }, - // colorProperty.value, - // "Default", - // out var propertyColorField)); - - // var colorField = (ColorField)propertyColorField; - // colorField.hdr = colorProperty.colorMode == ColorMode.HDR; - - // if (!isSubGraph) - // { - // var enumPropertyDrawer = new EnumPropertyDrawer(); - - // propertySheet.Add(enumPropertyDrawer.CreateGUI( - // newValue => - // { - // this._preChangeValueCallback("Change Color Mode"); - // colorProperty.colorMode = (ColorMode)newValue; - // this._postChangeValueCallback(true, ModificationScope.Graph); - // }, - // colorProperty.colorMode, - // "Mode", - // ColorMode.Default, - // out var colorModeField)); - // } - // var dep = new HelpBoxDeprecated("The Color Property has new updates. This version maintains the old behavior. If you update a Color Property, you can use Undo to change it back. See the Color Property documentation for more information.", - // graphData.owner, - // () => - // { - // var newCol = new ColorShaderProperty_V1(colorProperty); - // graphData.AddAndReplaceGraphInput(colorProperty, newCol); - // }); - // propertySheet.Insert(0, dep); - //} - void HandleTexture2DProperty(PropertySheet propertySheet, Texture2DShaderProperty texture2DProperty) { var texture2DPropertyDrawer = new Texture2DPropertyDrawer(); From d5b6bfa0893235988fa3982829d08a9f263ad082 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 24 Jul 2020 16:40:12 -0500 Subject: [PATCH 05/34] code and gui cleanup --- .../ShaderInputPropertyDrawer.cs | 59 ++++++++++++------- .../Drawing/Views/HelpBoxDeprecatedRow.cs | 48 --------------- .../Views/HelpBoxDeprecatedRow.cs.meta | 11 ---- .../Resources/Styles/HelpBoxDeprecatedRow.uss | 56 ------------------ .../Styles/HelpBoxDeprecatedRow.uss.meta | 11 ---- .../Editor/ShaderGraphPreferences.cs | 1 + 6 files changed, 40 insertions(+), 146 deletions(-) delete mode 100644 com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs delete mode 100644 com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs.meta delete mode 100644 com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss delete mode 100644 com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss.meta diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index 5320c8d08d7..66681adfc71 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -94,6 +94,44 @@ public void GetPropertyData( public Action inspectorUpdateDelegate { get; set; } + private void AddDeprecatedVisualElementsIfNeeded(PropertySheet propertySheet, AbstractShaderProperty property) + { + if (property.version < property.latestVersion || (ShaderGraphPreferences.allowDeprecatedBehaviors && property.latestVersion > 0)) + { + var typeString = property.propertyType.ToString(); + HelpBoxRow help; + if (ShaderGraphPreferences.allowDeprecatedBehaviors && property.latestVersion > 0) + { + help = new HelpBoxRow(MessageType.Info); + help.Add(new Label("OVERRIDE: Hover for info") + { + tooltip = $"The {typeString} Property has new updates. This version maintains the old behavior. See the {typeString} Property documentation for more information." + }); + int[] entries = Enumerable.Range(0, property.latestVersion + 1).ToArray(); + help.Add(new IMGUIContainer(() => + { + EditorGUI.BeginChangeCheck(); + int newVersion = EditorGUILayout.IntPopup(property.version, entries.Select(i => i.ToString()).ToArray(), entries); + if(EditorGUI.EndChangeCheck()) + { + property.ChangeVersion(newVersion); + } + })); + } + else + { + help = new HelpBoxRow(MessageType.Warning); + var label = new Label("DEPRECATED: Hover for info") + { + tooltip = $"The {typeString} Property has new updates. This version maintains the old behavior. If you update a {typeString} Property, you can use Undo to change it back. See the {typeString} Property documentation for more information." + }; + help.Add(label); + help.contentContainer.Add(new Button(() => property.ChangeVersion(property.latestVersion)) { text = "Update" } ); + } + propertySheet.Add(help); + } + } + public VisualElement DrawProperty( PropertyInfo propertyInfo, object actualObject, @@ -103,27 +141,8 @@ public VisualElement DrawProperty( shaderInput = actualObject as ShaderInput; if (shaderInput is AbstractShaderProperty property) { - if (property.version < property.latestVersion) - { - var typeString = property.propertyType.ToString(); - if (ShaderGraphPreferences.allowDeprecatedBehaviors) - { - propertySheet.Add(new HelpBoxDeprecated( - $"The {typeString} Property has new updates. This version maintains the old behavior. See the {typeString} Property documentation for more information.", - property.latestVersion, - property.ChangeVersion)); - - } - else - { - - propertySheet.Add(new HelpBoxDeprecated( - $"The {typeString} Property has new updates. This version maintains the old behavior. If you update a {typeString} Property, you can use Undo to change it back. See the {typeString} Property documentation for more information.", - () => property.ChangeVersion(property.latestVersion))); - } - } + AddDeprecatedVisualElementsIfNeeded(propertySheet, property); } - BuildPropertyNameLabel(propertySheet); BuildExposedField(propertySheet); BuildDisplayNameField(propertySheet); diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs deleted file mode 100644 index f17171828eb..00000000000 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Linq; -using UnityEngine; -using UnityEngine.UIElements; - -namespace UnityEditor.ShaderGraph.Drawing -{ - // Similar in function to the old EditorGUILayout.HelpBox - class HelpBoxDeprecated : VisualElement - { - VisualElement m_ContentContainer; - VisualElement m_LabelContainer; - - public override VisualElement contentContainer - { - get { return m_ContentContainer; } - } - - private void Setup() - { - styleSheets.Add(Resources.Load("Styles/HelpBoxDeprecatedRow")); - VisualElement container = new VisualElement { name = "container" }; - m_ContentContainer = new VisualElement { name = "content" }; - m_LabelContainer = new VisualElement { name = "label" }; - - container.AddToClassList("help-box-deprecated-row-style-warning"); - container.Add(m_LabelContainer); - container.Add(m_ContentContainer); - hierarchy.Add(container); - } - - public HelpBoxDeprecated(string tooltip, Action upgrade) - { - Setup(); - var button = new Button(upgrade.Invoke) { text = "Update" }; - var label = new Label("DEPRECATED: Hover for info") { tooltip = tooltip }; - Add(label); - Add(button); - } - - public HelpBoxDeprecated(string tooltip, int numVersions, Action setNewVersion) - { - Setup(); - Add(new Label("Need a way to select version number here")); - //OnVersionSelection setNewVersion(selection); - } - } -} diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs.meta b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs.meta deleted file mode 100644 index 9b5abc62d3c..00000000000 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxDeprecatedRow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5d5e43d7a1f3a85449b64e010b05cc7b -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss b/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss deleted file mode 100644 index 2d38973fb1d..00000000000 --- a/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss +++ /dev/null @@ -1,56 +0,0 @@ -HelpBoxDeprecatedRow > #container{ - flex-grow: 1; - margin-left: 8px; - margin-right: 8px; - padding-left: 8px; - padding-right: 8px; - flex-direction: row; -} - -HelpBoxDeprecatedRow > #container > #label { - width : 20px; - height : 20px; - align-self: center; - margin-right: 8px; -} - -HelpBoxDeprecatedRow > #container > #content { - flex-grow: 1; - justify-content: center; -} - -HelpBoxDeprecatedRow > * -{ - color:#584308; - white-space: normal; -} - -.help-box-deprecated-row-style-info -{ - background-color: #6ed7fc; -} - -.help-box-deprecated-row-style-info #label -{ - background-image : resource("console.infoicon"); -} - -.help-box-deprecated-row-style-warning -{ - background-color: #fcd76e; -} - -.help-box-deprecated-row-style-warning #label -{ - background-image : resource("console.warnicon"); -} - -.help-box-deprecated-row-style-error -{ - background-color: #fc6e6e; -} - -.help-box-deprecated-row-style-error #label -{ - background-image : resource("console.erroricon"); -} diff --git a/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss.meta b/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss.meta deleted file mode 100644 index 5c6d5ba6627..00000000000 --- a/com.unity.shadergraph/Editor/Resources/Styles/HelpBoxDeprecatedRow.uss.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8bf9f4c67d6efb14791b1fca97eae7cb -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} - disableValidation: 0 diff --git a/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs b/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs index 7574bdea913..70e402086a1 100644 --- a/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs +++ b/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs @@ -93,6 +93,7 @@ static void Load() { m_VariantLimit = EditorPrefs.GetInt(Keys.variantLimit, 128); m_AutoAddRemoveBlocks = EditorPrefs.GetBool(Keys.autoAddRemoveBlocks, true); + m_AllowDeprecatedBehaviors = EditorPrefs.GetBool(Keys.allowDeprecatedBehaviors, false); m_Loaded = true; } From ad44172c4be5072034841153eb6fb9eac08fd4f2 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Wed, 29 Jul 2020 11:43:54 -0500 Subject: [PATCH 06/34] changing behavior to not allow updating individual nodes, not display deprecated warnings when flag is checked, and allow creation of both deprecated and latest color properties --- .../Editor/Data/Graphs/ColorMaterialSlot.cs | 2 +- .../Data/Graphs/ColorRGBMaterialSlot.cs | 2 +- .../Editor/Data/Graphs/ColorShaderProperty.cs | 1 + .../Data/Nodes/Input/Basic/ColorNode.cs | 4 +- .../Drawing/Blackboard/BlackboardProvider.cs | 6 +- .../ShaderInputPropertyDrawer.cs | 58 +++++-------------- 6 files changed, 25 insertions(+), 48 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs index 8c9c6781654..cc65a3a7f66 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs @@ -48,7 +48,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation if (matOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - var property = new ColorShaderProperty() + var property = new ColorShaderProperty(1) { overrideReferenceName = matOwner.GetVariableNameForSlot(id), generatePropertyBlock = false, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs index 7cf37bcdcbb..80fac34bcec 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs @@ -58,7 +58,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation if (matOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - var property = new ColorShaderProperty() + var property = new ColorShaderProperty(1) { overrideReferenceName = matOwner.GetVariableNameForSlot(id), generatePropertyBlock = false, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index 6b80c0bf7e6..9bdd829e294 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -77,6 +77,7 @@ internal override ShaderInput Copy() { return new ColorShaderProperty() { + version = version, displayName = displayName, hidden = hidden, value = value, diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index 7072d8b70f3..658ee49e119 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -79,7 +79,7 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener if (!generationMode.IsPreview()) return; - properties.AddShaderProperty(new ColorShaderProperty() + properties.AddShaderProperty(new ColorShaderProperty(1) { overrideReferenceName = GetVariableNameForNode(), generatePropertyBlock = false, @@ -117,7 +117,7 @@ public override void CollectPreviewMaterialProperties(List prop public AbstractShaderProperty AsShaderProperty() { - return new ColorShaderProperty { value = color.color, colorMode = color.mode }; + return new ColorShaderProperty(1) { value = color.color, colorMode = color.mode }; } public int outputSlotId { get { return OutputSlotId; } } diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs index ba22e76cc16..7d927d5a1e6 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs @@ -206,7 +206,11 @@ void AddPropertyItems(GenericMenu gm) gm.AddItem(new GUIContent($"Vector2"), false, () => AddInputRow(new Vector2ShaderProperty(), true)); gm.AddItem(new GUIContent($"Vector3"), false, () => AddInputRow(new Vector3ShaderProperty(), true)); gm.AddItem(new GUIContent($"Vector4"), false, () => AddInputRow(new Vector4ShaderProperty(), true)); - gm.AddItem(new GUIContent($"Color"), false, () => AddInputRow(new ColorShaderProperty(), true)); + gm.AddItem(new GUIContent($"Color"), false, () => AddInputRow(new ColorShaderProperty(1), true)); + if(ShaderGraphPreferences.allowDeprecatedBehaviors) + { + gm.AddItem(new GUIContent($"Color (Deprecated)"), false, () => AddInputRow(new ColorShaderProperty(0), true)); + } gm.AddItem(new GUIContent($"Texture2D"), false, () => AddInputRow(new Texture2DShaderProperty(), true)); gm.AddItem(new GUIContent($"Texture2D Array"), false, () => AddInputRow(new Texture2DArrayShaderProperty(), true)); gm.AddItem(new GUIContent($"Texture3D"), false, () => AddInputRow(new Texture3DShaderProperty(), true)); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index 66681adfc71..5925d56e80f 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -94,44 +94,6 @@ public void GetPropertyData( public Action inspectorUpdateDelegate { get; set; } - private void AddDeprecatedVisualElementsIfNeeded(PropertySheet propertySheet, AbstractShaderProperty property) - { - if (property.version < property.latestVersion || (ShaderGraphPreferences.allowDeprecatedBehaviors && property.latestVersion > 0)) - { - var typeString = property.propertyType.ToString(); - HelpBoxRow help; - if (ShaderGraphPreferences.allowDeprecatedBehaviors && property.latestVersion > 0) - { - help = new HelpBoxRow(MessageType.Info); - help.Add(new Label("OVERRIDE: Hover for info") - { - tooltip = $"The {typeString} Property has new updates. This version maintains the old behavior. See the {typeString} Property documentation for more information." - }); - int[] entries = Enumerable.Range(0, property.latestVersion + 1).ToArray(); - help.Add(new IMGUIContainer(() => - { - EditorGUI.BeginChangeCheck(); - int newVersion = EditorGUILayout.IntPopup(property.version, entries.Select(i => i.ToString()).ToArray(), entries); - if(EditorGUI.EndChangeCheck()) - { - property.ChangeVersion(newVersion); - } - })); - } - else - { - help = new HelpBoxRow(MessageType.Warning); - var label = new Label("DEPRECATED: Hover for info") - { - tooltip = $"The {typeString} Property has new updates. This version maintains the old behavior. If you update a {typeString} Property, you can use Undo to change it back. See the {typeString} Property documentation for more information." - }; - help.Add(label); - help.contentContainer.Add(new Button(() => property.ChangeVersion(property.latestVersion)) { text = "Update" } ); - } - propertySheet.Add(help); - } - } - public VisualElement DrawProperty( PropertyInfo propertyInfo, object actualObject, @@ -139,10 +101,6 @@ public VisualElement DrawProperty( { var propertySheet = new PropertySheet(); shaderInput = actualObject as ShaderInput; - if (shaderInput is AbstractShaderProperty property) - { - AddDeprecatedVisualElementsIfNeeded(propertySheet, property); - } BuildPropertyNameLabel(propertySheet); BuildExposedField(propertySheet); BuildDisplayNameField(propertySheet); @@ -254,7 +212,21 @@ void BuildPropertyFields(PropertySheet propertySheet) if(property == null) return; - switch(property) + if (property.version < property.latestVersion && !ShaderGraphPreferences.allowDeprecatedBehaviors) + { + var typeString = property.propertyType.ToString(); + HelpBoxRow help; + help = new HelpBoxRow(MessageType.Warning); + var label = new Label("DEPRECATED: Hover for info") + { + tooltip = $"The {typeString} Property has new updates. This version maintains the old behavior. If you update a {typeString} Property, you can use Undo to change it back. See the {typeString} Property documentation for more information." + }; + help.Add(label); + help.contentContainer.Add(new Button(() => property.ChangeVersion(property.latestVersion)) { text = "Update" }); + propertySheet.Insert(0,help); + } + + switch (property) { case Vector1ShaderProperty vector1Property: HandleVector1ShaderProperty(propertySheet, vector1Property); From 69f52e856f015b40d87b131c76fd9dfbb0c766ce Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Thu, 30 Jul 2020 14:38:42 -0500 Subject: [PATCH 07/34] moving version number to JsonObject --- .../Data/Graphs/AbstractShaderProperty.cs | 29 ----------------- .../Editor/Data/Graphs/ColorMaterialSlot.cs | 2 +- .../Data/Graphs/ColorRGBMaterialSlot.cs | 2 +- .../Editor/Data/Graphs/ColorShaderProperty.cs | 2 +- .../Editor/Data/Nodes/AbstractMaterialNode.cs | 6 ++-- .../Data/Nodes/Input/Basic/ColorNode.cs | 4 +-- .../Editor/Data/Nodes/Input/PropertyNode.cs | 17 +++++----- .../Drawing/Blackboard/BlackboardProvider.cs | 2 +- .../Editor/Serialization/JsonObject.cs | 31 +++++++++++++++++++ .../Editor/Serialization/MultiJsonInternal.cs | 4 ++- .../Editor/ShaderGraphPreferences.cs | 2 +- 11 files changed, 54 insertions(+), 47 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs index a7f1a8d5ea5..026f42eb89f 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs @@ -8,35 +8,6 @@ namespace UnityEditor.ShaderGraph.Internal public abstract class AbstractShaderProperty : ShaderInput { - public virtual int latestVersion { get; } = 0; - public virtual int version { get; protected set; } = 0; - - internal protected delegate void VersionChange(int newVersion); - internal protected VersionChange onBeforeVersionChange; - internal protected Action onAfterVersionChange; - - internal void ChangeVersion(int newVersion) - { - if(newVersion == version) - { - return; - } - if(newVersion < 0) - { - Debug.LogError("Cant downgrade past version 0"); - return; - } - if(newVersion > latestVersion) - { - Debug.LogError("Cant upgrade to a version >= the current latest version"); - return; - } - - onBeforeVersionChange?.Invoke(newVersion); - version = newVersion; - onAfterVersionChange?.Invoke(); - } - public abstract PropertyType propertyType { get; } internal override ConcreteSlotValueType concreteShaderValueType => propertyType.ToConcreteShaderValueType(); diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs index cc65a3a7f66..8c9c6781654 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorMaterialSlot.cs @@ -48,7 +48,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation if (matOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - var property = new ColorShaderProperty(1) + var property = new ColorShaderProperty() { overrideReferenceName = matOwner.GetVariableNameForSlot(id), generatePropertyBlock = false, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs index 80fac34bcec..7cf37bcdcbb 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorRGBMaterialSlot.cs @@ -58,7 +58,7 @@ public override void AddDefaultProperty(PropertyCollector properties, Generation if (matOwner == null) throw new Exception(string.Format("Slot {0} either has no owner, or the owner is not a {1}", this, typeof(AbstractMaterialNode))); - var property = new ColorShaderProperty(1) + var property = new ColorShaderProperty() { overrideReferenceName = matOwner.GetVariableNameForSlot(id), generatePropertyBlock = false, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index 9bdd829e294..14b484ff3aa 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -23,7 +23,7 @@ public override int version internal ColorShaderProperty() { displayName = "Color"; - version = 0; + version = latestVersion; } internal ColorShaderProperty(int version) : base() diff --git a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index 2ab23c77975..e2783a4c6d5 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -310,7 +310,7 @@ protected AbstractMaterialNode() { m_DrawState.expanded = true; m_NodeVersion = GetCompiledNodeVersion(); - version = 0; + internalVersion = 0; } public void GetInputSlots(List foundSlots) where T : MaterialSlot @@ -677,7 +677,7 @@ public virtual void Concretize() EvaluateDynamicMaterialSlots(); if(!hasError) { - ++version; + ++internalVersion; } } @@ -686,7 +686,7 @@ public virtual void ValidateNode() } - public int version { get; set; } + public int internalVersion { get; set; } public virtual bool canCutNode => true; public virtual bool canCopyNode => true; diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index 658ee49e119..ebd13430c77 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -79,7 +79,7 @@ public override void CollectShaderProperties(PropertyCollector properties, Gener if (!generationMode.IsPreview()) return; - properties.AddShaderProperty(new ColorShaderProperty(1) + properties.AddShaderProperty(new ColorShaderProperty() { overrideReferenceName = GetVariableNameForNode(), generatePropertyBlock = false, @@ -117,7 +117,7 @@ public override void CollectPreviewMaterialProperties(List prop public AbstractShaderProperty AsShaderProperty() { - return new ColorShaderProperty(1) { value = color.color, colorMode = color.mode }; + return new ColorShaderProperty() { value = color.color, colorMode = color.mode }; } public int outputSlotId { get { return OutputSlotId; } } diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs index e48d9670c76..007406586f9 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs @@ -133,7 +133,7 @@ void AddOutputSlot() public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode) { - switch(property.propertyType) + switch (property.propertyType) { case PropertyType.Boolean: sb.AppendLine($"$precision {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); @@ -151,13 +151,16 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); break; case PropertyType.Color: - if (property.version == 0) + switch (property.version) { - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); - } - else - { - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? {property.referenceName} : SRGBToLinear({property.referenceName});"); + case 0: + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + break; + case 1: + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? {property.referenceName} : SRGBToLinear({property.referenceName});"); + break; + default: + throw new Exception($"Unknown Color Property Version on property {property.displayName}"); } break; case PropertyType.Matrix2: diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs index 7d927d5a1e6..02467f5557c 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardProvider.cs @@ -206,7 +206,7 @@ void AddPropertyItems(GenericMenu gm) gm.AddItem(new GUIContent($"Vector2"), false, () => AddInputRow(new Vector2ShaderProperty(), true)); gm.AddItem(new GUIContent($"Vector3"), false, () => AddInputRow(new Vector3ShaderProperty(), true)); gm.AddItem(new GUIContent($"Vector4"), false, () => AddInputRow(new Vector4ShaderProperty(), true)); - gm.AddItem(new GUIContent($"Color"), false, () => AddInputRow(new ColorShaderProperty(1), true)); + gm.AddItem(new GUIContent($"Color"), false, () => AddInputRow(new ColorShaderProperty(), true)); if(ShaderGraphPreferences.allowDeprecatedBehaviors) { gm.AddItem(new GUIContent($"Color (Deprecated)"), false, () => AddInputRow(new ColorShaderProperty(0), true)); diff --git a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs index ff67e4dc607..017d57768ca 100644 --- a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs +++ b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs @@ -6,6 +6,37 @@ namespace UnityEditor.ShaderGraph.Serialization [Serializable] public class JsonObject : ISerializationCallbackReceiver { + + + public virtual int latestVersion { get; } = 0; + public virtual int version { get; protected set; } = 0; + + internal protected delegate void VersionChange(int newVersion); + internal protected VersionChange onBeforeVersionChange; + internal protected Action onAfterVersionChange; + + internal void ChangeVersion(int newVersion) + { + if (newVersion == version) + { + return; + } + if (newVersion < 0) + { + Debug.LogError("Cant downgrade past version 0"); + return; + } + if (newVersion > latestVersion) + { + Debug.LogError("Cant upgrade to a version >= the current latest version"); + return; + } + + onBeforeVersionChange?.Invoke(newVersion); + version = newVersion; + onAfterVersionChange?.Invoke(); + } + public static readonly string emptyObjectId = Guid.Empty.ToString("N"); [SerializeField] diff --git a/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs b/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs index 204407c4f31..a6da5b384ed 100644 --- a/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs +++ b/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs @@ -361,7 +361,9 @@ public static JsonObject CreateInstance(string typeString) { return new UnknownJsonObject(typeString); } - return (JsonObject)Activator.CreateInstance(type, true); + var output = (JsonObject)Activator.CreateInstance(type, true); + output.ChangeVersion(0); + return output; } private static FieldInfo s_ObjectIdField = diff --git a/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs b/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs index 70e402086a1..c7d33881f84 100644 --- a/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs +++ b/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs @@ -80,7 +80,7 @@ static void OpenGUI() } EditorGUI.BeginChangeCheck(); - var allowDeprecatedBehaviorsValue = EditorGUILayout.Toggle("Allow the use of deprecated versions of properties and nodes", allowDeprecatedBehaviors); + var allowDeprecatedBehaviorsValue = EditorGUILayout.Toggle("Enable Deprecated Nodes", allowDeprecatedBehaviors); if(EditorGUI.EndChangeCheck()) { allowDeprecatedBehaviors = allowDeprecatedBehaviorsValue; From 8f587eba18a1a596e8c10f188f7cf399ce22f59f Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Mon, 3 Aug 2020 15:05:33 -0500 Subject: [PATCH 08/34] adding deprecated color property and current color property to input tests, and minor bugfix --- .../Direct3D11/None/InputNodes.png | 4 +- .../Direct3D11/None/InputNodes.png.meta | 8 +- .../Assets/Scenes/InputNodes.unity | 251 ++- .../Graphs/Input/Basic/ColorNode.mat | 5 +- .../Graphs/Input/Basic/ColorNode.shadergraph | 1504 ++++++++++++++++- .../Editor/Data/Graphs/ColorShaderProperty.cs | 2 +- 6 files changed, 1746 insertions(+), 28 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png index 82ca835e1d8..d93231790c0 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b8bf134ff1c3dd180a22629efd180352a029684c29c608ce48a9a0bc2f35072 -size 502183 +oid sha256:616d9f228f91ddd380201dac391542ab0484b196f7c8ab5cd22ce5785473985b +size 502983 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta index 07e023f7f1a..ca6c9f2c014 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 89dfd49511d0a0941b6e58d0ba940126 +guid: fd0ee7bdcc033f149a590cb46eebf92c TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 10 + serializedVersion: 11 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -23,6 +23,7 @@ TextureImporter: isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -54,10 +55,13 @@ TextureImporter: 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 diff --git a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity index 6c59d4c1004..49370b6291a 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity @@ -43,7 +43,7 @@ RenderSettings: --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 12 m_GIWorkflowMode: 1 m_GISettings: serializedVersion: 2 @@ -99,7 +99,8 @@ LightmapSettings: m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 112000000, guid: ccd04a1b46622d842a16aa4d9df371fa, type: 2} - m_UseShadowmask: 0 + m_LightingSettings: {fileID: 4890085278179872738, guid: dcdd55ec8bc23564495b923650dd31ef, + type: 2} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -119,6 +120,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} @@ -169,6 +172,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -193,6 +197,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &577818 MeshFilter: m_ObjectHideFlags: 0 @@ -263,6 +268,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -287,6 +293,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1221712 SphereCollider: m_ObjectHideFlags: 0 @@ -356,6 +363,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -380,6 +388,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &17182308 SphereCollider: m_ObjectHideFlags: 0 @@ -448,6 +457,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -472,6 +482,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &29891251 MeshFilter: m_ObjectHideFlags: 0 @@ -542,6 +553,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -566,6 +578,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &42793508 SphereCollider: m_ObjectHideFlags: 0 @@ -635,6 +648,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -659,6 +673,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &53016697 SphereCollider: m_ObjectHideFlags: 0 @@ -728,6 +743,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -752,6 +768,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &83771984 SphereCollider: m_ObjectHideFlags: 0 @@ -821,6 +838,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -845,6 +863,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &97661565 SphereCollider: m_ObjectHideFlags: 0 @@ -914,6 +933,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -938,6 +958,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &100390684 SphereCollider: m_ObjectHideFlags: 0 @@ -1044,6 +1065,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1068,6 +1090,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &147557062 MeshFilter: m_ObjectHideFlags: 0 @@ -1138,6 +1161,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1162,6 +1186,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &172255954 SphereCollider: m_ObjectHideFlags: 0 @@ -1231,6 +1256,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1255,6 +1281,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &207413613 SphereCollider: m_ObjectHideFlags: 0 @@ -1324,6 +1351,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1348,6 +1376,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &212523233 SphereCollider: m_ObjectHideFlags: 0 @@ -1417,6 +1446,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1441,6 +1471,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &227977878 SphereCollider: m_ObjectHideFlags: 0 @@ -1509,6 +1540,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1533,6 +1565,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &238486951 MeshFilter: m_ObjectHideFlags: 0 @@ -1548,13 +1581,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 238486948} - m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} + m_LocalRotation: {x: -0.4055798, y: 0.4055798, z: -0.579228, w: -0.579228} m_LocalPosition: {x: -4, y: 0, z: -2} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 303484558} m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: -90, y: 180, z: -90} + m_LocalEulerAnglesHint: {x: 110, y: 180, z: -90} --- !u!1 &242909116 GameObject: m_ObjectHideFlags: 0 @@ -1663,6 +1696,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1687,6 +1721,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &250086848 SphereCollider: m_ObjectHideFlags: 0 @@ -1756,6 +1791,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1780,6 +1816,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &283589528 SphereCollider: m_ObjectHideFlags: 0 @@ -1849,6 +1886,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1873,6 +1911,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &285294294 SphereCollider: m_ObjectHideFlags: 0 @@ -1992,6 +2031,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2016,6 +2056,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &315644276 SphereCollider: m_ObjectHideFlags: 0 @@ -2139,6 +2180,8 @@ MonoBehaviour: PerPixelCorrectnessThreshold: 0.00075 AverageCorrectnessThreshold: 0.0001 UseHDR: 0 + UseBackBuffer: 0 + ImageResolution: 0 WaitFrames: 2 --- !u!1 &366823146 GameObject: @@ -2234,6 +2277,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2258,6 +2302,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &371422991 SphereCollider: m_ObjectHideFlags: 0 @@ -2327,6 +2372,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2351,6 +2397,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &414293742 SphereCollider: m_ObjectHideFlags: 0 @@ -2420,6 +2467,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2444,6 +2492,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &414435822 SphereCollider: m_ObjectHideFlags: 0 @@ -2513,6 +2562,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2537,6 +2587,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &460208045 SphereCollider: m_ObjectHideFlags: 0 @@ -2606,6 +2657,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2630,6 +2682,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &462242930 SphereCollider: m_ObjectHideFlags: 0 @@ -2699,6 +2752,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2723,6 +2777,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &480521287 SphereCollider: m_ObjectHideFlags: 0 @@ -2792,6 +2847,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2816,6 +2872,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &485539996 SphereCollider: m_ObjectHideFlags: 0 @@ -2929,6 +2986,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2953,6 +3011,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &507897637 SphereCollider: m_ObjectHideFlags: 0 @@ -3022,6 +3081,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3046,6 +3106,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &510972452 SphereCollider: m_ObjectHideFlags: 0 @@ -3115,6 +3176,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3139,6 +3201,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &513781238 SphereCollider: m_ObjectHideFlags: 0 @@ -3208,6 +3271,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3232,6 +3296,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &524449750 SphereCollider: m_ObjectHideFlags: 0 @@ -3301,6 +3366,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3325,6 +3391,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &529652658 SphereCollider: m_ObjectHideFlags: 0 @@ -3394,6 +3461,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3418,6 +3486,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &574756866 SphereCollider: m_ObjectHideFlags: 0 @@ -3487,6 +3556,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3511,6 +3581,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &582133713 SphereCollider: m_ObjectHideFlags: 0 @@ -3580,6 +3651,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3604,6 +3676,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &585441713 SphereCollider: m_ObjectHideFlags: 0 @@ -3720,6 +3793,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3744,6 +3818,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &628137915 SphereCollider: m_ObjectHideFlags: 0 @@ -3812,6 +3887,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3836,6 +3912,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &644476904 MeshFilter: m_ObjectHideFlags: 0 @@ -3906,6 +3983,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -3930,6 +4008,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &661742760 SphereCollider: m_ObjectHideFlags: 0 @@ -3999,6 +4078,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4023,6 +4103,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &697337480 SphereCollider: m_ObjectHideFlags: 0 @@ -4092,6 +4173,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4116,6 +4198,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &715693414 SphereCollider: m_ObjectHideFlags: 0 @@ -4184,6 +4267,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4208,6 +4292,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &735557293 MeshFilter: m_ObjectHideFlags: 0 @@ -4278,6 +4363,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4302,6 +4388,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &738840891 SphereCollider: m_ObjectHideFlags: 0 @@ -4370,6 +4457,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4394,6 +4482,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &770505458 MeshFilter: m_ObjectHideFlags: 0 @@ -4464,6 +4553,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4488,6 +4578,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &801207487 SphereCollider: m_ObjectHideFlags: 0 @@ -4557,6 +4648,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4581,6 +4673,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &804860715 SphereCollider: m_ObjectHideFlags: 0 @@ -4650,6 +4743,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4674,6 +4768,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &820177706 SphereCollider: m_ObjectHideFlags: 0 @@ -4743,6 +4838,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4767,6 +4863,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &840653960 SphereCollider: m_ObjectHideFlags: 0 @@ -4836,6 +4933,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4860,6 +4958,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &841185861 SphereCollider: m_ObjectHideFlags: 0 @@ -4929,6 +5028,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -4953,6 +5053,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &853683123 SphereCollider: m_ObjectHideFlags: 0 @@ -5022,6 +5123,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5046,6 +5148,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &871278867 SphereCollider: m_ObjectHideFlags: 0 @@ -5115,6 +5218,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5139,6 +5243,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &919728591 SphereCollider: m_ObjectHideFlags: 0 @@ -5208,6 +5313,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5232,6 +5338,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &925157437 SphereCollider: m_ObjectHideFlags: 0 @@ -5301,6 +5408,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5325,6 +5433,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &991341885 SphereCollider: m_ObjectHideFlags: 0 @@ -5394,6 +5503,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5418,6 +5528,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1029832736 SphereCollider: m_ObjectHideFlags: 0 @@ -5487,6 +5598,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5511,6 +5623,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1029851379 SphereCollider: m_ObjectHideFlags: 0 @@ -5580,6 +5693,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5604,6 +5718,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1050940237 SphereCollider: m_ObjectHideFlags: 0 @@ -5672,6 +5787,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5696,6 +5812,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1051528461 MeshFilter: m_ObjectHideFlags: 0 @@ -5766,6 +5883,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5790,6 +5908,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1059825223 SphereCollider: m_ObjectHideFlags: 0 @@ -5859,6 +5978,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5883,6 +6003,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1077364020 SphereCollider: m_ObjectHideFlags: 0 @@ -5952,6 +6073,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5976,6 +6098,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1114000236 SphereCollider: m_ObjectHideFlags: 0 @@ -6045,6 +6168,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6069,6 +6193,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1126344843 SphereCollider: m_ObjectHideFlags: 0 @@ -6138,6 +6263,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6162,6 +6288,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1136984179 SphereCollider: m_ObjectHideFlags: 0 @@ -6231,6 +6358,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6255,6 +6383,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1182234435 SphereCollider: m_ObjectHideFlags: 0 @@ -6324,6 +6453,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6348,6 +6478,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1222953126 SphereCollider: m_ObjectHideFlags: 0 @@ -6417,6 +6548,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6441,6 +6573,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1235329771 SphereCollider: m_ObjectHideFlags: 0 @@ -6510,6 +6643,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6534,6 +6668,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1290363524 SphereCollider: m_ObjectHideFlags: 0 @@ -6603,6 +6738,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6627,6 +6763,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1290626768 SphereCollider: m_ObjectHideFlags: 0 @@ -6695,6 +6832,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6719,6 +6857,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1311165579 MeshFilter: m_ObjectHideFlags: 0 @@ -6789,6 +6928,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6813,6 +6953,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1315568619 SphereCollider: m_ObjectHideFlags: 0 @@ -6882,6 +7023,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6906,6 +7048,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1322529935 SphereCollider: m_ObjectHideFlags: 0 @@ -6975,6 +7118,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -6999,6 +7143,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1324643245 SphereCollider: m_ObjectHideFlags: 0 @@ -7068,6 +7213,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7092,6 +7238,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1327032209 SphereCollider: m_ObjectHideFlags: 0 @@ -7161,6 +7308,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7185,6 +7333,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1343815778 SphereCollider: m_ObjectHideFlags: 0 @@ -7254,6 +7403,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7278,6 +7428,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1383437970 SphereCollider: m_ObjectHideFlags: 0 @@ -7347,6 +7498,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7371,6 +7523,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1425383531 SphereCollider: m_ObjectHideFlags: 0 @@ -7475,6 +7628,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7499,6 +7653,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1452926176 SphereCollider: m_ObjectHideFlags: 0 @@ -7568,6 +7723,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7592,6 +7748,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1462505747 SphereCollider: m_ObjectHideFlags: 0 @@ -7661,6 +7818,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7685,6 +7843,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1467200803 SphereCollider: m_ObjectHideFlags: 0 @@ -7754,6 +7913,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7778,6 +7938,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1469504154 SphereCollider: m_ObjectHideFlags: 0 @@ -7847,6 +8008,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7871,6 +8033,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1471236226 SphereCollider: m_ObjectHideFlags: 0 @@ -7939,6 +8102,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -7963,6 +8127,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1475762080 MeshFilter: m_ObjectHideFlags: 0 @@ -8032,6 +8197,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8056,6 +8222,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1506539578 MeshFilter: m_ObjectHideFlags: 0 @@ -8126,6 +8293,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8150,6 +8318,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1536751011 SphereCollider: m_ObjectHideFlags: 0 @@ -8219,6 +8388,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8243,6 +8413,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1545791080 SphereCollider: m_ObjectHideFlags: 0 @@ -8348,6 +8519,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8372,6 +8544,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1606512716 SphereCollider: m_ObjectHideFlags: 0 @@ -8441,6 +8614,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8465,6 +8639,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1610334440 SphereCollider: m_ObjectHideFlags: 0 @@ -8533,6 +8708,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8557,6 +8733,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1619359163 MeshFilter: m_ObjectHideFlags: 0 @@ -8627,6 +8804,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8651,6 +8829,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1701306557 SphereCollider: m_ObjectHideFlags: 0 @@ -8720,6 +8899,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8744,6 +8924,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1704958866 SphereCollider: m_ObjectHideFlags: 0 @@ -8877,6 +9058,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8901,6 +9083,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1718807272 SphereCollider: m_ObjectHideFlags: 0 @@ -8969,6 +9152,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -8993,6 +9177,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1739134292 MeshFilter: m_ObjectHideFlags: 0 @@ -9063,6 +9248,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9087,6 +9273,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1765169125 SphereCollider: m_ObjectHideFlags: 0 @@ -9156,6 +9343,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9180,6 +9368,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1770065823 SphereCollider: m_ObjectHideFlags: 0 @@ -9248,6 +9437,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9272,6 +9462,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1770552485 MeshFilter: m_ObjectHideFlags: 0 @@ -9342,6 +9533,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9366,6 +9558,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1785428293 SphereCollider: m_ObjectHideFlags: 0 @@ -9435,6 +9628,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9459,6 +9653,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1787014627 SphereCollider: m_ObjectHideFlags: 0 @@ -9528,6 +9723,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9552,6 +9748,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1806418204 SphereCollider: m_ObjectHideFlags: 0 @@ -9620,6 +9817,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9644,6 +9842,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1808814367 MeshFilter: m_ObjectHideFlags: 0 @@ -9713,6 +9912,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9737,6 +9937,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1813021371 MeshFilter: m_ObjectHideFlags: 0 @@ -9806,6 +10007,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9830,6 +10032,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1824269726 MeshFilter: m_ObjectHideFlags: 0 @@ -9900,6 +10103,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9924,6 +10128,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1840713833 SphereCollider: m_ObjectHideFlags: 0 @@ -9993,6 +10198,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10017,6 +10223,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1856304762 SphereCollider: m_ObjectHideFlags: 0 @@ -10086,6 +10293,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10110,6 +10318,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1887502894 SphereCollider: m_ObjectHideFlags: 0 @@ -10178,6 +10387,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10202,6 +10412,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1888281877 MeshFilter: m_ObjectHideFlags: 0 @@ -10272,6 +10483,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10296,6 +10508,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1889255734 SphereCollider: m_ObjectHideFlags: 0 @@ -10365,6 +10578,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10389,6 +10603,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1894348793 SphereCollider: m_ObjectHideFlags: 0 @@ -10458,6 +10673,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10482,6 +10698,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1908664928 SphereCollider: m_ObjectHideFlags: 0 @@ -10550,6 +10767,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10574,6 +10792,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1909678460 MeshFilter: m_ObjectHideFlags: 0 @@ -10644,6 +10863,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10668,6 +10888,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1926593707 SphereCollider: m_ObjectHideFlags: 0 @@ -10737,6 +10958,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10761,6 +10983,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1947256755 SphereCollider: m_ObjectHideFlags: 0 @@ -10871,6 +11094,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10895,6 +11119,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1976893047 SphereCollider: m_ObjectHideFlags: 0 @@ -10964,6 +11189,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -10988,6 +11214,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1981582517 SphereCollider: m_ObjectHideFlags: 0 @@ -11057,6 +11284,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -11081,6 +11309,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &1990772824 SphereCollider: m_ObjectHideFlags: 0 @@ -11150,6 +11379,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -11174,6 +11404,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &2006496221 SphereCollider: m_ObjectHideFlags: 0 @@ -11243,6 +11474,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -11267,6 +11499,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &2011343687 SphereCollider: m_ObjectHideFlags: 0 @@ -11336,6 +11569,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -11360,6 +11594,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &2048688198 SphereCollider: m_ObjectHideFlags: 0 @@ -11428,6 +11663,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -11452,6 +11688,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &2064675060 MeshFilter: m_ObjectHideFlags: 0 @@ -11522,6 +11759,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -11546,6 +11784,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &2076468049 SphereCollider: m_ObjectHideFlags: 0 @@ -11615,6 +11854,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -11639,6 +11879,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &2087670892 SphereCollider: m_ObjectHideFlags: 0 @@ -11708,6 +11949,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -11732,6 +11974,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!135 &2140997635 SphereCollider: m_ObjectHideFlags: 0 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.mat index 2ec363d4d89..b6d3fc3ca34 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.mat +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.mat @@ -21,4 +21,7 @@ Material: serializedVersion: 3 m_TexEnvs: [] m_Floats: [] - m_Colors: [] + m_Colors: + - Color_8cec592cd4184ffcae31bb4968a07592: {r: 0.5471698, g: 0, b: 0, a: 0} + - Color_9cbb7d0f6a9f4600a30ce1093efb115f: {r: 0.5471698, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph index c9bce406051..b3c6338a91c 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph @@ -1,29 +1,241 @@ { - "m_SerializedProperties": [], - "m_SerializableNodes": [ + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "f9530e754b39480689640fe72a2f3184", + "m_Version": 2, + "m_Properties": [ { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.UnlitMasterNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"3645aff8-5a45-4516-8b45-2380b21d7ec5\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Unlit Master\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 67.0,\n \"y\": 136.0,\n \"width\": 200.0,\n \"height\": 149.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.PositionMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 9,\\n \\\"m_DisplayName\\\": \\\"Position\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Position\\\",\\n \\\"m_StageCapability\\\": 1,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ColorRGBMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Color\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Color\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.5,\\n \\\"y\\\": 0.5,\\n \\\"z\\\": 0.5\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_ColorMode\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"Alpha\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Alpha\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 1.0,\\n \\\"m_DefaultValue\\\": 1.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 8,\\n \\\"m_DisplayName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.5,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_SerializableSubShaders\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.Rendering.Universal.UniversalUnlitSubShader\"\n },\n \"JSONnodeData\": \"{}\"\n }\n ],\n \"m_SurfaceType\": 0,\n \"m_AlphaMode\": 0,\n \"m_TwoSided\": false,\n \"m_AddVelocityChange\": false\n}" + "m_Id": "9cbb7d0f6a9f4600a30ce1093efb115f" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.ColorNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"123589aa-c28c-44b6-89ae-b1d16933f7be\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Color\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -355.5,\n \"y\": 110.49996948242188,\n \"width\": 0.0,\n \"height\": 0.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_Color\": {\n \"color\": {\n \"r\": 0.9528301954269409,\n \"g\": 0.04494481533765793,\n \"b\": 0.04494481533765793,\n \"a\": 0.0\n },\n \"mode\": 0\n }\n}" + "m_Id": "8cec592cd4184ffcae31bb4968a07592" + } + ], + "m_Keywords": [], + "m_Nodes": [ + { + "m_Id": "e9764189650c4bf19b67df5739c5bc7c" + }, + { + "m_Id": "3b9ac9422a07454fa54965bd3f291803" + }, + { + "m_Id": "a36c2d8a7f6f428ca1c777fdfad16e3f" + }, + { + "m_Id": "210252ce2e9241c2845a6cfe4739d2c9" + }, + { + "m_Id": "f6a451b4d3c2482984b1e4d50d61dbe5" + }, + { + "m_Id": "a2bfc40d2d344b4a9b02ba2c2053694d" + }, + { + "m_Id": "0b238d3b3c804a81ab6f272addc36d58" + }, + { + "m_Id": "d7bd3dec13d141d6a4d0e3d74079f7e6" + }, + { + "m_Id": "eb89254fdc994b87850a8e471d775574" + }, + { + "m_Id": "adf6b827ef4a47f89fd648d56316af83" + }, + { + "m_Id": "34631918f8cc49bb8345e1f279902150" + }, + { + "m_Id": "26923fa85dc6475cb9c31a860adeaf89" + }, + { + "m_Id": "57cff171b45849f697f013e0e124896f" + }, + { + "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + }, + { + "m_Id": "0ed0d756daa34e93b979108bcfa7ae3f" } ], - "m_Groups": [], - "m_StickyNotes": [], - "m_SerializableEdges": [ + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "0ed0d756daa34e93b979108bcfa7ae3f" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + }, + "m_SlotId": 1 + } + }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "26923fa85dc6475cb9c31a860adeaf89" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"123589aa-c28c-44b6-89ae-b1d16933f7be\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"3645aff8-5a45-4516-8b45-2380b21d7ec5\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "57cff171b45849f697f013e0e124896f" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "34631918f8cc49bb8345e1f279902150" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "57cff171b45849f697f013e0e124896f" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "adf6b827ef4a47f89fd648d56316af83" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "57cff171b45849f697f013e0e124896f" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d7bd3dec13d141d6a4d0e3d74079f7e6" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "eb89254fdc994b87850a8e471d775574" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f6a451b4d3c2482984b1e4d50d61dbe5" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e9764189650c4bf19b67df5739c5bc7c" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "57cff171b45849f697f013e0e124896f" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "eb89254fdc994b87850a8e471d775574" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "34631918f8cc49bb8345e1f279902150" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "eb89254fdc994b87850a8e471d775574" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "adf6b827ef4a47f89fd648d56316af83" + }, + "m_SlotId": 1 + } } ], + "m_VertexContext": { + "m_Position": { + "x": 906.7999877929688, + "y": 608.800048828125 + }, + "m_Blocks": [ + { + "m_Id": "3b9ac9422a07454fa54965bd3f291803" + }, + { + "m_Id": "a36c2d8a7f6f428ca1c777fdfad16e3f" + }, + { + "m_Id": "210252ce2e9241c2845a6cfe4739d2c9" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 906.7999877929688, + "y": 808.800048828125 + }, + "m_Blocks": [ + { + "m_Id": "f6a451b4d3c2482984b1e4d50d61dbe5" + }, + { + "m_Id": "a2bfc40d2d344b4a9b02ba2c2053694d" + }, + { + "m_Id": "0b238d3b3c804a81ab6f272addc36d58" + } + ] + }, "m_PreviewData": { "serializedMesh": { "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", @@ -32,5 +244,1261 @@ }, "m_Path": "Shader Graph Tests/Input/Basic", "m_ConcretePrecision": 0, - "m_ActiveOutputNodeGuidSerialized": "3645aff8-5a45-4516-8b45-2380b21d7ec5" -} \ No newline at end of file + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "4d1c49433eaa45fda6f708c727d2aa7d" + } + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "06b2a35bf99e45d5828bc6baf348f1c0", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "08d37f8f045b41c8bd7a4d6fa6b1eaf6", + "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.BlockNode", + "m_ObjectId": "0b238d3b3c804a81ab6f272addc36d58", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.AlphaClipThreshold", + "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": "41768a51b53841539cf316a5dd8b512e" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "0ed0d756daa34e93b979108bcfa7ae3f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 15.9999418258667, + "y": 830.800048828125, + "width": 128.39999389648438, + "height": 34.000003814697269 + } + }, + "m_Slots": [ + { + "m_Id": "fe5410f470f84fa8a0f4ccd102aad7ac" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "8cec592cd4184ffcae31bb4968a07592" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "0f73d282530d4b6f8288430cace42ce7", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "1c9a73816b9849088de83c17bffd10bd", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "210252ce2e9241c2845a6cfe4739d2c9", + "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": "b4c2b7b62b214f038f9bcc5820d21ddc" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2456b17aaf7844d5bc9c1ea862eafbd6", + "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": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "26923fa85dc6475cb9c31a860adeaf89", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -389.1999206542969, + "y": 409.1999816894531, + "width": 107.20000457763672, + "height": 33.999996185302737 + } + }, + "m_Slots": [ + { + "m_Id": "94a2f04f12d14389933ebb0699ff562e" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "9cbb7d0f6a9f4600a30ce1093efb115f" + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "300e1bb1a60b4adeb6e31b37e6482cdd", + "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.StepNode", + "m_ObjectId": "34631918f8cc49bb8345e1f279902150", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Step", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -490.0000305175781, + "y": 808.7999877929688, + "width": 208.00001525878907, + "height": 301.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "459aee8a4b8543a0a55dd8afde7a46ae" + }, + { + "m_Id": "49f44955833b440f9f8fe540f1f20cd1" + }, + { + "m_Id": "300e1bb1a60b4adeb6e31b37e6482cdd" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "371d8913b519467e870d532d0609a6d5", + "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": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3b45ababbb1541df93c9c52d1654d383", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "3b9ac9422a07454fa54965bd3f291803", + "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": "dbcb3ba878804354b7dc90725c37449a" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "41768a51b53841539cf316a5dd8b512e", + "m_Id": 0, + "m_DisplayName": "Alpha Clip Threshold", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "AlphaClipThreshold", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.5, + "m_Labels": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "443e92aafbac40b381edd5a1218016cc", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "459aee8a4b8543a0a55dd8afde7a46ae", + "m_Id": 0, + "m_DisplayName": "Edge", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Edge", + "m_StageCapability": 3, + "m_Value": { + "x": 0.4000000059604645, + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "49f44955833b440f9f8fe540f1f20cd1", + "m_Id": 1, + "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.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "4d1c49433eaa45fda6f708c727d2aa7d", + "m_ActiveSubTarget": { + "m_Id": "d8a18ac4a1aa4a3baa8187f24220a06a" + }, + "m_SurfaceType": 0, + "m_AlphaMode": 0, + "m_TwoSided": false, + "m_AlphaClip": false, + "m_CustomEditorGUI": "" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "52ba2f081d6f4163a9b34bf9caa808b5", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "55997b5e6caa4f52930629e044a75361", + "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.LerpNode", + "m_ObjectId": "57cff171b45849f697f013e0e124896f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -127.5999526977539, + "y": 440.39996337890627, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "6f3b107fc4e04e61ab64390d546556ed" + }, + { + "m_Id": "1c9a73816b9849088de83c17bffd10bd" + }, + { + "m_Id": "443e92aafbac40b381edd5a1218016cc" + }, + { + "m_Id": "08d37f8f045b41c8bd7a4d6fa6b1eaf6" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6f3b107fc4e04e61ab64390d546556ed", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "732ccedab2be4a699bc90b0e061bc684", + "m_Id": 1, + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "84b62ed3cc3b47d8b756c9c027a24e00", + "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.Vector4MaterialSlot", + "m_ObjectId": "8ac7d3538aa74755a0c2281d2513c738", + "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.DynamicVectorMaterialSlot", + "m_ObjectId": "8bb822525f8a4f5fadabea2283a1c5bb", + "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.Internal.ColorShaderProperty", + "m_ObjectId": "8cec592cd4184ffcae31bb4968a07592", + "m_Guid": { + "m_GuidSerialized": "b93c4f9d-777b-4b41-a97d-1300e11b202c" + }, + "m_Name": "ColorDep", + "m_DefaultReferenceName": "Color_8cec592cd4184ffcae31bb4968a07592", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "r": 0.5471698045730591, + "g": 0.0, + "b": 0.0, + "a": 0.0 + }, + "m_Version": 0, + "m_ColorMode": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "8e9180e02332452f9c7266df3c0f0339", + "m_Id": 0, + "m_DisplayName": "Edge", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Edge", + "m_StageCapability": 3, + "m_Value": { + "x": 0.20000000298023225, + "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.Vector4MaterialSlot", + "m_ObjectId": "94a2f04f12d14389933ebb0699ff562e", + "m_Id": 0, + "m_DisplayName": "Color", + "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": "97e95b21da8046f095beb93292b0a03d", + "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.Internal.ColorShaderProperty", + "m_ObjectId": "9cbb7d0f6a9f4600a30ce1093efb115f", + "m_Guid": { + "m_GuidSerialized": "04057c74-6ff3-4c4b-aada-e3efc0ad1d21" + }, + "m_Name": "Color", + "m_DefaultReferenceName": "Color_9cbb7d0f6a9f4600a30ce1093efb115f", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "r": 0.5471698045730591, + "g": 0.0, + "b": 0.0, + "a": 0.0 + }, + "m_Version": 1, + "m_ColorMode": 0 +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a28bf79c166e428a983a6b9284d64e42", + "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": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "a2bfc40d2d344b4a9b02ba2c2053694d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "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": "0f73d282530d4b6f8288430cace42ce7" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "a36c2d8a7f6f428ca1c777fdfad16e3f", + "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": "06b2a35bf99e45d5828bc6baf348f1c0" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "a52577d9127348d1ae27231293dcd588", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.StepNode", + "m_ObjectId": "adf6b827ef4a47f89fd648d56316af83", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Step", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -490.0000305175781, + "y": 464.3999938964844, + "width": 208.00001525878907, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "8e9180e02332452f9c7266df3c0f0339" + }, + { + "m_Id": "732ccedab2be4a699bc90b0e061bc684" + }, + { + "m_Id": "97e95b21da8046f095beb93292b0a03d" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "b4c2b7b62b214f038f9bcc5820d21ddc", + "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.ColorRGBMaterialSlot", + "m_ObjectId": "c46afd10ccd043f7bb77c7e36c62595e", + "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.UVNode", + "m_ObjectId": "d7bd3dec13d141d6a4d0e3d74079f7e6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -917.2000732421875, + "y": 486.800048828125, + "width": 208.0, + "height": 312.79998779296877 + } + }, + "m_Slots": [ + { + "m_Id": "52ba2f081d6f4163a9b34bf9caa808b5" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + +{ + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "d8a18ac4a1aa4a3baa8187f24220a06a" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "dbcb3ba878804354b7dc90725c37449a", + "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.LerpNode", + "m_ObjectId": "e75f0ae4cb7349589d2554de42b18f3a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 217.19996643066407, + "y": 766.4000244140625, + "width": 208.00003051757813, + "height": 326.00006103515627 + } + }, + "m_Slots": [ + { + "m_Id": "8bb822525f8a4f5fadabea2283a1c5bb" + }, + { + "m_Id": "3b45ababbb1541df93c9c52d1654d383" + }, + { + "m_Id": "a52577d9127348d1ae27231293dcd588" + }, + { + "m_Id": "84b62ed3cc3b47d8b756c9c027a24e00" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.ColorNode", + "m_ObjectId": "e9764189650c4bf19b67df5739c5bc7c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Color", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -490.0000305175781, + "y": 218.80003356933595, + "width": 208.0, + "height": 127.19998168945313 + } + }, + "m_Slots": [ + { + "m_Id": "8ac7d3538aa74755a0c2281d2513c738" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Color": { + "color": { + "r": 0.5471698045730591, + "g": 0.0, + "b": 0.0, + "a": 0.0 + }, + "mode": 0 + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "eb89254fdc994b87850a8e471d775574", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Split", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -753.6000366210938, + "y": 486.800048828125, + "width": 118.79998779296875, + "height": 76.79998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "55997b5e6caa4f52930629e044a75361" + }, + { + "m_Id": "a28bf79c166e428a983a6b9284d64e42" + }, + { + "m_Id": "edac3540ed8442f5915ac25414af3c99" + }, + { + "m_Id": "371d8913b519467e870d532d0609a6d5" + }, + { + "m_Id": "2456b17aaf7844d5bc9c1ea862eafbd6" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "edac3540ed8442f5915ac25414af3c99", + "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": [ + "X" + ] +} + +{ + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f6a451b4d3c2482984b1e4d50d61dbe5", + "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": "c46afd10ccd043f7bb77c7e36c62595e" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "fe5410f470f84fa8a0f4ccd102aad7ac", + "m_Id": 0, + "m_DisplayName": "ColorDep", + "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 + } +} + diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index 14b484ff3aa..a8b0b10abdc 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -26,7 +26,7 @@ internal ColorShaderProperty() version = latestVersion; } - internal ColorShaderProperty(int version) : base() + internal ColorShaderProperty(int version) : this() { this.version = version; } From a358fca39007cadf0d92aaba3aa767c7a134283d Mon Sep 17 00:00:00 2001 From: elizabeth-legros <59933602+elizabeth-legros@users.noreply.github.com> Date: Mon, 3 Aug 2020 15:54:29 -0500 Subject: [PATCH 09/34] Update Property-Types.md Updating documentation --- com.unity.shadergraph/Documentation~/Property-Types.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Documentation~/Property-Types.md b/com.unity.shadergraph/Documentation~/Property-Types.md index ada1ef2e6b9..38b4b09841e 100644 --- a/com.unity.shadergraph/Documentation~/Property-Types.md +++ b/com.unity.shadergraph/Documentation~/Property-Types.md @@ -115,6 +115,8 @@ Displays an HDR color field in the material inspector. |:-------------|:------|:------------| | Default | Vector 4 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | +NOTE: Previous versions actually interpreted the color in linear space. The behavior is corrected now, and previously created color properties will continue to use old behavior unless explicilty upgraded through the [Graph Inspector](Internal-Inspector.md). You may use a **Vector 4** property or convert a new **Color** property back to linear space with the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to mimic old behavior. + ## Texture 2D Defines a [Texture 2D](https://docs.unity3d.com/Manual/class-TextureImporter.html) value. Displays an object field of type [Texture](https://docs.unity3d.com/Manual/class-TextureImporter.html) in the material inspector. @@ -173,4 +175,4 @@ Defines a **Boolean** value. Displays a **ToggleUI** field in the material inspe | Field | Type | Description | |:-------------|:------|:------------| -| Default | Boolean | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | \ No newline at end of file +| Default | Boolean | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | From d16e3b7075ba30d9400db022d3dc4f86ec26454b Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Mon, 10 Aug 2020 14:39:46 -0500 Subject: [PATCH 10/34] fixing version weirdness with GraphData having a similar concept already, move version to be serialized in JsonObject, fix color property and node to behave correctly with HDR values --- .../Editor/Data/Graphs/ColorShaderProperty.cs | 9 ---- .../Editor/Data/Graphs/GraphData.cs | 18 ++++---- .../Data/Nodes/Input/Basic/ColorNode.cs | 41 ++++++++++++++++--- .../Editor/Data/Nodes/Input/PropertyNode.cs | 11 ++++- .../Drawing/Blackboard/BlackboardFieldView.cs | 2 +- .../AbstractMaterialNodePropertyDrawer.cs | 7 +++- .../ShaderInputPropertyDrawer.cs | 9 +--- .../Editor/Drawing/Views/HelpBoxRow.cs | 17 ++++++++ .../Editor/Serialization/JsonObject.cs | 5 ++- 9 files changed, 82 insertions(+), 37 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index a8b0b10abdc..aba7ec2514d 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -11,15 +11,6 @@ public sealed class ColorShaderProperty : AbstractShaderProperty { public override int latestVersion => 1; - [SerializeField] - private int m_Version = 0; - - public override int version - { - get => m_Version; - protected set => m_Version = value; - } - internal ColorShaderProperty() { displayName = "Color"; diff --git a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs index 585ee2b3985..e4fc82d22ba 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs @@ -23,10 +23,8 @@ namespace UnityEditor.ShaderGraph [FormerName("UnityEditor.ShaderGraph.AbstractMaterialGraph")] sealed partial class GraphData : JsonObject { - const int k_CurrentVersion = 2; - [SerializeField] - int m_Version; + public override int latestVersion => 2; public GraphObject owner { get; set; } @@ -1630,7 +1628,7 @@ internal void PasteGraph(CopyPasteGraph graphToPaste, List public override void OnBeforeSerialize() { m_Edges.Sort(); - m_Version = k_CurrentVersion; + version = latestVersion; } static T DeserializeLegacy(string typeString, string json) where T : JsonObject @@ -1667,7 +1665,7 @@ static AbstractMaterialNode DeserializeLegacy(string typeString, string json) public override void OnAfterDeserialize(string json) { - if (m_Version == 0) + if (version == 0) { var graphData0 = JsonUtility.FromJson(json); @@ -1835,19 +1833,19 @@ public override void OnAfterDeserialize(string json) // In V2 we need to defer version set to in OnAfterMultiDeserialize // This is because we need access to m_OutputNode to convert it to Targets and Stacks // The JsonObject will not be fully deserialized until OnAfterMultiDeserialize - bool deferredUpgrades = m_Version < 2; + bool deferredUpgrades = version < 2; if(!deferredUpgrades) { - m_Version = k_CurrentVersion; + version = latestVersion; } } public override void OnAfterMultiDeserialize(string json) { // Deferred upgrades - if(m_Version != k_CurrentVersion) + if(version != latestVersion) { - if(m_Version < 2) + if(version < 2) { var addedBlocks = ListPool.Get(); @@ -1964,7 +1962,7 @@ void UpgradeFromBlockMap(Dictionary blockMap) m_NodeEdges.Clear(); } - m_Version = k_CurrentVersion; + version = latestVersion; } PooledList<(LegacyUnknownTypeNode, AbstractMaterialNode)> updatedNodes = PooledList<(LegacyUnknownTypeNode,AbstractMaterialNode)>.Get(); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index ebd13430c77..f70972d34a0 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -22,10 +22,13 @@ class ColorNode : AbstractMaterialNode, IGeneratesBodyCode, IPropertyFromNode public const int OutputSlotId = 0; private const string kOutputSlotName = "Out"; + public override int latestVersion => 1; + public ColorNode() { name = "Color"; UpdateNodeAfterDeserialization(); + version = latestVersion; } @@ -93,12 +96,38 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo if (generationMode.IsPreview()) return; - sb.AppendLine(@"$precision4 {0} = IsGammaSpace() ? $precision4({1}, {2}, {3}, {4}) : $precision4(SRGBToLinear($precision3({1}, {2}, {3})), {4});" - , GetVariableNameForNode() - , NodeUtils.FloatToShaderValue(color.color.r) - , NodeUtils.FloatToShaderValue(color.color.g) - , NodeUtils.FloatToShaderValue(color.color.b) - , NodeUtils.FloatToShaderValue(color.color.a)); + switch (version) + { + case 0: + sb.AppendLine(@"$precision4 {0} = IsGammaSpace() ? $precision4({1}, {2}, {3}, {4}) : $precision4(SRGBToLinear($precision3({1}, {2}, {3})), {4});" + , GetVariableNameForNode() + , NodeUtils.FloatToShaderValue(color.color.r) + , NodeUtils.FloatToShaderValue(color.color.g) + , NodeUtils.FloatToShaderValue(color.color.b) + , NodeUtils.FloatToShaderValue(color.color.a)); + break; + case 1: + //HDR color picker assumes Linear space, regular color picker assumes SRGB. Handle both cases + if(color.mode == ColorMode.Default) + { + sb.AppendLine(@"$precision4 {0} = IsGammaSpace() ? $precision4({1}, {2}, {3}, {4}) : $precision4(SRGBToLinear($precision3({1}, {2}, {3})), {4});" + , GetVariableNameForNode() + , NodeUtils.FloatToShaderValue(color.color.r) + , NodeUtils.FloatToShaderValue(color.color.g) + , NodeUtils.FloatToShaderValue(color.color.b) + , NodeUtils.FloatToShaderValue(color.color.a)); + } + else + { + sb.AppendLine(@"$precision4 {0} = IsGammaSpace() ? LinearToSRGB($precision4({1}, {2}, {3}, {4})) : $precision4({1}, {2}, {3}, {4});" + , GetVariableNameForNode() + , NodeUtils.FloatToShaderValue(color.color.r) + , NodeUtils.FloatToShaderValue(color.color.g) + , NodeUtils.FloatToShaderValue(color.color.b) + , NodeUtils.FloatToShaderValue(color.color.a)); + } + break; + } } public override string GetVariableNameForSlot(int slotId) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs index 007406586f9..0dafe061b58 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs @@ -157,7 +157,16 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); break; case 1: - sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = IsGammaSpace() ? {property.referenceName} : SRGBToLinear({property.referenceName});"); + //Exposed color properties get put into the correct space automagikally by Unity UNLESS tagged as HDR, then they just get passed in as is. + //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};"); + } + else + { + sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); + } break; default: throw new Exception($"Unknown Color Property Version on property {property.displayName}"); diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs index f5b217e1ae6..20a2b74df95 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs @@ -88,7 +88,7 @@ public string inspectorTitle public void InspectorUpdateTrigger() { - m_inspectorUpdateTrigger(); + m_inspectorUpdateTrigger?.Invoke(); } public BlackboardFieldView(GraphData graph, ShaderInput input, BlackBoardCallback updateBlackboardView, diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs index e40127fdd54..d6e9b886a0c 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using UnityEditor.Graphing; using UnityEditor.ShaderGraph; @@ -31,6 +31,11 @@ VisualElement CreateGUI(AbstractMaterialNode node, InspectableAttribute attribut VisualElement nodeSettings = new VisualElement(); var nameLabel = PropertyDrawerUtils.CreateLabel($"{node.name} Node", 0, FontStyle.Bold); nodeSettings.Add(nameLabel); + if(node.version < node.latestVersion && !ShaderGraphPreferences.allowDeprecatedBehaviors) + { + var help = HelpBoxRow.GetDeprecatedHelpBoxRow($"{node.name} Node", () => node.ChangeVersion(node.latestVersion)); + nodeSettings.Insert(0, help); + } EnumField precisionField = null; if(node.canSetPrecision) { diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index 5925d56e80f..a0c090281dc 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -215,14 +215,7 @@ void BuildPropertyFields(PropertySheet propertySheet) if (property.version < property.latestVersion && !ShaderGraphPreferences.allowDeprecatedBehaviors) { var typeString = property.propertyType.ToString(); - HelpBoxRow help; - help = new HelpBoxRow(MessageType.Warning); - var label = new Label("DEPRECATED: Hover for info") - { - tooltip = $"The {typeString} Property has new updates. This version maintains the old behavior. If you update a {typeString} Property, you can use Undo to change it back. See the {typeString} Property documentation for more information." - }; - help.Add(label); - help.contentContainer.Add(new Button(() => property.ChangeVersion(property.latestVersion)) { text = "Update" }); + var help = HelpBoxRow.GetDeprecatedHelpBoxRow($"{typeString} Property", () => property.ChangeVersion(property.latestVersion)); propertySheet.Insert(0,help); } diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs index 321f897a082..6b33d29e60a 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs @@ -1,3 +1,4 @@ +using System; using System.Linq; using UnityEngine; using UnityEngine.UIElements; @@ -45,5 +46,21 @@ public HelpBoxRow(MessageType type) hierarchy.Add(container); } + + public static HelpBoxRow GetDeprecatedHelpBoxRow(string deprecatedTypeName, Action upgradeAction) + { + HelpBoxRow help = null; + if (!ShaderGraphPreferences.allowDeprecatedBehaviors) + { + help = new HelpBoxRow(MessageType.Warning); + var label = new Label("DEPRECATED: Hover for info") + { + tooltip = $"The {deprecatedTypeName} has new updates. This version maintains the old behavior. If you update a {deprecatedTypeName}, you can use Undo to change it back. See the {deprecatedTypeName} documentation for more information." + }; + help.Add(label); + help.contentContainer.Add(new Button(upgradeAction) { text = "Update" }); + } + return help; + } } } diff --git a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs index 017d57768ca..50dc094ce25 100644 --- a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs +++ b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs @@ -9,7 +9,10 @@ public class JsonObject : ISerializationCallbackReceiver public virtual int latestVersion { get; } = 0; - public virtual int version { get; protected set; } = 0; + + [SerializeField] + protected int m_Version = 0; + public virtual int version { get => m_Version; protected set => m_Version = value; } internal protected delegate void VersionChange(int newVersion); internal protected VersionChange onBeforeVersionChange; From 02e7a1fdb42bb4fff8db1a2d48f9137aef28b99b Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Mon, 10 Aug 2020 15:25:42 -0500 Subject: [PATCH 11/34] updating input node graphics tests --- .../Direct3D11/None/InputNodes.png | 4 +- .../Direct3D11/None/InputNodes.png.meta | 2 +- .../Assets/Scenes/InputNodes.unity | 37 +- .../Input/Basic/ColorNodeHDR.shadergraph | 1550 ++++++++++++++++- 4 files changed, 1570 insertions(+), 23 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png index d93231790c0..37e7280cba7 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:616d9f228f91ddd380201dac391542ab0484b196f7c8ab5cd22ce5785473985b -size 502983 +oid sha256:ad3f5ecbd86213b6a0dad102f80ee4077f522c06c9573a93d8d0d6bfda31cebe +size 502847 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta index ca6c9f2c014..4618d73699e 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fd0ee7bdcc033f149a590cb46eebf92c +guid: c368b337de4288444a3163613a73ed01 TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity index 49370b6291a..6af789b8771 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity @@ -2090,6 +2090,7 @@ GameObject: - component: {fileID: 366199730} - component: {fileID: 366199729} - component: {fileID: 366199732} + - component: {fileID: 366199733} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -2183,6 +2184,38 @@ MonoBehaviour: UseBackBuffer: 0 ImageResolution: 0 WaitFrames: 2 +--- !u!114 &366199733 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 366199728} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 --- !u!1 &366823146 GameObject: m_ObjectHideFlags: 0 @@ -8238,13 +8271,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1506539575} - m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} + m_LocalRotation: {x: -0.6532815, y: 0.6532815, z: -0.27059805, w: -0.27059805} m_LocalPosition: {x: -5, y: 0, z: -2} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 303484558} m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: -90, y: 180, z: -90} + m_LocalEulerAnglesHint: {x: 45, y: 180, z: -90} --- !u!1 &1536751008 GameObject: m_ObjectHideFlags: 0 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph index 5a8e3056602..2a130b7db9a 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph @@ -1,29 +1,241 @@ { - "m_SerializedProperties": [], - "m_SerializableNodes": [ + "m_Version": 2, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "7e17b234fc1740429c731f4e774e9a83", + "m_Properties": [ { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.UnlitMasterNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"3645aff8-5a45-4516-8b45-2380b21d7ec5\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Unlit Master\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 67.0,\n \"y\": 136.0,\n \"width\": 200.0,\n \"height\": 149.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.PositionMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 9,\\n \\\"m_DisplayName\\\": \\\"Position\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Position\\\",\\n \\\"m_StageCapability\\\": 1,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_Space\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.ColorRGBMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Color\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Color\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.5,\\n \\\"y\\\": 0.5,\\n \\\"z\\\": 0.5\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ],\\n \\\"m_ColorMode\\\": 0\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 7,\\n \\\"m_DisplayName\\\": \\\"Alpha\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Alpha\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 1.0,\\n \\\"m_DefaultValue\\\": 1.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 8,\\n \\\"m_DisplayName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"AlphaClipThreshold\\\",\\n \\\"m_StageCapability\\\": 2,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.5,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_SerializableSubShaders\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.Rendering.Universal.UniversalUnlitSubShader\"\n },\n \"JSONnodeData\": \"{}\"\n }\n ],\n \"m_SurfaceType\": 0,\n \"m_AlphaMode\": 0,\n \"m_TwoSided\": false,\n \"m_AddVelocityChange\": false\n}" + "m_Id": "3aaf7afa840840dfb98a5241f2bac68d" }, { - "typeInfo": { - "fullName": "UnityEditor.ShaderGraph.ColorNode" - }, - "JSONnodeData": "{\n \"m_GuidSerialized\": \"123589aa-c28c-44b6-89ae-b1d16933f7be\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Color\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -444.0,\n \"y\": 113.0,\n \"width\": 213.0,\n \"height\": 128.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_Color\": {\n \"color\": {\n \"r\": 14.226009368896485,\n \"g\": 0.6439757943153381,\n \"b\": 0.6439757943153381,\n \"a\": 0.0\n },\n \"mode\": 1\n }\n}" + "m_Id": "9ca2003b25484d6aab715cc13565a6b3" + } + ], + "m_Keywords": [], + "m_Nodes": [ + { + "m_Id": "e9e1ac0424e54cea87d5d48125f2d7f1" + }, + { + "m_Id": "4c3abdc830fe4083bc26abfbd81fe1d6" + }, + { + "m_Id": "fabb954b7b8d4c808091abd0d2155936" + }, + { + "m_Id": "0d6d50a7de1c45af967403bdc5d9e7cb" + }, + { + "m_Id": "ad18f0efb4e146a9a6c459decbaf7710" + }, + { + "m_Id": "c3ae2931736d43c6b56dc3ad6d3c08cf" + }, + { + "m_Id": "cbacef4f67fd41ea86c9e8e17adfee66" + }, + { + "m_Id": "169c1f8986b040f1a2809136013f09b0" + }, + { + "m_Id": "c317135581b4440188048fb963399372" + }, + { + "m_Id": "67918591b6314c7ea37209bde6b19f42" + }, + { + "m_Id": "c955ebedab6b4f25b211e7dc4971400b" + }, + { + "m_Id": "88be5d15a3884c97965b13c8d3c2f86c" + }, + { + "m_Id": "0a5bc40644414c29bb180f16a5fa2a76" + }, + { + "m_Id": "47dcdf5e8c7e4579b545b7ee6f0bc6dc" + }, + { + "m_Id": "80daeea527384ab3bd4430902c160801" } ], - "m_Groups": [], - "m_StickyNotes": [], - "m_SerializableEdges": [ + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "0a5bc40644414c29bb180f16a5fa2a76" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ad18f0efb4e146a9a6c459decbaf7710" + }, + "m_SlotId": 0 + } + }, { - "typeInfo": { - "fullName": "UnityEditor.Graphing.Edge" + "m_OutputSlot": { + "m_Node": { + "m_Id": "169c1f8986b040f1a2809136013f09b0" + }, + "m_SlotId": 0 }, - "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"123589aa-c28c-44b6-89ae-b1d16933f7be\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"3645aff8-5a45-4516-8b45-2380b21d7ec5\"\n }\n}" + "m_InputSlot": { + "m_Node": { + "m_Id": "c317135581b4440188048fb963399372" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "47dcdf5e8c7e4579b545b7ee6f0bc6dc" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "88be5d15a3884c97965b13c8d3c2f86c" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "67918591b6314c7ea37209bde6b19f42" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "88be5d15a3884c97965b13c8d3c2f86c" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "80daeea527384ab3bd4430902c160801" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0a5bc40644414c29bb180f16a5fa2a76" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "88be5d15a3884c97965b13c8d3c2f86c" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0a5bc40644414c29bb180f16a5fa2a76" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c317135581b4440188048fb963399372" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "67918591b6314c7ea37209bde6b19f42" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c317135581b4440188048fb963399372" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c955ebedab6b4f25b211e7dc4971400b" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c955ebedab6b4f25b211e7dc4971400b" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0a5bc40644414c29bb180f16a5fa2a76" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e9e1ac0424e54cea87d5d48125f2d7f1" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "88be5d15a3884c97965b13c8d3c2f86c" + }, + "m_SlotId": 0 + } } ], + "m_VertexContext": { + "m_Position": { + "x": 67.0, + "y": 136.0 + }, + "m_Blocks": [ + { + "m_Id": "4c3abdc830fe4083bc26abfbd81fe1d6" + }, + { + "m_Id": "fabb954b7b8d4c808091abd0d2155936" + }, + { + "m_Id": "0d6d50a7de1c45af967403bdc5d9e7cb" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 67.0, + "y": 336.0 + }, + "m_Blocks": [ + { + "m_Id": "ad18f0efb4e146a9a6c459decbaf7710" + }, + { + "m_Id": "c3ae2931736d43c6b56dc3ad6d3c08cf" + }, + { + "m_Id": "cbacef4f67fd41ea86c9e8e17adfee66" + } + ] + }, "m_PreviewData": { "serializedMesh": { "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", @@ -32,5 +244,1307 @@ }, "m_Path": "Shader Graph Tests/Input/Basic", "m_ConcretePrecision": 0, - "m_ActiveOutputNodeGuidSerialized": "3645aff8-5a45-4516-8b45-2380b21d7ec5" -} \ No newline at end of file + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "eaa60fa73a174fedbd8e8d3a2f830205" + } + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "018c4429a0334eed96eae09a9546b003", + "m_Id": 0, + "m_DisplayName": "Edge", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Edge", + "m_StageCapability": 3, + "m_Value": { + "x": 0.4000000059604645, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "063e4268621e4816a2baf64072597020", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "0995773701c24445bba41160bca945f9", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "0a5bc40644414c29bb180f16a5fa2a76", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -162.6041259765625, + "y": 749.564697265625, + "width": 208.00003051757813, + "height": 326.00006103515627 + } + }, + "m_Slots": [ + { + "m_Id": "caab508145714bd09febb9d7147864df" + }, + { + "m_Id": "fdcbb7d717ec40adbb56c094dc0634a7" + }, + { + "m_Id": "94cd3ea2857a4d709ff3c5280f0260cb" + }, + { + "m_Id": "fb8ffdfeba6147e2ae2465327051e8a7" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "0b6cfe0982fa4bdb907bc0a43a6b6f8d", + "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": [ + "X" + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "0d6d50a7de1c45af967403bdc5d9e7cb", + "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": "dc086dbb8c6f4e5da776741b8850e235" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "169c1f8986b040f1a2809136013f09b0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1297.004150390625, + "y": 469.9647216796875, + "width": 208.0, + "height": 312.79998779296877 + } + }, + "m_Slots": [ + { + "m_Id": "6a80a929e698467690908de868b5454b" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "183c71ccf6594924b77b4ecc9129be29" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "258cd17f57a34e40aa02d64ab0f4f904", + "m_Id": 0, + "m_DisplayName": "ColorDep", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "268a5b5c7d874d97b0d3d709aa7b2794", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "292319f4b2b54309a910a9d57417e23f", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "296fd70416074faf875470c0ebdf67b7", + "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": [ + "X" + ] +} + +{ + "m_Version": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "3aaf7afa840840dfb98a5241f2bac68d", + "m_Guid": { + "m_GuidSerialized": "e48795e6-ac92-4e73-b998-35775d1493bd" + }, + "m_Name": "Color", + "m_DefaultReferenceName": "Color_3aaf7afa840840dfb98a5241f2bac68d", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "r": 14.226009368896485, + "g": 0.6439757943153381, + "b": 0.6439757943153381, + "a": 0.0 + }, + "m_ColorMode": 1 +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "3ffef190d1af4bb395c8ad038c6bd16f", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "47dcdf5e8c7e4579b545b7ee6f0bc6dc", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -930.9999389648438, + "y": 320.9999694824219, + "width": 207.99998474121095, + "height": 126.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "9dfa9ac840b147c0b9fae2b4066cf60a" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "3aaf7afa840840dfb98a5241f2bac68d" + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "4a7963109f1646399fb9e82679ffccf7", + "m_Id": 0, + "m_DisplayName": "Alpha Clip Threshold", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "AlphaClipThreshold", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.5, + "m_Labels": [ + "X" + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "4c3abdc830fe4083bc26abfbd81fe1d6", + "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": "0995773701c24445bba41160bca945f9" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5ae86e840ab94cb6995bb776bef9aa6a", + "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": [ + "X" + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "62631198aa444d6e8831cfef7436cb54", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6325b20533a3410ba73af78a2dfc699d", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.StepNode", + "m_ObjectId": "67918591b6314c7ea37209bde6b19f42", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Step", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -869.8040771484375, + "y": 447.5646667480469, + "width": 208.00001525878907, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "c51e9ea874104af7909e83bf0ee20d3b" + }, + { + "m_Id": "d5b0f2e9853f4eb28193c66a3796373a" + }, + { + "m_Id": "fb6072c4223747d29244931d20d25f04" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "6a80a929e698467690908de868b5454b", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "7c99f189214b4dc7b4a6f2988eec5219", + "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": [ + "X" + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "80daeea527384ab3bd4430902c160801", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -391.9999694824219, + "y": 791.9999389648438, + "width": 127.99999237060547, + "height": 33.999996185302737 + } + }, + "m_Slots": [ + { + "m_Id": "258cd17f57a34e40aa02d64ab0f4f904" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "9ca2003b25484d6aab715cc13565a6b3" + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "88be5d15a3884c97965b13c8d3c2f86c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -507.4040222167969, + "y": 423.56463623046877, + "width": 207.99998474121095, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "6325b20533a3410ba73af78a2dfc699d" + }, + { + "m_Id": "d35e11ddebf24d94925e7a77a9184c63" + }, + { + "m_Id": "063e4268621e4816a2baf64072597020" + }, + { + "m_Id": "a18ece47c2424dafa00ad16c2772f6df" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "94cd3ea2857a4d709ff3c5280f0260cb", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "9c10b753f2b14d6889e0bbfdef79139e", + "m_Id": 1, + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "9ca2003b25484d6aab715cc13565a6b3", + "m_Guid": { + "m_GuidSerialized": "cdb94b35-e0c2-44f6-ac97-d4ad2add1fda" + }, + "m_Name": "ColorDep", + "m_DefaultReferenceName": "Color_9ca2003b25484d6aab715cc13565a6b3", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_Precision": 0, + "m_GPUInstanced": false, + "m_Hidden": false, + "m_Value": { + "r": 14.226009368896485, + "g": 0.6439757943153381, + "b": 0.6439757943153381, + "a": 0.0 + }, + "m_ColorMode": 1 +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "9dfa9ac840b147c0b9fae2b4066cf60a", + "m_Id": 0, + "m_DisplayName": "Color", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "a18ece47c2424dafa00ad16c2772f6df", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "ad18f0efb4e146a9a6c459decbaf7710", + "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": "3ffef190d1af4bb395c8ad038c6bd16f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "be0897d4b80743f993c7da1b24cf158c", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "c317135581b4440188048fb963399372", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Split", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1133.404052734375, + "y": 469.9647216796875, + "width": 118.79998779296875, + "height": 76.79998779296875 + } + }, + "m_Slots": [ + { + "m_Id": "268a5b5c7d874d97b0d3d709aa7b2794" + }, + { + "m_Id": "7c99f189214b4dc7b4a6f2988eec5219" + }, + { + "m_Id": "296fd70416074faf875470c0ebdf67b7" + }, + { + "m_Id": "0b6cfe0982fa4bdb907bc0a43a6b6f8d" + }, + { + "m_Id": "5ae86e840ab94cb6995bb776bef9aa6a" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "c3ae2931736d43c6b56dc3ad6d3c08cf", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "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": "be0897d4b80743f993c7da1b24cf158c" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "c51e9ea874104af7909e83bf0ee20d3b", + "m_Id": 0, + "m_DisplayName": "Edge", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Edge", + "m_StageCapability": 3, + "m_Value": { + "x": 0.20000000298023225, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.StepNode", + "m_ObjectId": "c955ebedab6b4f25b211e7dc4971400b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Step", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -869.8040771484375, + "y": 791.9646606445313, + "width": 208.00001525878907, + "height": 301.99993896484377 + } + }, + "m_Slots": [ + { + "m_Id": "018c4429a0334eed96eae09a9546b003" + }, + { + "m_Id": "9c10b753f2b14d6889e0bbfdef79139e" + }, + { + "m_Id": "292319f4b2b54309a910a9d57417e23f" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "caab508145714bd09febb9d7147864df", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "cbacef4f67fd41ea86c9e8e17adfee66", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.AlphaClipThreshold", + "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": "4a7963109f1646399fb9e82679ffccf7" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d35e11ddebf24d94925e7a77a9184c63", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d5b0f2e9853f4eb28193c66a3796373a", + "m_Id": 1, + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "dc086dbb8c6f4e5da776741b8850e235", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorNode", + "m_ObjectId": "e9e1ac0424e54cea87d5d48125f2d7f1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Color", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -930.9999389648438, + "y": 178.99998474121095, + "width": 207.99998474121095, + "height": 126.99999237060547 + } + }, + "m_Slots": [ + { + "m_Id": "62631198aa444d6e8831cfef7436cb54" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Color": { + "color": { + "r": 14.226009368896485, + "g": 0.6439757943153381, + "b": 0.6439757943153381, + "a": 0.0 + }, + "mode": 1 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "eaa60fa73a174fedbd8e8d3a2f830205", + "m_ActiveSubTarget": { + "m_Id": "183c71ccf6594924b77b4ecc9129be29" + }, + "m_SurfaceType": 0, + "m_AlphaMode": 0, + "m_TwoSided": false, + "m_AlphaClip": false, + "m_CustomEditorGUI": "" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "f2c81ddfcd9a4a1293e2ce8e731057f6", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "fabb954b7b8d4c808091abd0d2155936", + "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": "f2c81ddfcd9a4a1293e2ce8e731057f6" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "fb6072c4223747d29244931d20d25f04", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "fb8ffdfeba6147e2ae2465327051e8a7", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "fdcbb7d717ec40adbb56c094dc0634a7", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + From c18a78128b78a08be68b4b2abbfa6922057b3edd Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Mon, 10 Aug 2020 17:03:41 -0500 Subject: [PATCH 12/34] code review notes --- .../Direct3D11/None/InputNodes.png | 4 ++-- .../Direct3D11/None/InputNodes.png.meta | 2 +- .../Input/Basic/ColorNodeHDR.shadergraph | 8 ++++---- .../Editor/Data/Nodes/AbstractMaterialNode.cs | 6 +++--- .../AbstractMaterialNodePropertyDrawer.cs | 18 +++++++++++++++--- .../ShaderInputPropertyDrawer.cs | 9 ++++++--- .../Editor/Drawing/Views/HelpBoxRow.cs | 2 +- 7 files changed, 32 insertions(+), 17 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png index 37e7280cba7..84ffb324e4a 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ad3f5ecbd86213b6a0dad102f80ee4077f522c06c9573a93d8d0d6bfda31cebe -size 502847 +oid sha256:e5358711c17e4dfae80b8691f4a00eef7ed741f7ddf33e820e4ff1b439c5fc93 +size 502309 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta index 4618d73699e..a58a1821ba3 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c368b337de4288444a3163613a73ed01 +guid: c615a81f30ebc5a4384830ccb339cdbe TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph index 2a130b7db9a..73d6bbc1646 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph @@ -1359,7 +1359,7 @@ } { - "m_Version": 0, + "m_Version": 1, "m_Type": "UnityEditor.ShaderGraph.ColorNode", "m_ObjectId": "e9e1ac0424e54cea87d5d48125f2d7f1", "m_Group": { @@ -1371,10 +1371,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -930.9999389648438, - "y": 178.99998474121095, + "x": -927.9998779296875, + "y": 156.0, "width": 207.99998474121095, - "height": 126.99999237060547 + "height": 127.20000457763672 } }, "m_Slots": [ diff --git a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index e2783a4c6d5..c3f02543d19 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -310,7 +310,7 @@ protected AbstractMaterialNode() { m_DrawState.expanded = true; m_NodeVersion = GetCompiledNodeVersion(); - internalVersion = 0; + localVersion = 0; } public void GetInputSlots(List foundSlots) where T : MaterialSlot @@ -677,7 +677,7 @@ public virtual void Concretize() EvaluateDynamicMaterialSlots(); if(!hasError) { - ++internalVersion; + ++localVersion; } } @@ -686,7 +686,7 @@ public virtual void ValidateNode() } - public int internalVersion { get; set; } + public int localVersion { get; set; } public virtual bool canCutNode => true; public virtual bool canCopyNode => true; diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs index d6e9b886a0c..ec72f438ee2 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs @@ -31,10 +31,22 @@ VisualElement CreateGUI(AbstractMaterialNode node, InspectableAttribute attribut VisualElement nodeSettings = new VisualElement(); var nameLabel = PropertyDrawerUtils.CreateLabel($"{node.name} Node", 0, FontStyle.Bold); nodeSettings.Add(nameLabel); - if(node.version < node.latestVersion && !ShaderGraphPreferences.allowDeprecatedBehaviors) + if (node.version < node.latestVersion) { - var help = HelpBoxRow.GetDeprecatedHelpBoxRow($"{node.name} Node", () => node.ChangeVersion(node.latestVersion)); - nodeSettings.Insert(0, help); + var help = HelpBoxRow.TryGetDeprecatedHelpBoxRow($"{node.name} Node", () => + { + m_setNodesAsDirtyCallback?.Invoke(); + node.owner.owner.RegisterCompleteObjectUndo($"Update {node.name} Node"); + node.ChangeVersion(node.latestVersion); + inspectorUpdateDelegate?.Invoke(); + m_updateNodeViewsCallback?.Invoke(); + node.Dirty(ModificationScope.Graph); + }); + + if (help != null) + { + nodeSettings.Insert(0, help); + } } EnumField precisionField = null; if(node.canSetPrecision) diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index a0c090281dc..7a07978e9de 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -212,11 +212,14 @@ void BuildPropertyFields(PropertySheet propertySheet) if(property == null) return; - if (property.version < property.latestVersion && !ShaderGraphPreferences.allowDeprecatedBehaviors) + if (property.version < property.latestVersion) { var typeString = property.propertyType.ToString(); - var help = HelpBoxRow.GetDeprecatedHelpBoxRow($"{typeString} Property", () => property.ChangeVersion(property.latestVersion)); - propertySheet.Insert(0,help); + var help = HelpBoxRow.TryGetDeprecatedHelpBoxRow($"{typeString} Property", () => property.ChangeVersion(property.latestVersion)); + if (help != null) + { + propertySheet.Insert(0, help); + } } switch (property) diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs index 6b33d29e60a..3680d60e9cc 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs @@ -47,7 +47,7 @@ public HelpBoxRow(MessageType type) hierarchy.Add(container); } - public static HelpBoxRow GetDeprecatedHelpBoxRow(string deprecatedTypeName, Action upgradeAction) + public static HelpBoxRow TryGetDeprecatedHelpBoxRow(string deprecatedTypeName, Action upgradeAction) { HelpBoxRow help = null; if (!ShaderGraphPreferences.allowDeprecatedBehaviors) From cde63091102b9fe7178adf7f2cfb57ef259a1bf8 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Thu, 13 Aug 2020 13:20:54 -0500 Subject: [PATCH 13/34] fixing previews and updating reference image again --- .../Direct3D11/None/InputNodes.png | 4 +- .../Direct3D11/None/InputNodes.png.meta | 2 +- .../Graphs/Input/Basic/ColorNode.shadergraph | 1467 +++++++++++------ .../Input/Basic/ColorNodeHDR.shadergraph | 480 +++++- .../Editor/Data/Graphs/ColorShaderProperty.cs | 33 +- .../Data/Nodes/Input/Basic/ColorNode.cs | 54 +- 6 files changed, 1545 insertions(+), 495 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png index 84ffb324e4a..9afa5dc86b1 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e5358711c17e4dfae80b8691f4a00eef7ed741f7ddf33e820e4ff1b439c5fc93 -size 502309 +oid sha256:6c0594d5cc6af44c8cf13843a176d32e5e4637c1662706341ed5226a1f119f97 +size 573979 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta index a58a1821ba3..a2791e796cd 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c615a81f30ebc5a4384830ccb339cdbe +guid: 0ee7e389d33ccec4384c4794b057b1be TextureImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph index b3c6338a91c..da6492d53d2 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph @@ -1,7 +1,7 @@ { + "m_Version": 2, "m_Type": "UnityEditor.ShaderGraph.GraphData", "m_ObjectId": "f9530e754b39480689640fe72a2f3184", - "m_Version": 2, "m_Properties": [ { "m_Id": "9cbb7d0f6a9f4600a30ce1093efb115f" @@ -34,28 +34,40 @@ "m_Id": "0b238d3b3c804a81ab6f272addc36d58" }, { - "m_Id": "d7bd3dec13d141d6a4d0e3d74079f7e6" + "m_Id": "6e3d4b970aa2416ca5378e3f5fcd942b" + }, + { + "m_Id": "06b55a13f65d4bc7b5480fc38147cf0e" + }, + { + "m_Id": "2af2e02a77c14b08b16a3fd1276efe6f" + }, + { + "m_Id": "6b1384a8b963457b9d006f8da9e686d5" }, { - "m_Id": "eb89254fdc994b87850a8e471d775574" + "m_Id": "d3bc1ddf42214d8cbdc21b00958aede3" }, { - "m_Id": "adf6b827ef4a47f89fd648d56316af83" + "m_Id": "8d55f22092f34b10992fc2a8cd1ef493" }, { - "m_Id": "34631918f8cc49bb8345e1f279902150" + "m_Id": "de8ab964a37342bd8aebcfe3df0babcd" }, { - "m_Id": "26923fa85dc6475cb9c31a860adeaf89" + "m_Id": "c83b5956457e428f9a0e03a5df54b835" }, { - "m_Id": "57cff171b45849f697f013e0e124896f" + "m_Id": "c26ca31aee1f404aa3958df860cb66b6" }, { - "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + "m_Id": "506b654a5dec4da7a519f3514feec328" }, { - "m_Id": "0ed0d756daa34e93b979108bcfa7ae3f" + "m_Id": "85f5e15718e34aa09a17407f01dc0f1b" + }, + { + "m_Id": "2323bcca48a94fbb98b043e3c8724e00" } ], "m_GroupDatas": [], @@ -64,13 +76,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "0ed0d756daa34e93b979108bcfa7ae3f" + "m_Id": "06b55a13f65d4bc7b5480fc38147cf0e" }, - "m_SlotId": 0 + "m_SlotId": 1 }, "m_InputSlot": { "m_Node": { - "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + "m_Id": "2af2e02a77c14b08b16a3fd1276efe6f" }, "m_SlotId": 1 } @@ -78,13 +90,27 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "26923fa85dc6475cb9c31a860adeaf89" + "m_Id": "06b55a13f65d4bc7b5480fc38147cf0e" }, - "m_SlotId": 0 + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "6b1384a8b963457b9d006f8da9e686d5" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "06b55a13f65d4bc7b5480fc38147cf0e" + }, + "m_SlotId": 1 }, "m_InputSlot": { "m_Node": { - "m_Id": "57cff171b45849f697f013e0e124896f" + "m_Id": "8d55f22092f34b10992fc2a8cd1ef493" }, "m_SlotId": 1 } @@ -92,13 +118,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "34631918f8cc49bb8345e1f279902150" + "m_Id": "2af2e02a77c14b08b16a3fd1276efe6f" }, "m_SlotId": 2 }, "m_InputSlot": { "m_Node": { - "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + "m_Id": "d3bc1ddf42214d8cbdc21b00958aede3" }, "m_SlotId": 2 } @@ -106,13 +132,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "57cff171b45849f697f013e0e124896f" + "m_Id": "506b654a5dec4da7a519f3514feec328" }, "m_SlotId": 3 }, "m_InputSlot": { "m_Node": { - "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + "m_Id": "f6a451b4d3c2482984b1e4d50d61dbe5" }, "m_SlotId": 0 } @@ -120,13 +146,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "adf6b827ef4a47f89fd648d56316af83" + "m_Id": "6b1384a8b963457b9d006f8da9e686d5" }, "m_SlotId": 2 }, "m_InputSlot": { "m_Node": { - "m_Id": "57cff171b45849f697f013e0e124896f" + "m_Id": "c83b5956457e428f9a0e03a5df54b835" }, "m_SlotId": 2 } @@ -134,13 +160,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "d7bd3dec13d141d6a4d0e3d74079f7e6" + "m_Id": "6e3d4b970aa2416ca5378e3f5fcd942b" }, "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "eb89254fdc994b87850a8e471d775574" + "m_Id": "06b55a13f65d4bc7b5480fc38147cf0e" }, "m_SlotId": 0 } @@ -148,27 +174,69 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "e75f0ae4cb7349589d2554de42b18f3a" + "m_Id": "85f5e15718e34aa09a17407f01dc0f1b" }, - "m_SlotId": 3 + "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "f6a451b4d3c2482984b1e4d50d61dbe5" + "m_Id": "506b654a5dec4da7a519f3514feec328" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "8d55f22092f34b10992fc2a8cd1ef493" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "506b654a5dec4da7a519f3514feec328" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c26ca31aee1f404aa3958df860cb66b6" }, "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "c83b5956457e428f9a0e03a5df54b835" + }, + "m_SlotId": 1 } }, { "m_OutputSlot": { "m_Node": { - "m_Id": "e9764189650c4bf19b67df5739c5bc7c" + "m_Id": "c83b5956457e428f9a0e03a5df54b835" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "506b654a5dec4da7a519f3514feec328" }, "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d3bc1ddf42214d8cbdc21b00958aede3" + }, + "m_SlotId": 3 }, "m_InputSlot": { "m_Node": { - "m_Id": "57cff171b45849f697f013e0e124896f" + "m_Id": "c83b5956457e428f9a0e03a5df54b835" }, "m_SlotId": 0 } @@ -176,13 +244,13 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "eb89254fdc994b87850a8e471d775574" + "m_Id": "de8ab964a37342bd8aebcfe3df0babcd" }, - "m_SlotId": 1 + "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "34631918f8cc49bb8345e1f279902150" + "m_Id": "d3bc1ddf42214d8cbdc21b00958aede3" }, "m_SlotId": 1 } @@ -190,15 +258,29 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "eb89254fdc994b87850a8e471d775574" + "m_Id": "e9764189650c4bf19b67df5739c5bc7c" }, - "m_SlotId": 1 + "m_SlotId": 0 }, "m_InputSlot": { "m_Node": { - "m_Id": "adf6b827ef4a47f89fd648d56316af83" + "m_Id": "2323bcca48a94fbb98b043e3c8724e00" }, - "m_SlotId": 1 + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e9764189650c4bf19b67df5739c5bc7c" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d3bc1ddf42214d8cbdc21b00958aede3" + }, + "m_SlotId": 0 } } ], @@ -255,6 +337,7 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", "m_ObjectId": "06b2a35bf99e45d5828bc6baf348f1c0", "m_Id": 0, @@ -283,14 +366,58 @@ } { + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.SplitNode", + "m_ObjectId": "06b55a13f65d4bc7b5480fc38147cf0e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Split", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1485.0001220703125, + "y": -359.9999694824219, + "width": 120.0, + "height": 149.0 + } + }, + "m_Slots": [ + { + "m_Id": "0f85c29e5d8647bfa19bf9af114d2bb3" + }, + { + "m_Id": "afb0c5ef71aa448dae30eea641b78845" + }, + { + "m_Id": "f8482e461762421f9a254f0a156529f4" + }, + { + "m_Id": "79ff1f86849a48e1b94838034a13720b" + }, + { + "m_Id": "82759ab102f74d528b2f1579ee5b48ca" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "08d37f8f045b41c8bd7a4d6fa6b1eaf6", - "m_Id": 3, - "m_DisplayName": "Out", - "m_SlotType": 1, + "m_ObjectId": "09970e1eb79440dfb9a674126b0acca1", + "m_Id": 1, + "m_DisplayName": "In", + "m_SlotType": 0, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "Out", + "m_ShaderOutputName": "In", "m_StageCapability": 3, "m_Value": { "x": 0.0, @@ -307,6 +434,7 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "0b238d3b3c804a81ab6f272addc36d58", "m_Group": { @@ -338,39 +466,7 @@ } { - "m_Type": "UnityEditor.ShaderGraph.PropertyNode", - "m_ObjectId": "0ed0d756daa34e93b979108bcfa7ae3f", - "m_Group": { - "m_Id": "" - }, - "m_Name": "Property", - "m_NodeVersion": 0, - "m_DrawState": { - "m_Expanded": true, - "m_Position": { - "serializedVersion": "2", - "x": 15.9999418258667, - "y": 830.800048828125, - "width": 128.39999389648438, - "height": 34.000003814697269 - } - }, - "m_Slots": [ - { - "m_Id": "fe5410f470f84fa8a0f4ccd102aad7ac" - } - ], - "m_Precision": 0, - "m_PreviewExpanded": true, - "m_CustomColors": { - "m_SerializableColors": [] - }, - "m_Property": { - "m_Id": "8cec592cd4184ffcae31bb4968a07592" - } -} - -{ + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "0f73d282530d4b6f8288430cace42ce7", "m_Id": 0, @@ -388,20 +484,96 @@ } { + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0f85c29e5d8647bfa19bf9af114d2bb3", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "0fc72a9fc3a04395ae05ea892409bec6", + "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "1c9a73816b9849088de83c17bffd10bd", + "m_ObjectId": "11b1186f975747c89391d6d7f9bb42f6", "m_Id": 1, - "m_DisplayName": "B", + "m_DisplayName": "In", "m_SlotType": 0, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "B", + "m_ShaderOutputName": "In", "m_StageCapability": 3, "m_Value": { - "x": 1.0, - "y": 1.0, - "z": 1.0, - "w": 1.0 + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "128bd62b93d24fd6a60e3969f379f5e4", + "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, @@ -412,6 +584,7 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "210252ce2e9241c2845a6cfe4739d2c9", "m_Group": { @@ -443,43 +616,55 @@ } { - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", - "m_ObjectId": "2456b17aaf7844d5bc9c1ea862eafbd6", - "m_Id": 4, - "m_DisplayName": "A", + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "21b02055ba8f43eab56e8399ece8bf8c", + "m_Id": 3, + "m_DisplayName": "Out", "m_SlotType": 1, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "A", + "m_ShaderOutputName": "Out", "m_StageCapability": 3, - "m_Value": 0.0, - "m_DefaultValue": 0.0, - "m_Labels": [ - "X" - ] + "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": "26923fa85dc6475cb9c31a860adeaf89", + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.PreviewNode", + "m_ObjectId": "2323bcca48a94fbb98b043e3c8724e00", "m_Group": { "m_Id": "" }, - "m_Name": "Property", + "m_Name": "Preview", "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -389.1999206542969, - "y": 409.1999816894531, - "width": 107.20000457763672, - "height": 33.999996185302737 + "x": -859.2000122070313, + "y": -708.3999633789063, + "width": 208.0, + "height": 278.0 } }, "m_Slots": [ { - "m_Id": "94a2f04f12d14389933ebb0699ff562e" + "m_Id": "3942bfc2091c4d609362375a0e97042a" + }, + { + "m_Id": "3b85d0ace3a346feb9b3bce6885daa2d" } ], "m_Precision": 0, @@ -487,38 +672,14 @@ "m_CustomColors": { "m_SerializableColors": [] }, - "m_Property": { - "m_Id": "9cbb7d0f6a9f4600a30ce1093efb115f" - } -} - -{ - "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "300e1bb1a60b4adeb6e31b37e6482cdd", - "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_Width": 208.0, + "m_Height": 208.0 } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.StepNode", - "m_ObjectId": "34631918f8cc49bb8345e1f279902150", + "m_ObjectId": "2af2e02a77c14b08b16a3fd1276efe6f", "m_Group": { "m_Id": "" }, @@ -528,21 +689,21 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -490.0000305175781, - "y": 808.7999877929688, - "width": 208.00001525878907, - "height": 301.99993896484377 + "x": -1221.0001220703125, + "y": -381.9999694824219, + "width": 207.99998474121095, + "height": 301.9999694824219 } }, "m_Slots": [ { - "m_Id": "459aee8a4b8543a0a55dd8afde7a46ae" + "m_Id": "f9367987a07249d6a31c3a39cacdafd6" }, { - "m_Id": "49f44955833b440f9f8fe540f1f20cd1" + "m_Id": "b49bac041ef0444cb63cad642a8459a7" }, { - "m_Id": "300e1bb1a60b4adeb6e31b37e6482cdd" + "m_Id": "ed9a5cbd854e4a889bdd0d14ed6a538e" } ], "m_Precision": 0, @@ -553,37 +714,71 @@ } { - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", - "m_ObjectId": "371d8913b519467e870d532d0609a6d5", + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "2cd1f9de1f004a1aac95a7de8487b888", "m_Id": 3, - "m_DisplayName": "B", + "m_DisplayName": "Out", "m_SlotType": 1, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "B", + "m_ShaderOutputName": "Out", "m_StageCapability": 3, - "m_Value": 0.0, - "m_DefaultValue": 0.0, - "m_Labels": [ - "X" - ] + "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "3b45ababbb1541df93c9c52d1654d383", - "m_Id": 1, - "m_DisplayName": "B", + "m_ObjectId": "3942bfc2091c4d609362375a0e97042a", + "m_Id": 0, + "m_DisplayName": "In", "m_SlotType": 0, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "B", + "m_ShaderOutputName": "In", "m_StageCapability": 3, "m_Value": { - "x": 1.0, - "y": 1.0, - "z": 1.0, - "w": 1.0 + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "3b85d0ace3a346feb9b3bce6885daa2d", + "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, @@ -594,6 +789,7 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "3b9ac9422a07454fa54965bd3f291803", "m_Group": { @@ -625,31 +821,15 @@ } { - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", - "m_ObjectId": "41768a51b53841539cf316a5dd8b512e", - "m_Id": 0, - "m_DisplayName": "Alpha Clip Threshold", - "m_SlotType": 0, - "m_Priority": 2147483647, - "m_Hidden": false, - "m_ShaderOutputName": "AlphaClipThreshold", - "m_StageCapability": 2, - "m_Value": 0.0, - "m_DefaultValue": 0.5, - "m_Labels": [ - "X" - ] -} - -{ + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "443e92aafbac40b381edd5a1218016cc", + "m_ObjectId": "3e5e5b1d08fa49c5af5024591a8e2614", "m_Id": 2, - "m_DisplayName": "T", - "m_SlotType": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "T", + "m_ShaderOutputName": "Out", "m_StageCapability": 3, "m_Value": { "x": 0.0, @@ -666,44 +846,39 @@ } { - "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "459aee8a4b8543a0a55dd8afde7a46ae", + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "41768a51b53841539cf316a5dd8b512e", "m_Id": 0, - "m_DisplayName": "Edge", + "m_DisplayName": "Alpha Clip Threshold", "m_SlotType": 0, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "Edge", - "m_StageCapability": 3, - "m_Value": { - "x": 0.4000000059604645, - "y": 1.0, - "z": 1.0, - "w": 1.0 - }, - "m_DefaultValue": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 0.0 - } + "m_ShaderOutputName": "AlphaClipThreshold", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.5, + "m_Labels": [ + "X" + ] } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "49f44955833b440f9f8fe540f1f20cd1", + "m_ObjectId": "4268017339ea4fe0ad0aa8ba2b102c3a", "m_Id": 1, - "m_DisplayName": "In", + "m_DisplayName": "B", "m_SlotType": 0, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "In", + "m_ShaderOutputName": "B", "m_StageCapability": 3, "m_Value": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 0.0 + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 }, "m_DefaultValue": { "x": 0.0, @@ -714,6 +889,7 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", "m_ObjectId": "4d1c49433eaa45fda6f708c727d2aa7d", "m_ActiveSubTarget": { @@ -727,56 +903,9 @@ } { - "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", - "m_ObjectId": "52ba2f081d6f4163a9b34bf9caa808b5", - "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.DynamicVectorMaterialSlot", - "m_ObjectId": "55997b5e6caa4f52930629e044a75361", - "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", - "m_ObjectId": "57cff171b45849f697f013e0e124896f", + "m_ObjectId": "506b654a5dec4da7a519f3514feec328", "m_Group": { "m_Id": "" }, @@ -786,24 +915,24 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -127.5999526977539, - "y": 440.39996337890627, + "x": -129.0000457763672, + "y": 567.0, "width": 207.99998474121095, "height": 326.0 } }, "m_Slots": [ { - "m_Id": "6f3b107fc4e04e61ab64390d546556ed" + "m_Id": "128bd62b93d24fd6a60e3969f379f5e4" }, { - "m_Id": "1c9a73816b9849088de83c17bffd10bd" + "m_Id": "4268017339ea4fe0ad0aa8ba2b102c3a" }, { - "m_Id": "443e92aafbac40b381edd5a1218016cc" + "m_Id": "603f21dc9a534d8692517ac54ea37780" }, { - "m_Id": "08d37f8f045b41c8bd7a4d6fa6b1eaf6" + "m_Id": "21b02055ba8f43eab56e8399ece8bf8c" } ], "m_Precision": 0, @@ -814,14 +943,15 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "6f3b107fc4e04e61ab64390d546556ed", - "m_Id": 0, - "m_DisplayName": "A", + "m_ObjectId": "603f21dc9a534d8692517ac54ea37780", + "m_Id": 2, + "m_DisplayName": "T", "m_SlotType": 0, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "A", + "m_ShaderOutputName": "T", "m_StageCapability": 3, "m_Value": { "x": 0.0, @@ -838,33 +968,79 @@ } { - "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "732ccedab2be4a699bc90b0e061bc684", - "m_Id": 1, - "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.StepNode", + "m_ObjectId": "6b1384a8b963457b9d006f8da9e686d5", + "m_Group": { + "m_Id": "" }, - "m_DefaultValue": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 0.0 - } -} - + "m_Name": "Step", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1221.0001220703125, + "y": -38.000003814697269, + "width": 207.99998474121095, + "height": 301.9999694824219 + } + }, + "m_Slots": [ + { + "m_Id": "a6f772054e6d4884a090ca363a096dab" + }, + { + "m_Id": "09970e1eb79440dfb9a674126b0acca1" + }, + { + "m_Id": "bd3f00a5f516458a8f1795f38776ccbc" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { - "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "84b62ed3cc3b47d8b756c9c027a24e00", - "m_Id": 3, + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.UVNode", + "m_ObjectId": "6e3d4b970aa2416ca5378e3f5fcd942b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "UV", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1648.0, + "y": -359.9999694824219, + "width": 145.0, + "height": 130.0 + } + }, + "m_Slots": [ + { + "m_Id": "71dba580cb4848dea029d82a6f2dae10" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_OutputChannel": 0 +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "71dba580cb4848dea029d82a6f2dae10", + "m_Id": 0, "m_DisplayName": "Out", "m_SlotType": 1, "m_Priority": 2147483647, @@ -886,10 +1062,29 @@ } { + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "79ff1f86849a48e1b94838034a13720b", + "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": [ + "X" + ] +} + +{ + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", - "m_ObjectId": "8ac7d3538aa74755a0c2281d2513c738", + "m_ObjectId": "81409977dc8741ddbf50186ef67c498d", "m_Id": 0, - "m_DisplayName": "Out", + "m_DisplayName": "Color", "m_SlotType": 1, "m_Priority": 2147483647, "m_Hidden": false, @@ -910,15 +1105,68 @@ } { - "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "8bb822525f8a4f5fadabea2283a1c5bb", - "m_Id": 0, + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "82759ab102f74d528b2f1579ee5b48ca", + "m_Id": 4, "m_DisplayName": "A", - "m_SlotType": 0, + "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": [ + "X" + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "85f5e15718e34aa09a17407f01dc0f1b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -466.0, + "y": 533.0, + "width": 128.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "e62a6ad966514678a2298c3c0b877783" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "8cec592cd4184ffcae31bb4968a07592" + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "8ac7d3538aa74755a0c2281d2513c738", + "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, @@ -934,6 +1182,7 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", "m_ObjectId": "8cec592cd4184ffcae31bb4968a07592", "m_Guid": { @@ -952,67 +1201,56 @@ "b": 0.0, "a": 0.0 }, - "m_Version": 0, "m_ColorMode": 0 } { - "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "8e9180e02332452f9c7266df3c0f0339", - "m_Id": 0, - "m_DisplayName": "Edge", - "m_SlotType": 0, - "m_Priority": 2147483647, - "m_Hidden": false, - "m_ShaderOutputName": "Edge", - "m_StageCapability": 3, - "m_Value": { - "x": 0.20000000298023225, - "y": 1.0, - "z": 1.0, - "w": 1.0 + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.StepNode", + "m_ObjectId": "8d55f22092f34b10992fc2a8cd1ef493", + "m_Group": { + "m_Id": "" }, - "m_DefaultValue": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 0.0 - } -} - -{ - "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", - "m_ObjectId": "94a2f04f12d14389933ebb0699ff562e", - "m_Id": 0, - "m_DisplayName": "Color", - "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_Name": "Step", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1262.0, + "y": 332.0, + "width": 207.99998474121095, + "height": 301.9999694824219 + } }, - "m_DefaultValue": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 0.0 + "m_Slots": [ + { + "m_Id": "f8eafaf14d7245ffac7d5e8194a9472a" + }, + { + "m_Id": "11b1186f975747c89391d6d7f9bb42f6" + }, + { + "m_Id": "3e5e5b1d08fa49c5af5024591a8e2614" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] } } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "97e95b21da8046f095beb93292b0a03d", + "m_ObjectId": "8f2967102a674d5f823a898916471aef", "m_Id": 2, - "m_DisplayName": "Out", - "m_SlotType": 1, + "m_DisplayName": "T", + "m_SlotType": 0, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "Out", + "m_ShaderOutputName": "T", "m_StageCapability": 3, "m_Value": { "x": 0.0, @@ -1029,6 +1267,7 @@ } { + "m_Version": 1, "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", "m_ObjectId": "9cbb7d0f6a9f4600a30ce1093efb115f", "m_Guid": { @@ -1047,28 +1286,11 @@ "b": 0.0, "a": 0.0 }, - "m_Version": 1, "m_ColorMode": 0 } { - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", - "m_ObjectId": "a28bf79c166e428a983a6b9284d64e42", - "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": [ - "X" - ] -} - -{ + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "a2bfc40d2d344b4a9b02ba2c2053694d", "m_Group": { @@ -1100,6 +1322,7 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "a36c2d8a7f6f428ca1c777fdfad16e3f", "m_Group": { @@ -1131,20 +1354,21 @@ } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", - "m_ObjectId": "a52577d9127348d1ae27231293dcd588", - "m_Id": 2, - "m_DisplayName": "T", + "m_ObjectId": "a6f772054e6d4884a090ca363a096dab", + "m_Id": 0, + "m_DisplayName": "Edge", "m_SlotType": 0, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "T", + "m_ShaderOutputName": "Edge", "m_StageCapability": 3, "m_Value": { - "x": 0.0, - "y": 0.0, - "z": 0.0, - "w": 0.0 + "x": 0.20000000298023225, + "y": 1.0, + "z": 1.0, + "w": 1.0 }, "m_DefaultValue": { "x": 0.0, @@ -1155,42 +1379,50 @@ } { - "m_Type": "UnityEditor.ShaderGraph.StepNode", - "m_ObjectId": "adf6b827ef4a47f89fd648d56316af83", - "m_Group": { - "m_Id": "" - }, - "m_Name": "Step", - "m_NodeVersion": 0, - "m_DrawState": { - "m_Expanded": true, - "m_Position": { - "serializedVersion": "2", - "x": -490.0000305175781, - "y": 464.3999938964844, - "width": 208.00001525878907, - "height": 302.0 - } - }, - "m_Slots": [ - { - "m_Id": "8e9180e02332452f9c7266df3c0f0339" - }, - { - "m_Id": "732ccedab2be4a699bc90b0e061bc684" - }, - { - "m_Id": "97e95b21da8046f095beb93292b0a03d" - } - ], - "m_Precision": 0, - "m_PreviewExpanded": true, - "m_CustomColors": { - "m_SerializableColors": [] + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "afb0c5ef71aa448dae30eea641b78845", + "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": [ + "X" + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "b49bac041ef0444cb63cad642a8459a7", + "m_Id": 1, + "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", "m_ObjectId": "b4c2b7b62b214f038f9bcc5820d21ddc", "m_Id": 0, @@ -1219,6 +1451,66 @@ } { + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "bd3f00a5f516458a8f1795f38776ccbc", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "c26ca31aee1f404aa3958df860cb66b6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -755.0001220703125, + "y": 68.0, + "width": 107.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "81409977dc8741ddbf50186ef67c498d" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "9cbb7d0f6a9f4600a30ce1093efb115f" + } +} + +{ + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", "m_ObjectId": "c46afd10ccd043f7bb77c7e36c62595e", "m_Id": 0, @@ -1247,72 +1539,99 @@ } { - "m_Type": "UnityEditor.ShaderGraph.UVNode", - "m_ObjectId": "d7bd3dec13d141d6a4d0e3d74079f7e6", + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "c83b5956457e428f9a0e03a5df54b835", "m_Group": { "m_Id": "" }, - "m_Name": "UV", + "m_Name": "Lerp", "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -917.2000732421875, - "y": 486.800048828125, - "width": 208.0, - "height": 312.79998779296877 + "x": -514.0000610351563, + "y": -80.0, + "width": 207.99998474121095, + "height": 326.0 } }, "m_Slots": [ { - "m_Id": "52ba2f081d6f4163a9b34bf9caa808b5" + "m_Id": "e4af9ba05a24439cb9dd5a8cf7bbe98d" + }, + { + "m_Id": "face138222e54074a7bfd0d2c134ffe6" + }, + { + "m_Id": "8f2967102a674d5f823a898916471aef" + }, + { + "m_Id": "d04343aac5e04ab4aad6fbfad1e64b51" } ], "m_Precision": 0, - "m_PreviewExpanded": false, + "m_PreviewExpanded": true, "m_CustomColors": { "m_SerializableColors": [] - }, - "m_OutputChannel": 0 + } } { - "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", - "m_ObjectId": "d8a18ac4a1aa4a3baa8187f24220a06a" + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "ceb94d7c6bb646d8a47fd227a850035b", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } } { - "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", - "m_ObjectId": "dbcb3ba878804354b7dc90725c37449a", - "m_Id": 0, - "m_DisplayName": "Position", - "m_SlotType": 0, + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d04343aac5e04ab4aad6fbfad1e64b51", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "Position", - "m_StageCapability": 1, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, "m_Value": { "x": 0.0, "y": 0.0, - "z": 0.0 + "z": 0.0, + "w": 0.0 }, "m_DefaultValue": { "x": 0.0, "y": 0.0, - "z": 0.0 - }, - "m_Labels": [ - "X", - "Y", - "Z" - ], - "m_Space": 0 + "z": 0.0, + "w": 0.0 + } } { + "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", - "m_ObjectId": "e75f0ae4cb7349589d2554de42b18f3a", + "m_ObjectId": "d3bc1ddf42214d8cbdc21b00958aede3", "m_Group": { "m_Id": "" }, @@ -1322,24 +1641,24 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": 217.19996643066407, - "y": 766.4000244140625, - "width": 208.00003051757813, - "height": 326.00006103515627 + "x": -859.0001220703125, + "y": -406.0, + "width": 207.99998474121095, + "height": 326.0 } }, "m_Slots": [ { - "m_Id": "8bb822525f8a4f5fadabea2283a1c5bb" + "m_Id": "de43a46865194a71829ae9a4f89465ab" }, { - "m_Id": "3b45ababbb1541df93c9c52d1654d383" + "m_Id": "ceb94d7c6bb646d8a47fd227a850035b" }, { - "m_Id": "a52577d9127348d1ae27231293dcd588" + "m_Id": "f87a28ac928f440bb08e9fcb43557f1a" }, { - "m_Id": "84b62ed3cc3b47d8b756c9c027a24e00" + "m_Id": "2cd1f9de1f004a1aac95a7de8487b888" } ], "m_Precision": 0, @@ -1350,8 +1669,69 @@ } { + "m_Version": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "d8a18ac4a1aa4a3baa8187f24220a06a" +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "dbcb3ba878804354b7dc90725c37449a", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "de43a46865194a71829ae9a4f89465ab", + "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.ColorNode", - "m_ObjectId": "e9764189650c4bf19b67df5739c5bc7c", + "m_ObjectId": "de8ab964a37342bd8aebcfe3df0babcd", "m_Group": { "m_Id": "" }, @@ -1361,15 +1741,15 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -490.0000305175781, - "y": 218.80003356933595, - "width": 208.0, - "height": 127.19998168945313 + "x": -1282.0, + "y": -532.9999389648438, + "width": 207.99998474121095, + "height": 127.0 } }, "m_Slots": [ { - "m_Id": "8ac7d3538aa74755a0c2281d2513c738" + "m_Id": "0fc72a9fc3a04395ae05ea892409bec6" } ], "m_Precision": 0, @@ -1389,65 +1769,122 @@ } { - "m_Type": "UnityEditor.ShaderGraph.SplitNode", - "m_ObjectId": "eb89254fdc994b87850a8e471d775574", + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e4af9ba05a24439cb9dd5a8cf7bbe98d", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "e62a6ad966514678a2298c3c0b877783", + "m_Id": 0, + "m_DisplayName": "ColorDep", + "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_Version": 1, + "m_Type": "UnityEditor.ShaderGraph.ColorNode", + "m_ObjectId": "e9764189650c4bf19b67df5739c5bc7c", "m_Group": { "m_Id": "" }, - "m_Name": "Split", + "m_Name": "Color", "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -753.6000366210938, - "y": 486.800048828125, - "width": 118.79998779296875, - "height": 76.79998779296875 + "x": -1282.0, + "y": -708.3999633789063, + "width": 208.0, + "height": 126.79998779296875 } }, "m_Slots": [ { - "m_Id": "55997b5e6caa4f52930629e044a75361" - }, - { - "m_Id": "a28bf79c166e428a983a6b9284d64e42" - }, - { - "m_Id": "edac3540ed8442f5915ac25414af3c99" - }, - { - "m_Id": "371d8913b519467e870d532d0609a6d5" - }, - { - "m_Id": "2456b17aaf7844d5bc9c1ea862eafbd6" + "m_Id": "8ac7d3538aa74755a0c2281d2513c738" } ], "m_Precision": 0, "m_PreviewExpanded": true, "m_CustomColors": { "m_SerializableColors": [] + }, + "m_Color": { + "color": { + "r": 0.5471698045730591, + "g": 0.0, + "b": 0.0, + "a": 0.0 + }, + "mode": 0 } } { - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", - "m_ObjectId": "edac3540ed8442f5915ac25414af3c99", + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "ed9a5cbd854e4a889bdd0d14ed6a538e", "m_Id": 2, - "m_DisplayName": "G", + "m_DisplayName": "Out", "m_SlotType": 1, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "G", + "m_ShaderOutputName": "Out", "m_StageCapability": 3, - "m_Value": 0.0, - "m_DefaultValue": 0.0, - "m_Labels": [ - "X" - ] + "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "f6a451b4d3c2482984b1e4d50d61dbe5", "m_Group": { @@ -1479,20 +1916,114 @@ } { - "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", - "m_ObjectId": "fe5410f470f84fa8a0f4ccd102aad7ac", - "m_Id": 0, - "m_DisplayName": "ColorDep", + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "f8482e461762421f9a254f0a156529f4", + "m_Id": 2, + "m_DisplayName": "G", "m_SlotType": 1, "m_Priority": 2147483647, "m_Hidden": false, - "m_ShaderOutputName": "Out", + "m_ShaderOutputName": "G", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f87a28ac928f440bb08e9fcb43557f1a", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f8eafaf14d7245ffac7d5e8194a9472a", + "m_Id": 0, + "m_DisplayName": "Edge", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Edge", "m_StageCapability": 3, "m_Value": { + "x": 0.30000001192092898, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { "x": 0.0, "y": 0.0, "z": 0.0, "w": 0.0 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "f9367987a07249d6a31c3a39cacdafd6", + "m_Id": 0, + "m_DisplayName": "Edge", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Edge", + "m_StageCapability": 3, + "m_Value": { + "x": 0.10000000149011612, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "face138222e54074a7bfd0d2c134ffe6", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 }, "m_DefaultValue": { "x": 0.0, diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph index 73d6bbc1646..b8487400fc3 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph @@ -56,6 +56,18 @@ }, { "m_Id": "80daeea527384ab3bd4430902c160801" + }, + { + "m_Id": "c378958c8719457d9aba915e7eb0d242" + }, + { + "m_Id": "18392fe3402440a09eddeda3d1930448" + }, + { + "m_Id": "fdb11d1eb0af4726a79c097c26ff4972" + }, + { + "m_Id": "7b3f4324877b4bc0be967684c47bb3e0" } ], "m_GroupDatas": [], @@ -70,7 +82,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "ad18f0efb4e146a9a6c459decbaf7710" + "m_Id": "7b3f4324877b4bc0be967684c47bb3e0" }, "m_SlotId": 0 } @@ -92,7 +104,7 @@ { "m_OutputSlot": { "m_Node": { - "m_Id": "47dcdf5e8c7e4579b545b7ee6f0bc6dc" + "m_Id": "18392fe3402440a09eddeda3d1930448" }, "m_SlotId": 0 }, @@ -103,6 +115,20 @@ "m_SlotId": 1 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "47dcdf5e8c7e4579b545b7ee6f0bc6dc" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0a5bc40644414c29bb180f16a5fa2a76" + }, + "m_SlotId": 1 + } + }, { "m_OutputSlot": { "m_Node": { @@ -117,6 +143,20 @@ "m_SlotId": 2 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "7b3f4324877b4bc0be967684c47bb3e0" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ad18f0efb4e146a9a6c459decbaf7710" + }, + "m_SlotId": 0 + } + }, { "m_OutputSlot": { "m_Node": { @@ -126,7 +166,7 @@ }, "m_InputSlot": { "m_Node": { - "m_Id": "0a5bc40644414c29bb180f16a5fa2a76" + "m_Id": "7b3f4324877b4bc0be967684c47bb3e0" }, "m_SlotId": 1 } @@ -173,6 +213,20 @@ "m_SlotId": 1 } }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "c317135581b4440188048fb963399372" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "fdb11d1eb0af4726a79c097c26ff4972" + }, + "m_SlotId": 1 + } + }, { "m_OutputSlot": { "m_Node": { @@ -200,12 +254,26 @@ }, "m_SlotId": 0 } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "fdb11d1eb0af4726a79c097c26ff4972" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "7b3f4324877b4bc0be967684c47bb3e0" + }, + "m_SlotId": 2 + } } ], "m_VertexContext": { "m_Position": { - "x": 67.0, - "y": 136.0 + "x": 503.0001220703125, + "y": 962.0 }, "m_Blocks": [ { @@ -221,8 +289,8 @@ }, "m_FragmentContext": { "m_Position": { - "x": 67.0, - "y": 336.0 + "x": 503.0001220703125, + "y": 1162.0 }, "m_Blocks": [ { @@ -266,7 +334,7 @@ "m_ShaderOutputName": "Edge", "m_StageCapability": 3, "m_Value": { - "x": 0.4000000059604645, + "x": 0.20000000298023225, "y": 1.0, "z": 1.0, "w": 1.0 @@ -373,6 +441,31 @@ } } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0a778950400447809335961485546780", + "m_Id": 2, + "m_DisplayName": "T", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "T", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -455,6 +548,46 @@ "m_OutputChannel": 0 } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorNode", + "m_ObjectId": "18392fe3402440a09eddeda3d1930448", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Color", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -931.0, + "y": 335.9999694824219, + "width": 208.0, + "height": 127.0 + } + }, + "m_Slots": [ + { + "m_Id": "510e2646810d4d39b69ef07e305cef79" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Color": { + "color": { + "r": 14.226009368896485, + "g": 0.6439757943153381, + "b": 0.6439757943153381, + "a": 0.0 + }, + "mode": 1 + } +} + { "m_Version": 0, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", @@ -619,10 +752,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -930.9999389648438, - "y": 320.9999694824219, - "width": 207.99998474121095, - "height": 126.99999237060547 + "x": -363.2000732421875, + "y": 791.5999755859375, + "width": 107.20001220703125, + "height": 34.0 } }, "m_Slots": [ @@ -690,6 +823,31 @@ "m_SerializedDescriptor": "VertexDescription.Position" } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "510e2646810d4d39b69ef07e305cef79", + "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -820,6 +978,46 @@ } } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.LerpNode", + "m_ObjectId": "7b3f4324877b4bc0be967684c47bb3e0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Lerp", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -4.999949932098389, + "y": 1162.0001220703125, + "width": 208.0, + "height": 326.0 + } + }, + "m_Slots": [ + { + "m_Id": "da459989ad67461bad9ee1d5d58f61c7" + }, + { + "m_Id": "ce7409a571d94a5bbe6866b7d2e11e18" + }, + { + "m_Id": "0a778950400447809335961485546780" + }, + { + "m_Id": "d6b9d89639bb482cbf9c7f5e28794ecd" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -838,6 +1036,24 @@ ] } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "8028dd1a7fbc4c1f94b176b16af0f02b", + "m_Id": 0, + "m_DisplayName": "New", + "m_SlotType": 1, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "New", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [ + "X" + ] +} + { "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -851,10 +1067,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -391.9999694824219, - "y": 791.9999389648438, - "width": 127.99999237060547, - "height": 33.999996185302737 + "x": -363.0000305175781, + "y": 1145.0, + "width": 128.0, + "height": 34.0 } }, "m_Slots": [ @@ -872,6 +1088,56 @@ } } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "81d4220e2c0d48bbb17dd0606c7b3260", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "82d2fe05ea294d68b216962316bf2795", + "m_Id": 1, + "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", @@ -1067,6 +1333,31 @@ "m_SerializedDescriptor": "SurfaceDescription.BaseColor" } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "bd6aff06f3dc491ca0c84afb2f223698", + "m_Id": 0, + "m_DisplayName": "Edge", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "Edge", + "m_StageCapability": 3, + "m_Value": { + "x": 0.30000001192092898, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", @@ -1128,6 +1419,41 @@ } } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", + "m_ObjectId": "c378958c8719457d9aba915e7eb0d242", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Custom Function", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -870.0000610351563, + "y": -408.0000305175781, + "width": 208.0, + "height": 278.0 + } + }, + "m_Slots": [ + { + "m_Id": "8028dd1a7fbc4c1f94b176b16af0f02b" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SourceType": 0, + "m_FunctionName": "Foo", + "m_FunctionSource": "60404820a3db8e9478bf86a5f0e71594", + "m_FunctionBody": "New = IsGamma();\n" +} + { "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", @@ -1172,7 +1498,7 @@ "m_ShaderOutputName": "Edge", "m_StageCapability": 3, "m_Value": { - "x": 0.20000000298023225, + "x": 0.10000000149011612, "y": 1.0, "z": 1.0, "w": 1.0 @@ -1279,6 +1605,31 @@ "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "ce7409a571d94a5bbe6866b7d2e11e18", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Priority": 2147483647, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + { "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", @@ -1329,6 +1680,56 @@ } } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "d6b9d89639bb482cbf9c7f5e28794ecd", + "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_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "da459989ad67461bad9ee1d5d58f61c7", + "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_Version": 0, "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", @@ -1371,10 +1772,10 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -927.9998779296875, - "y": 156.0, - "width": 207.99998474121095, - "height": 127.20000457763672 + "x": -930.7999877929688, + "y": 169.2000274658203, + "width": 208.0, + "height": 126.79998779296875 } }, "m_Slots": [ @@ -1523,6 +1924,43 @@ } } +{ + "m_Version": 0, + "m_Type": "UnityEditor.ShaderGraph.StepNode", + "m_ObjectId": "fdb11d1eb0af4726a79c097c26ff4972", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Step", + "m_NodeVersion": 0, + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -910.9392700195313, + "y": 1162.060791015625, + "width": 208.0, + "height": 302.0 + } + }, + "m_Slots": [ + { + "m_Id": "bd6aff06f3dc491ca0c84afb2f223698" + }, + { + "m_Id": "82d2fe05ea294d68b216962316bf2795" + }, + { + "m_Id": "81d4220e2c0d48bbb17dd0606c7b3260" + } + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + { "m_Version": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index aba7ec2514d..653f0f4f20c 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -57,11 +57,40 @@ internal override AbstractMaterialNode ToConcreteNode() internal override PreviewProperty GetPreviewMaterialProperty() { - return new PreviewProperty(propertyType) + //Color col = Color.black; + //if(PlayerSettings.colorSpace == ColorSpace.Gamma) + //{ + // if(colorMode == ColorMode.Default) + // { + // col = value; + // } + // else + // { + // col = value; + // } + //} + //else + //{ + // col = value.gamma; + //} + //return new PreviewProperty(propertyType) + //{ + // name = referenceName, + // colorValue = col + //}; + UnityEngine.Color propColor = value; + if (colorMode == ColorMode.HDR) + { + if (PlayerSettings.colorSpace == ColorSpace.Linear) + propColor = propColor.gamma; + } + // we use Vector4 type to avoid all of the automatic color conversions of PropertyType.Color + return new PreviewProperty(PropertyType.Color) { name = referenceName, - colorValue = value + colorValue = propColor }; + } internal override ShaderInput Copy() diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index f70972d34a0..67f404fa4be 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -137,10 +137,62 @@ public override string GetVariableNameForSlot(int slotId) public override void CollectPreviewMaterialProperties(List properties) { + //UnityEngine.Color col = UnityEngine.Color.black; + //if(PlayerSettings.colorSpace == ColorSpace.Gamma) + //{ + // if(color.mode == ColorMode.Default) + // { + // col = color.color.gamma; + // } + // else + // { + // switch(version) + // { + // case 0: + // col = color.color; + // break; + // case 1: + // col = color.color.gamma; + // break; + // } + // } + //} + //else + //{ + // if(color.mode == ColorMode.Default) + // { + // col = color.color.gamma.gamma.gamma; + // } + // else + // { + // switch(version) + // { + // case 0: + // col = color.color; + // break; + // case 1: + // col = color.color.gamma; + // break; + // } + // } + //} + + UnityEngine.Color propColor = color.color; + if (color.mode == ColorMode.HDR) + { + switch(version) + { + case 0: + break; + case 1: + propColor = propColor.gamma; + break; + } + } properties.Add(new PreviewProperty(PropertyType.Color) { name = GetVariableNameForNode(), - colorValue = PlayerSettings.colorSpace == ColorSpace.Linear ? color.color.linear : color.color + colorValue = propColor }); } From 35c6e3401d76539afce1c81628e58de8f2a6c6ac Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Thu, 13 Aug 2020 17:28:12 -0500 Subject: [PATCH 14/34] Unifying position node's version upgrade system with new system, adding search window provider ability to support deprecated node creation if preference is on, and updated Node Views to update title if the node is a deprecated version --- .../Editor/Data/Nodes/AbstractMaterialNode.cs | 23 +------------------ .../Data/Nodes/Input/Geometry/PositionNode.cs | 8 ++++--- .../Editor/Drawing/SearchWindowProvider.cs | 18 ++++++++++++++- .../Editor/Drawing/Views/MaterialNodeView.cs | 11 ++++++++- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index c3f02543d19..b684440746b 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -19,9 +19,6 @@ abstract class AbstractMaterialNode : JsonObject, IGroupItem [SerializeField] private string m_Name; - [SerializeField] - private int m_NodeVersion; - [SerializeField] private DrawState m_DrawState; @@ -309,7 +306,7 @@ public void SetColor(string provider, Color color) protected AbstractMaterialNode() { m_DrawState.expanded = true; - m_NodeVersion = GetCompiledNodeVersion(); + version = latestVersion; localVersion = 0; } @@ -861,19 +858,6 @@ public virtual IEnumerable GetInputsWithNoConnection() return this.GetInputSlots().Where(x => !owner.GetEdges(GetSlotReference(x.id)).Any()); } - public override void OnAfterMultiDeserialize(string json) - { - if (m_NodeVersion != GetCompiledNodeVersion()) - { - UpgradeNodeWithVersion(m_NodeVersion, GetCompiledNodeVersion()); - m_NodeVersion = GetCompiledNodeVersion(); - } - - - - // UpdateNodeAfterDeserialization(); - } - public void SetupSlots() { foreach (var s in m_Slots.SelectValue()) @@ -883,11 +867,6 @@ public void SetupSlots() public virtual void UpdateNodeAfterDeserialization() {} - public virtual int GetCompiledNodeVersion() => 0; - - public virtual void UpgradeNodeWithVersion(int from, int to) - {} - public bool IsSlotConnected(int slotId) { var slot = FindSlot(slotId); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs index ecf9e4b8fad..7bf1c21fc56 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs @@ -13,6 +13,7 @@ namespace UnityEditor.ShaderGraph [Title("Input", "Geometry", "Position")] class PositionNode : GeometryNode, IMayRequirePosition { + public override int latestVersion => 1; private const int kOutputSlotId = 0; public const string kOutputSlotName = "Out"; public override List validSpaces => new List {CoordinateSpace.Object, CoordinateSpace.View, CoordinateSpace.World, CoordinateSpace.Tangent, CoordinateSpace.AbsoluteWorld}; @@ -22,6 +23,7 @@ public PositionNode() name = "Position"; precision = Precision.Float; UpdateNodeAfterDeserialization(); + onBeforeVersionChange += UpgradeNodeWithVersion; } @@ -36,11 +38,11 @@ public sealed override void UpdateNodeAfterDeserialization() RemoveSlotsNameNotMatching(new[] { kOutputSlotId }); } - public override int GetCompiledNodeVersion() => 1; - public override void UpgradeNodeWithVersion(int from, int to) + + public void UpgradeNodeWithVersion(int newVersion) { - if (from == 0 && to == 1 && space == CoordinateSpace.World) + if (version == 0 && newVersion > 0 && space == CoordinateSpace.World) { var names = validSpaces.Select(cs => cs.ToString().PascalToLabel()).ToArray(); spacePopup = new PopupList(names, (int)CoordinateSpace.AbsoluteWorld); diff --git a/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs b/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs index 0cce1eb387b..53479609a5f 100644 --- a/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs +++ b/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs @@ -111,7 +111,19 @@ public void GenerateNodeEntries() if (titleAttribute != null) { var node = (AbstractMaterialNode) Activator.CreateInstance(type); - AddEntries(node, titleAttribute.title, nodeEntries); + if(ShaderGraphPreferences.allowDeprecatedBehaviors && node.latestVersion > 0) + { + for(int i = 0; i <= node.latestVersion; ++i) + { + var depNode = (AbstractMaterialNode)Activator.CreateInstance(type); + depNode.ChangeVersion(i); + AddEntries(depNode, titleAttribute.title.Append($"V{i}").ToArray(), nodeEntries); + } + } + else + { + AddEntries(node, titleAttribute.title, nodeEntries); + } } } @@ -352,6 +364,10 @@ public bool OnSearcherSelectEntry(SearcherItem entry, Vector2 screenMousePositio public AbstractMaterialNode CopyNodeForGraph(AbstractMaterialNode oldNode) { var newNode = (AbstractMaterialNode)Activator.CreateInstance(oldNode.GetType()); + if (ShaderGraphPreferences.allowDeprecatedBehaviors && oldNode.version != newNode.version) + { + newNode.ChangeVersion(oldNode.version); + } if (newNode is SubGraphNode subgraphNode) { subgraphNode.asset = ((SubGraphNode)oldNode).asset; diff --git a/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs b/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs index 3bc1af2c6a6..bb299a102d4 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs @@ -440,7 +440,16 @@ void UpdateTitle() if (node is SubGraphNode subGraphNode && subGraphNode.asset != null) title = subGraphNode.asset.name; else - title = node.name; + { + if (node.version < node.latestVersion) + { + title = node.name + $" (Deprecated V{node.version})"; + } + else + { + title = node.name; + } + } } public void OnModified(ModificationScope scope) From 975507eeb83089aaffb7caf94b9fc9e924a2832f Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 14 Aug 2020 10:21:14 -0500 Subject: [PATCH 15/34] removing comments --- .../Editor/Data/Graphs/ColorShaderProperty.cs | 21 ---------- .../Data/Nodes/Input/Basic/ColorNode.cs | 41 +------------------ 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index 653f0f4f20c..e6ade8e9726 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -57,27 +57,6 @@ internal override AbstractMaterialNode ToConcreteNode() internal override PreviewProperty GetPreviewMaterialProperty() { - //Color col = Color.black; - //if(PlayerSettings.colorSpace == ColorSpace.Gamma) - //{ - // if(colorMode == ColorMode.Default) - // { - // col = value; - // } - // else - // { - // col = value; - // } - //} - //else - //{ - // col = value.gamma; - //} - //return new PreviewProperty(propertyType) - //{ - // name = referenceName, - // colorValue = col - //}; UnityEngine.Color propColor = value; if (colorMode == ColorMode.HDR) { diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index 67f404fa4be..368601d7e75 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -137,47 +137,8 @@ public override string GetVariableNameForSlot(int slotId) public override void CollectPreviewMaterialProperties(List properties) { - //UnityEngine.Color col = UnityEngine.Color.black; - //if(PlayerSettings.colorSpace == ColorSpace.Gamma) - //{ - // if(color.mode == ColorMode.Default) - // { - // col = color.color.gamma; - // } - // else - // { - // switch(version) - // { - // case 0: - // col = color.color; - // break; - // case 1: - // col = color.color.gamma; - // break; - // } - // } - //} - //else - //{ - // if(color.mode == ColorMode.Default) - // { - // col = color.color.gamma.gamma.gamma; - // } - // else - // { - // switch(version) - // { - // case 0: - // col = color.color; - // break; - // case 1: - // col = color.color.gamma; - // break; - // } - // } - //} - UnityEngine.Color propColor = color.color; + //why doesn't this seem to matter which colorspace the project is in? if (color.mode == ColorMode.HDR) { switch(version) From 96f306e9ab705bada05a8ec4e78465c87aa84d56 Mon Sep 17 00:00:00 2001 From: elizabeth-legros <59933602+elizabeth-legros@users.noreply.github.com> Date: Fri, 14 Aug 2020 15:55:45 -0500 Subject: [PATCH 16/34] Update Property-Types.md --- com.unity.shadergraph/Documentation~/Property-Types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Documentation~/Property-Types.md b/com.unity.shadergraph/Documentation~/Property-Types.md index 38b4b09841e..2d5f4654c76 100644 --- a/com.unity.shadergraph/Documentation~/Property-Types.md +++ b/com.unity.shadergraph/Documentation~/Property-Types.md @@ -115,7 +115,7 @@ Displays an HDR color field in the material inspector. |:-------------|:------|:------------| | Default | Vector 4 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | -NOTE: Previous versions actually interpreted the color in linear space. The behavior is corrected now, and previously created color properties will continue to use old behavior unless explicilty upgraded through the [Graph Inspector](Internal-Inspector.md). You may use a **Vector 4** property or convert a new **Color** property back to linear space with the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to mimic old behavior. +NOTE: Previous versions of HDR colors were not corrected for the project colorspace. The behavior is corrected now, and previously created color properties will continue to use old behavior unless explicilty upgraded through the [Graph Inspector](Internal-Inspector.md). You may convert a new **Color** property back to gamma space with the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to mimic old behavior in a linear space project. ## Texture 2D From 30d576786f4dbf9a0ad4c93dcd138c635b4e4f22 Mon Sep 17 00:00:00 2001 From: elizabeth-legros <59933602+elizabeth-legros@users.noreply.github.com> Date: Fri, 14 Aug 2020 16:08:32 -0500 Subject: [PATCH 17/34] Update Color-Node.md --- com.unity.shadergraph/Documentation~/Color-Node.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Documentation~/Color-Node.md b/com.unity.shadergraph/Documentation~/Color-Node.md index a5195dc01a7..1d876a8edc9 100644 --- a/com.unity.shadergraph/Documentation~/Color-Node.md +++ b/com.unity.shadergraph/Documentation~/Color-Node.md @@ -4,6 +4,8 @@ Defines a constant **Vector 4** value in the shader using a **Color** field. Can be converted to a **Color** type [Property](Property-Types.md) via the [Node's](Node.md) context menu. The value of the **Mode** parameter will also respected when generating the [Property](Property-Types.md). +NOTE: Previous versions of the Color Node would convert HDR colors into the incorrect colorspace. The behavior is corrected now, and previously created Color Nodes will continue to use old behavior unless explicilty upgraded through the [Graph Inspector](Internal-Inspector.md). You may use a new Color Node in HDR space passed through one [Colorspace Conversion Node](Colorspace-Conversion-Node.md) **RGB** to **Linear** to mimic old behavior in a linear space project, and two in a Gamma space project. + ## Ports | Name | Direction | Type | Binding | Description | @@ -23,4 +25,4 @@ The following example code represents one possible outcome of this node. ``` float4 _Color = IsGammaSpace() ? float4(1, 2, 3, 4) : float4(SRGBToLinear(float3(1, 2, 3)), 4); -``` \ No newline at end of file +``` From ab47f1ef9aef883821554a0f9505d7caa020e8ba Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Wed, 19 Aug 2020 15:04:28 -0500 Subject: [PATCH 18/34] code review changes --- .../Editor/Material/ShaderGraph/HDSubTarget.cs | 4 ++-- .../Slots/DiffusionProfileInputMaterialSlot.cs | 6 +++--- .../ShaderGraph/TargetData/SystemData.cs | 8 ++++---- .../Editor/Data/Graphs/ColorShaderProperty.cs | 14 +++++++++----- .../Editor/Data/Graphs/GraphData.cs | 6 +++--- .../Editor/Data/Nodes/AbstractMaterialNode.cs | 7 ------- .../Editor/Data/Nodes/Input/Basic/ColorNode.cs | 18 ++++++++++++------ .../Editor/Serialization/MultiJsonInternal.cs | 7 +++++++ 8 files changed, 40 insertions(+), 30 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs index a0beaae06b2..0fe5e31fd0c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs @@ -65,8 +65,8 @@ public virtual ScriptableObject GetMetadataObject() ShaderGraphVersion IVersionable.version { - get => systemData.version; - set => systemData.version = value; + get => systemData.localVersion; + set => systemData.localVersion = value; } // Generate migration description steps to migrate HD shader targets diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs index 6eaec7a4051..11040378362 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs @@ -37,7 +37,7 @@ private class DiffusionProfileSerializer DiffusionProfileSettings m_DiffusionProfileAsset; [SerializeField] - int m_Version; + int m_LocalVersion; DiffusionProfileSlotControlView view; @@ -142,14 +142,14 @@ void UpgradeIfNeeded() #pragma warning disable 618 // Once the profile is upgraded, we set the selected entry to 0 (which was previously none // in the diffusion profile index so it's fine if we don't upgrade it - if (m_Version == 0) + if (m_LocalVersion == 0) { // We need to warn the user that we can't upgrade the diffusion profile but this upgrade code // does not work currently :( // Debug.LogError("Failed to upgrade the diffusion profile slot value, reseting to default value: " + hdAsset.diffusionProfileSettingsList[m_DiffusionProfile.selectedEntry] + // "\nTo remove this message save the shader graph with the new diffusion profile reference"); // m_DiffusionProfileAsset = hdAsset.diffusionProfileSettingsList[m_DiffusionProfile.selectedEntry]; - m_Version = 1; + m_LocalVersion = 1; // Sometimes the view is created after we upgrade the slot so we need to update it's value view?.UpdateSlotValue(); } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs index 6df41be68da..dadfe6b2813 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs @@ -119,11 +119,11 @@ public bool dotsInstancing } [SerializeField] - ShaderGraphVersion m_Version = MigrationDescription.LastVersion(); - public ShaderGraphVersion version + ShaderGraphVersion m_localVersion = MigrationDescription.LastVersion(); + public ShaderGraphVersion localVersion { - get => m_Version; - set => m_Version = value; + get => m_localVersion; + set => m_localVersion = value; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index e6ade8e9726..80341182652 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -14,7 +14,6 @@ public sealed class ColorShaderProperty : AbstractShaderProperty internal ColorShaderProperty() { displayName = "Color"; - version = latestVersion; } internal ColorShaderProperty(int version) : this() @@ -58,16 +57,21 @@ internal override AbstractMaterialNode ToConcreteNode() internal override PreviewProperty GetPreviewMaterialProperty() { UnityEngine.Color propColor = value; - if (colorMode == ColorMode.HDR) + if (colorMode == ColorMode.Default) { if (PlayerSettings.colorSpace == ColorSpace.Linear) - propColor = propColor.gamma; + propColor = propColor.linear; } + else if (colorMode == ColorMode.HDR) + { + // conversion from linear to active color space is handled in the shader code (see PropertyNode.cs) + } + // we use Vector4 type to avoid all of the automatic color conversions of PropertyType.Color - return new PreviewProperty(PropertyType.Color) + return new PreviewProperty(PropertyType.Vector4) { name = referenceName, - colorValue = propColor + vector4Value = propColor }; } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs index e4fc82d22ba..0e9eb9d42c8 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs @@ -1628,7 +1628,7 @@ internal void PasteGraph(CopyPasteGraph graphToPaste, List public override void OnBeforeSerialize() { m_Edges.Sort(); - version = latestVersion; + ChangeVersion(latestVersion); } static T DeserializeLegacy(string typeString, string json) where T : JsonObject @@ -1836,7 +1836,7 @@ public override void OnAfterDeserialize(string json) bool deferredUpgrades = version < 2; if(!deferredUpgrades) { - version = latestVersion; + ChangeVersion(latestVersion); } } @@ -1962,7 +1962,7 @@ void UpgradeFromBlockMap(Dictionary blockMap) m_NodeEdges.Clear(); } - version = latestVersion; + ChangeVersion(latestVersion); } PooledList<(LegacyUnknownTypeNode, AbstractMaterialNode)> updatedNodes = PooledList<(LegacyUnknownTypeNode,AbstractMaterialNode)>.Get(); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs index b684440746b..3d5b441e368 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/AbstractMaterialNode.cs @@ -306,8 +306,6 @@ public void SetColor(string provider, Color color) protected AbstractMaterialNode() { m_DrawState.expanded = true; - version = latestVersion; - localVersion = 0; } public void GetInputSlots(List foundSlots) where T : MaterialSlot @@ -672,10 +670,6 @@ public virtual void Concretize() owner?.ClearErrorsForNode(this); EvaluateConcretePrecision(); EvaluateDynamicMaterialSlots(); - if(!hasError) - { - ++localVersion; - } } public virtual void ValidateNode() @@ -683,7 +677,6 @@ public virtual void ValidateNode() } - public int localVersion { get; set; } public virtual bool canCutNode => true; public virtual bool canCopyNode => true; diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index 368601d7e75..d085f96c828 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -28,7 +28,6 @@ public ColorNode() { name = "Color"; UpdateNodeAfterDeserialization(); - version = latestVersion; } @@ -138,22 +137,29 @@ public override string GetVariableNameForSlot(int slotId) public override void CollectPreviewMaterialProperties(List properties) { UnityEngine.Color propColor = color.color; - //why doesn't this seem to matter which colorspace the project is in? + if (color.mode == ColorMode.Default) + { + if (PlayerSettings.colorSpace == ColorSpace.Linear) + propColor = propColor.linear; + } if (color.mode == ColorMode.HDR) { - switch(version) + switch (version) { case 0: break; case 1: - propColor = propColor.gamma; + if (PlayerSettings.colorSpace == ColorSpace.Gamma) + propColor = propColor.gamma; break; } } - properties.Add(new PreviewProperty(PropertyType.Color) + + // we use Vector4 type to avoid all of the automatic color conversions of PropertyType.Color + properties.Add(new PreviewProperty(PropertyType.Vector4) { name = GetVariableNameForNode(), - colorValue = propColor + vector4Value = propColor }); } diff --git a/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs b/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs index a6da5b384ed..336dc7cea0c 100644 --- a/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs +++ b/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs @@ -362,6 +362,13 @@ public static JsonObject CreateInstance(string typeString) return new UnknownJsonObject(typeString); } var output = (JsonObject)Activator.CreateInstance(type, true); + //This CreateInstance function is supposed to esentially create a blank copy of whatever class we end up deserializing into. + //when we typically create new JsonObjects in all other cases, we want that object to be assumed to be the latest version. + //This doesnt work if any json object was serialized before we had the idea of version, as the blank copy would have the + //latest version on creation and since the serialized version wouldnt have a version member, it would not get overwritten + //and we would automatically upgrade all previously serialized json objects incorrectly and without user action. To avoid this, + //we default jsonObject version to 0, and if the serialized value has a different saved version it gets changed and if the serialized + //version does not have a different saved value it remains 0 (earliest version) output.ChangeVersion(0); return output; } From 38adf678518dad759e54325d7cfedf2e7d92c99b Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Thu, 20 Aug 2020 17:05:38 -0500 Subject: [PATCH 19/34] updating graphics text image --- .../Linear/WindowsPlayer/Direct3D11/None/InputNodes.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png index 82ca835e1d8..9afa5dc86b1 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b8bf134ff1c3dd180a22629efd180352a029684c29c608ce48a9a0bc2f35072 -size 502183 +oid sha256:6c0594d5cc6af44c8cf13843a176d32e5e4637c1662706341ed5226a1f119f97 +size 573979 From 250cf3e4aa2940b539338e9dc6a03b73c77b9644 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 28 Aug 2020 10:49:23 -0500 Subject: [PATCH 20/34] name change to not conflict with HD data --- .../Material/ShaderGraph/HDSubTarget.cs | 4 ++-- .../DiffusionProfileInputMaterialSlot.cs | 6 +++--- .../ShaderGraph/TargetData/SystemData.cs | 8 ++++---- .../Data/Attributes/SGVersionAttribute.cs | 19 +++++++++++++++++++ .../Data/Graphs/AbstractShaderProperty.cs | 2 +- .../Editor/Data/Graphs/ColorShaderProperty.cs | 4 ++-- .../Editor/Data/Graphs/GraphData.cs | 8 ++++---- .../Data/Nodes/Input/Basic/ColorNode.cs | 4 ++-- .../Data/Nodes/Input/Geometry/PositionNode.cs | 2 +- .../Editor/Data/Nodes/Input/PropertyNode.cs | 2 +- .../AbstractMaterialNodePropertyDrawer.cs | 2 +- .../ShaderInputPropertyDrawer.cs | 2 +- .../Editor/Drawing/SearchWindowProvider.cs | 4 ++-- .../Editor/Drawing/Views/MaterialNodeView.cs | 4 ++-- .../Editor/Serialization/JsonObject.cs | 8 ++++---- 15 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 com.unity.shadergraph/Editor/Data/Attributes/SGVersionAttribute.cs diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs index 0fe5e31fd0c..a0beaae06b2 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDSubTarget.cs @@ -65,8 +65,8 @@ public virtual ScriptableObject GetMetadataObject() ShaderGraphVersion IVersionable.version { - get => systemData.localVersion; - set => systemData.localVersion = value; + get => systemData.version; + set => systemData.version = value; } // Generate migration description steps to migrate HD shader targets diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs index 11040378362..6eaec7a4051 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Slots/DiffusionProfileInputMaterialSlot.cs @@ -37,7 +37,7 @@ private class DiffusionProfileSerializer DiffusionProfileSettings m_DiffusionProfileAsset; [SerializeField] - int m_LocalVersion; + int m_Version; DiffusionProfileSlotControlView view; @@ -142,14 +142,14 @@ void UpgradeIfNeeded() #pragma warning disable 618 // Once the profile is upgraded, we set the selected entry to 0 (which was previously none // in the diffusion profile index so it's fine if we don't upgrade it - if (m_LocalVersion == 0) + if (m_Version == 0) { // We need to warn the user that we can't upgrade the diffusion profile but this upgrade code // does not work currently :( // Debug.LogError("Failed to upgrade the diffusion profile slot value, reseting to default value: " + hdAsset.diffusionProfileSettingsList[m_DiffusionProfile.selectedEntry] + // "\nTo remove this message save the shader graph with the new diffusion profile reference"); // m_DiffusionProfileAsset = hdAsset.diffusionProfileSettingsList[m_DiffusionProfile.selectedEntry]; - m_LocalVersion = 1; + m_Version = 1; // Sometimes the view is created after we upgrade the slot so we need to update it's value view?.UpdateSlotValue(); } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs index dadfe6b2813..6df41be68da 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/TargetData/SystemData.cs @@ -119,11 +119,11 @@ public bool dotsInstancing } [SerializeField] - ShaderGraphVersion m_localVersion = MigrationDescription.LastVersion(); - public ShaderGraphVersion localVersion + ShaderGraphVersion m_Version = MigrationDescription.LastVersion(); + public ShaderGraphVersion version { - get => m_localVersion; - set => m_localVersion = value; + get => m_Version; + set => m_Version = value; } [SerializeField] diff --git a/com.unity.shadergraph/Editor/Data/Attributes/SGVersionAttribute.cs b/com.unity.shadergraph/Editor/Data/Attributes/SGVersionAttribute.cs new file mode 100644 index 00000000000..005cb8b50ca --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Attributes/SGVersionAttribute.cs @@ -0,0 +1,19 @@ + +using System; +using UnityEditor.ShaderGraph.Serialization; + +[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] +public class SGVersionAttribute : Attribute +{ + private SGVersion m_Version; + public SGVersion version { get => m_Version; } + public SGVersionAttribute(Type type, int behaviorVersion = 0, int explicitVersion = 0) + { + m_Version = new SGVersion() + { + type = type, + behaviorVersion = behaviorVersion, + explicitVersion = explicitVersion + }; + } +} diff --git a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs index 026f42eb89f..f7b5260bec3 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs @@ -112,7 +112,7 @@ internal virtual string GetPropertyAsArgumentString() public virtual string GetPropertyTypeString() { - return propertyType.ToString() + (version < latestVersion ? " (Deprecated)" : ""); + return propertyType.ToString() + (sgVersion < latestVersion ? " (Deprecated)" : ""); } } diff --git a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs index 80341182652..dbcf6e7d263 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/ColorShaderProperty.cs @@ -18,7 +18,7 @@ internal ColorShaderProperty() internal ColorShaderProperty(int version) : this() { - this.version = version; + this.sgVersion = version; } public override PropertyType propertyType => PropertyType.Color; @@ -80,7 +80,7 @@ internal override ShaderInput Copy() { return new ColorShaderProperty() { - version = version, + sgVersion = sgVersion, displayName = displayName, hidden = hidden, value = value, diff --git a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs index 0e9eb9d42c8..89065296864 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs @@ -1665,7 +1665,7 @@ static AbstractMaterialNode DeserializeLegacy(string typeString, string json) public override void OnAfterDeserialize(string json) { - if (version == 0) + if (sgVersion == 0) { var graphData0 = JsonUtility.FromJson(json); @@ -1833,7 +1833,7 @@ public override void OnAfterDeserialize(string json) // In V2 we need to defer version set to in OnAfterMultiDeserialize // This is because we need access to m_OutputNode to convert it to Targets and Stacks // The JsonObject will not be fully deserialized until OnAfterMultiDeserialize - bool deferredUpgrades = version < 2; + bool deferredUpgrades = sgVersion < 2; if(!deferredUpgrades) { ChangeVersion(latestVersion); @@ -1843,9 +1843,9 @@ public override void OnAfterDeserialize(string json) public override void OnAfterMultiDeserialize(string json) { // Deferred upgrades - if(version != latestVersion) + if(sgVersion != latestVersion) { - if(version < 2) + if(sgVersion < 2) { var addedBlocks = ListPool.Get(); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index d085f96c828..c8d0c220712 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -95,7 +95,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo if (generationMode.IsPreview()) return; - switch (version) + switch (sgVersion) { case 0: sb.AppendLine(@"$precision4 {0} = IsGammaSpace() ? $precision4({1}, {2}, {3}, {4}) : $precision4(SRGBToLinear($precision3({1}, {2}, {3})), {4});" @@ -144,7 +144,7 @@ public override void CollectPreviewMaterialProperties(List prop } if (color.mode == ColorMode.HDR) { - switch (version) + switch (sgVersion) { case 0: break; diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs index 7bf1c21fc56..68f2f856ebb 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs @@ -42,7 +42,7 @@ public sealed override void UpdateNodeAfterDeserialization() public void UpgradeNodeWithVersion(int newVersion) { - if (version == 0 && newVersion > 0 && space == CoordinateSpace.World) + if (sgVersion == 0 && newVersion > 0 && space == CoordinateSpace.World) { var names = validSpaces.Select(cs => cs.ToString().PascalToLabel()).ToArray(); spacePopup = new PopupList(names, (int)CoordinateSpace.AbsoluteWorld); diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs index 0dafe061b58..956f7c6cf5a 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs @@ -151,7 +151,7 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); break; case PropertyType.Color: - switch (property.version) + switch (property.sgVersion) { case 0: sb.AppendLine($"$precision4 {GetVariableNameForSlot(OutputSlotId)} = {property.referenceName};"); diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs index ec72f438ee2..6605082f966 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/AbstractMaterialNodePropertyDrawer.cs @@ -31,7 +31,7 @@ VisualElement CreateGUI(AbstractMaterialNode node, InspectableAttribute attribut VisualElement nodeSettings = new VisualElement(); var nameLabel = PropertyDrawerUtils.CreateLabel($"{node.name} Node", 0, FontStyle.Bold); nodeSettings.Add(nameLabel); - if (node.version < node.latestVersion) + if (node.sgVersion < node.latestVersion) { var help = HelpBoxRow.TryGetDeprecatedHelpBoxRow($"{node.name} Node", () => { diff --git a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs index 7a07978e9de..1d14a5f112d 100644 --- a/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs +++ b/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs @@ -212,7 +212,7 @@ void BuildPropertyFields(PropertySheet propertySheet) if(property == null) return; - if (property.version < property.latestVersion) + if (property.sgVersion < property.latestVersion) { var typeString = property.propertyType.ToString(); var help = HelpBoxRow.TryGetDeprecatedHelpBoxRow($"{typeString} Property", () => property.ChangeVersion(property.latestVersion)); diff --git a/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs b/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs index 53479609a5f..a4e882ae836 100644 --- a/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs +++ b/com.unity.shadergraph/Editor/Drawing/SearchWindowProvider.cs @@ -364,9 +364,9 @@ public bool OnSearcherSelectEntry(SearcherItem entry, Vector2 screenMousePositio public AbstractMaterialNode CopyNodeForGraph(AbstractMaterialNode oldNode) { var newNode = (AbstractMaterialNode)Activator.CreateInstance(oldNode.GetType()); - if (ShaderGraphPreferences.allowDeprecatedBehaviors && oldNode.version != newNode.version) + if (ShaderGraphPreferences.allowDeprecatedBehaviors && oldNode.sgVersion != newNode.sgVersion) { - newNode.ChangeVersion(oldNode.version); + newNode.ChangeVersion(oldNode.sgVersion); } if (newNode is SubGraphNode subgraphNode) { diff --git a/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs b/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs index bb299a102d4..b1559c24cca 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs @@ -441,9 +441,9 @@ void UpdateTitle() title = subGraphNode.asset.name; else { - if (node.version < node.latestVersion) + if (node.sgVersion < node.latestVersion) { - title = node.name + $" (Deprecated V{node.version})"; + title = node.name + $" (Deprecated V{node.sgVersion})"; } else { diff --git a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs index 50dc094ce25..c9ef7275a0e 100644 --- a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs +++ b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs @@ -11,8 +11,8 @@ public class JsonObject : ISerializationCallbackReceiver public virtual int latestVersion { get; } = 0; [SerializeField] - protected int m_Version = 0; - public virtual int version { get => m_Version; protected set => m_Version = value; } + protected int m_SGVersion = 0; + public virtual int sgVersion { get => m_SGVersion; protected set => m_SGVersion = value; } internal protected delegate void VersionChange(int newVersion); internal protected VersionChange onBeforeVersionChange; @@ -20,7 +20,7 @@ public class JsonObject : ISerializationCallbackReceiver internal void ChangeVersion(int newVersion) { - if (newVersion == version) + if (newVersion == sgVersion) { return; } @@ -36,7 +36,7 @@ internal void ChangeVersion(int newVersion) } onBeforeVersionChange?.Invoke(newVersion); - version = newVersion; + sgVersion = newVersion; onAfterVersionChange?.Invoke(); } From f3ceffe9f6f4cf963d03592b0e27e3e15d6329e0 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 28 Aug 2020 12:13:47 -0500 Subject: [PATCH 21/34] removing v2 work --- .../Data/Attributes/SGVersionAttribute.cs | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 com.unity.shadergraph/Editor/Data/Attributes/SGVersionAttribute.cs diff --git a/com.unity.shadergraph/Editor/Data/Attributes/SGVersionAttribute.cs b/com.unity.shadergraph/Editor/Data/Attributes/SGVersionAttribute.cs deleted file mode 100644 index 005cb8b50ca..00000000000 --- a/com.unity.shadergraph/Editor/Data/Attributes/SGVersionAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ - -using System; -using UnityEditor.ShaderGraph.Serialization; - -[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] -public class SGVersionAttribute : Attribute -{ - private SGVersion m_Version; - public SGVersion version { get => m_Version; } - public SGVersionAttribute(Type type, int behaviorVersion = 0, int explicitVersion = 0) - { - m_Version = new SGVersion() - { - type = type, - behaviorVersion = behaviorVersion, - explicitVersion = explicitVersion - }; - } -} From 3a9660e1dcd60abd7723a9b17b598db79b957592 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 28 Aug 2020 16:50:32 -0500 Subject: [PATCH 22/34] re-adding default constructor to JsonObject --- com.unity.shadergraph/Editor/Serialization/JsonObject.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs index 167119097cf..7e16e33fa64 100644 --- a/com.unity.shadergraph/Editor/Serialization/JsonObject.cs +++ b/com.unity.shadergraph/Editor/Serialization/JsonObject.cs @@ -43,6 +43,11 @@ internal void ChangeVersion(int newVersion) onAfterVersionChange?.Invoke(); } + public JsonObject() + { + sgVersion = latestVersion; + } + public static readonly string emptyObjectId = Guid.Empty.ToString("N"); [SerializeField] From f17d0886e9af73e0c1b95ed8d4afa6ade7b57dc8 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Fri, 28 Aug 2020 17:32:34 -0500 Subject: [PATCH 23/34] bugfix to colornode preview --- .../Editor/Data/Nodes/Input/Basic/ColorNode.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs index c8d0c220712..bd023c77f4c 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs @@ -147,6 +147,8 @@ public override void CollectPreviewMaterialProperties(List prop switch (sgVersion) { case 0: + if(PlayerSettings.colorSpace == ColorSpace.Linear) + propColor = propColor.linear; break; case 1: if (PlayerSettings.colorSpace == ColorSpace.Gamma) From 997d8856908075bb5dfc57a311f9bc783556e471 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Wed, 23 Sep 2020 14:35:15 -0500 Subject: [PATCH 24/34] bugfix for jsonobject root deserialization --- com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs b/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs index 336dc7cea0c..6c2613ec4c1 100644 --- a/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs +++ b/com.unity.shadergraph/Editor/Serialization/MultiJsonInternal.cs @@ -387,6 +387,7 @@ public static void Deserialize(JsonObject root, List entries, bo { isDeserializing = true; currentRoot = root; + root.ChangeVersion(0); //Same issue as described in CreateInstance for (var index = 0; index < entries.Count; index++) { var entry = entries[index]; From 8a7d0eab821efae415149305a2bf029233ceeca0 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Wed, 23 Sep 2020 15:02:24 -0500 Subject: [PATCH 25/34] Fixing graphs imported with m_Version since it is now m_SGVersion --- .../Graphs/Input/Basic/ColorNode.shadergraph | 126 +++++++++--------- .../Input/Basic/ColorNodeHDR.shadergraph | 124 ++++++++--------- 2 files changed, 125 insertions(+), 125 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph index da6492d53d2..f9a2e263c04 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNode.shadergraph @@ -1,5 +1,5 @@ { - "m_Version": 2, + "m_SGVersion": 2, "m_Type": "UnityEditor.ShaderGraph.GraphData", "m_ObjectId": "f9530e754b39480689640fe72a2f3184", "m_Properties": [ @@ -337,7 +337,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", "m_ObjectId": "06b2a35bf99e45d5828bc6baf348f1c0", "m_Id": 0, @@ -366,7 +366,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SplitNode", "m_ObjectId": "06b55a13f65d4bc7b5480fc38147cf0e", "m_Group": { @@ -409,7 +409,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "09970e1eb79440dfb9a674126b0acca1", "m_Id": 1, @@ -434,7 +434,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "0b238d3b3c804a81ab6f272addc36d58", "m_Group": { @@ -466,7 +466,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "0f73d282530d4b6f8288430cace42ce7", "m_Id": 0, @@ -484,7 +484,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "0f85c29e5d8647bfa19bf9af114d2bb3", "m_Id": 0, @@ -509,7 +509,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "0fc72a9fc3a04395ae05ea892409bec6", "m_Id": 0, @@ -534,7 +534,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "11b1186f975747c89391d6d7f9bb42f6", "m_Id": 1, @@ -559,7 +559,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "128bd62b93d24fd6a60e3969f379f5e4", "m_Id": 0, @@ -584,7 +584,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "210252ce2e9241c2845a6cfe4739d2c9", "m_Group": { @@ -616,7 +616,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "21b02055ba8f43eab56e8399ece8bf8c", "m_Id": 3, @@ -641,7 +641,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PreviewNode", "m_ObjectId": "2323bcca48a94fbb98b043e3c8724e00", "m_Group": { @@ -677,7 +677,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.StepNode", "m_ObjectId": "2af2e02a77c14b08b16a3fd1276efe6f", "m_Group": { @@ -714,7 +714,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "2cd1f9de1f004a1aac95a7de8487b888", "m_Id": 3, @@ -739,7 +739,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "3942bfc2091c4d609362375a0e97042a", "m_Id": 0, @@ -764,7 +764,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "3b85d0ace3a346feb9b3bce6885daa2d", "m_Id": 1, @@ -789,7 +789,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "3b9ac9422a07454fa54965bd3f291803", "m_Group": { @@ -821,7 +821,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "3e5e5b1d08fa49c5af5024591a8e2614", "m_Id": 2, @@ -846,7 +846,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "41768a51b53841539cf316a5dd8b512e", "m_Id": 0, @@ -864,7 +864,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "4268017339ea4fe0ad0aa8ba2b102c3a", "m_Id": 1, @@ -889,7 +889,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", "m_ObjectId": "4d1c49433eaa45fda6f708c727d2aa7d", "m_ActiveSubTarget": { @@ -903,7 +903,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", "m_ObjectId": "506b654a5dec4da7a519f3514feec328", "m_Group": { @@ -943,7 +943,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "603f21dc9a534d8692517ac54ea37780", "m_Id": 2, @@ -968,7 +968,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.StepNode", "m_ObjectId": "6b1384a8b963457b9d006f8da9e686d5", "m_Group": { @@ -1005,7 +1005,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.UVNode", "m_ObjectId": "6e3d4b970aa2416ca5378e3f5fcd942b", "m_Group": { @@ -1037,7 +1037,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "71dba580cb4848dea029d82a6f2dae10", "m_Id": 0, @@ -1062,7 +1062,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "79ff1f86849a48e1b94838034a13720b", "m_Id": 3, @@ -1080,7 +1080,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "81409977dc8741ddbf50186ef67c498d", "m_Id": 0, @@ -1105,7 +1105,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "82759ab102f74d528b2f1579ee5b48ca", "m_Id": 4, @@ -1123,7 +1123,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", "m_ObjectId": "85f5e15718e34aa09a17407f01dc0f1b", "m_Group": { @@ -1157,7 +1157,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "8ac7d3538aa74755a0c2281d2513c738", "m_Id": 0, @@ -1182,7 +1182,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", "m_ObjectId": "8cec592cd4184ffcae31bb4968a07592", "m_Guid": { @@ -1205,7 +1205,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.StepNode", "m_ObjectId": "8d55f22092f34b10992fc2a8cd1ef493", "m_Group": { @@ -1242,7 +1242,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "8f2967102a674d5f823a898916471aef", "m_Id": 2, @@ -1267,7 +1267,7 @@ } { - "m_Version": 1, + "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", "m_ObjectId": "9cbb7d0f6a9f4600a30ce1093efb115f", "m_Guid": { @@ -1290,7 +1290,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "a2bfc40d2d344b4a9b02ba2c2053694d", "m_Group": { @@ -1322,7 +1322,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "a36c2d8a7f6f428ca1c777fdfad16e3f", "m_Group": { @@ -1354,7 +1354,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "a6f772054e6d4884a090ca363a096dab", "m_Id": 0, @@ -1379,7 +1379,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "afb0c5ef71aa448dae30eea641b78845", "m_Id": 1, @@ -1397,7 +1397,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "b49bac041ef0444cb63cad642a8459a7", "m_Id": 1, @@ -1422,7 +1422,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", "m_ObjectId": "b4c2b7b62b214f038f9bcc5820d21ddc", "m_Id": 0, @@ -1451,7 +1451,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "bd3f00a5f516458a8f1795f38776ccbc", "m_Id": 2, @@ -1476,7 +1476,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", "m_ObjectId": "c26ca31aee1f404aa3958df860cb66b6", "m_Group": { @@ -1510,7 +1510,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", "m_ObjectId": "c46afd10ccd043f7bb77c7e36c62595e", "m_Id": 0, @@ -1539,7 +1539,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", "m_ObjectId": "c83b5956457e428f9a0e03a5df54b835", "m_Group": { @@ -1579,7 +1579,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "ceb94d7c6bb646d8a47fd227a850035b", "m_Id": 1, @@ -1604,7 +1604,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "d04343aac5e04ab4aad6fbfad1e64b51", "m_Id": 3, @@ -1629,7 +1629,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", "m_ObjectId": "d3bc1ddf42214d8cbdc21b00958aede3", "m_Group": { @@ -1669,13 +1669,13 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", "m_ObjectId": "d8a18ac4a1aa4a3baa8187f24220a06a" } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", "m_ObjectId": "dbcb3ba878804354b7dc90725c37449a", "m_Id": 0, @@ -1704,7 +1704,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "de43a46865194a71829ae9a4f89465ab", "m_Id": 0, @@ -1729,7 +1729,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ColorNode", "m_ObjectId": "de8ab964a37342bd8aebcfe3df0babcd", "m_Group": { @@ -1769,7 +1769,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "e4af9ba05a24439cb9dd5a8cf7bbe98d", "m_Id": 0, @@ -1794,7 +1794,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "e62a6ad966514678a2298c3c0b877783", "m_Id": 0, @@ -1819,7 +1819,7 @@ } { - "m_Version": 1, + "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.ColorNode", "m_ObjectId": "e9764189650c4bf19b67df5739c5bc7c", "m_Group": { @@ -1859,7 +1859,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "ed9a5cbd854e4a889bdd0d14ed6a538e", "m_Id": 2, @@ -1884,7 +1884,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "f6a451b4d3c2482984b1e4d50d61dbe5", "m_Group": { @@ -1916,7 +1916,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "f8482e461762421f9a254f0a156529f4", "m_Id": 2, @@ -1934,7 +1934,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "f87a28ac928f440bb08e9fcb43557f1a", "m_Id": 2, @@ -1959,7 +1959,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "f8eafaf14d7245ffac7d5e8194a9472a", "m_Id": 0, @@ -1984,7 +1984,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "f9367987a07249d6a31c3a39cacdafd6", "m_Id": 0, @@ -2009,7 +2009,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "face138222e54074a7bfd0d2c134ffe6", "m_Id": 1, diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph index b8487400fc3..cefbae793e8 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph @@ -1,5 +1,5 @@ { - "m_Version": 2, + "m_SGVersion": 2, "m_Type": "UnityEditor.ShaderGraph.GraphData", "m_ObjectId": "7e17b234fc1740429c731f4e774e9a83", "m_Properties": [ @@ -323,7 +323,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "018c4429a0334eed96eae09a9546b003", "m_Id": 0, @@ -348,7 +348,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "063e4268621e4816a2baf64072597020", "m_Id": 2, @@ -373,7 +373,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", "m_ObjectId": "0995773701c24445bba41160bca945f9", "m_Id": 0, @@ -402,7 +402,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", "m_ObjectId": "0a5bc40644414c29bb180f16a5fa2a76", "m_Group": { @@ -442,7 +442,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "0a778950400447809335961485546780", "m_Id": 2, @@ -467,7 +467,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "0b6cfe0982fa4bdb907bc0a43a6b6f8d", "m_Id": 3, @@ -485,7 +485,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "0d6d50a7de1c45af967403bdc5d9e7cb", "m_Group": { @@ -517,7 +517,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.UVNode", "m_ObjectId": "169c1f8986b040f1a2809136013f09b0", "m_Group": { @@ -549,7 +549,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ColorNode", "m_ObjectId": "18392fe3402440a09eddeda3d1930448", "m_Group": { @@ -589,13 +589,13 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", "m_ObjectId": "183c71ccf6594924b77b4ecc9129be29" } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "258cd17f57a34e40aa02d64ab0f4f904", "m_Id": 0, @@ -620,7 +620,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "268a5b5c7d874d97b0d3d709aa7b2794", "m_Id": 0, @@ -645,7 +645,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "292319f4b2b54309a910a9d57417e23f", "m_Id": 2, @@ -670,7 +670,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "296fd70416074faf875470c0ebdf67b7", "m_Id": 2, @@ -688,7 +688,7 @@ } { - "m_Version": 1, + "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", "m_ObjectId": "3aaf7afa840840dfb98a5241f2bac68d", "m_Guid": { @@ -711,7 +711,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", "m_ObjectId": "3ffef190d1af4bb395c8ad038c6bd16f", "m_Id": 0, @@ -740,7 +740,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", "m_ObjectId": "47dcdf5e8c7e4579b545b7ee6f0bc6dc", "m_Group": { @@ -774,7 +774,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "4a7963109f1646399fb9e82679ffccf7", "m_Id": 0, @@ -792,7 +792,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "4c3abdc830fe4083bc26abfbd81fe1d6", "m_Group": { @@ -824,7 +824,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "510e2646810d4d39b69ef07e305cef79", "m_Id": 0, @@ -849,7 +849,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "5ae86e840ab94cb6995bb776bef9aa6a", "m_Id": 4, @@ -867,7 +867,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "62631198aa444d6e8831cfef7436cb54", "m_Id": 0, @@ -892,7 +892,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "6325b20533a3410ba73af78a2dfc699d", "m_Id": 0, @@ -917,7 +917,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.StepNode", "m_ObjectId": "67918591b6314c7ea37209bde6b19f42", "m_Group": { @@ -954,7 +954,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "6a80a929e698467690908de868b5454b", "m_Id": 0, @@ -979,7 +979,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", "m_ObjectId": "7b3f4324877b4bc0be967684c47bb3e0", "m_Group": { @@ -1019,7 +1019,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "7c99f189214b4dc7b4a6f2988eec5219", "m_Id": 1, @@ -1037,7 +1037,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "8028dd1a7fbc4c1f94b176b16af0f02b", "m_Id": 0, @@ -1055,7 +1055,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", "m_ObjectId": "80daeea527384ab3bd4430902c160801", "m_Group": { @@ -1089,7 +1089,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "81d4220e2c0d48bbb17dd0606c7b3260", "m_Id": 2, @@ -1114,7 +1114,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "82d2fe05ea294d68b216962316bf2795", "m_Id": 1, @@ -1139,7 +1139,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.LerpNode", "m_ObjectId": "88be5d15a3884c97965b13c8d3c2f86c", "m_Group": { @@ -1179,7 +1179,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "94cd3ea2857a4d709ff3c5280f0260cb", "m_Id": 2, @@ -1204,7 +1204,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "9c10b753f2b14d6889e0bbfdef79139e", "m_Id": 1, @@ -1229,7 +1229,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", "m_ObjectId": "9ca2003b25484d6aab715cc13565a6b3", "m_Guid": { @@ -1252,7 +1252,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", "m_ObjectId": "9dfa9ac840b147c0b9fae2b4066cf60a", "m_Id": 0, @@ -1277,7 +1277,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "a18ece47c2424dafa00ad16c2772f6df", "m_Id": 3, @@ -1302,7 +1302,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "ad18f0efb4e146a9a6c459decbaf7710", "m_Group": { @@ -1334,7 +1334,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "bd6aff06f3dc491ca0c84afb2f223698", "m_Id": 0, @@ -1359,7 +1359,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", "m_ObjectId": "be0897d4b80743f993c7da1b24cf158c", "m_Id": 0, @@ -1377,7 +1377,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.SplitNode", "m_ObjectId": "c317135581b4440188048fb963399372", "m_Group": { @@ -1420,7 +1420,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", "m_ObjectId": "c378958c8719457d9aba915e7eb0d242", "m_Group": { @@ -1455,7 +1455,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "c3ae2931736d43c6b56dc3ad6d3c08cf", "m_Group": { @@ -1487,7 +1487,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "c51e9ea874104af7909e83bf0ee20d3b", "m_Id": 0, @@ -1512,7 +1512,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.StepNode", "m_ObjectId": "c955ebedab6b4f25b211e7dc4971400b", "m_Group": { @@ -1549,7 +1549,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "caab508145714bd09febb9d7147864df", "m_Id": 0, @@ -1574,7 +1574,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "cbacef4f67fd41ea86c9e8e17adfee66", "m_Group": { @@ -1606,7 +1606,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "ce7409a571d94a5bbe6866b7d2e11e18", "m_Id": 1, @@ -1631,7 +1631,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "d35e11ddebf24d94925e7a77a9184c63", "m_Id": 1, @@ -1656,7 +1656,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "d5b0f2e9853f4eb28193c66a3796373a", "m_Id": 1, @@ -1681,7 +1681,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "d6b9d89639bb482cbf9c7f5e28794ecd", "m_Id": 3, @@ -1706,7 +1706,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "da459989ad67461bad9ee1d5d58f61c7", "m_Id": 0, @@ -1731,7 +1731,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", "m_ObjectId": "dc086dbb8c6f4e5da776741b8850e235", "m_Id": 0, @@ -1760,7 +1760,7 @@ } { - "m_Version": 1, + "m_SGVersion": 1, "m_Type": "UnityEditor.ShaderGraph.ColorNode", "m_ObjectId": "e9e1ac0424e54cea87d5d48125f2d7f1", "m_Group": { @@ -1800,7 +1800,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", "m_ObjectId": "eaa60fa73a174fedbd8e8d3a2f830205", "m_ActiveSubTarget": { @@ -1814,7 +1814,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", "m_ObjectId": "f2c81ddfcd9a4a1293e2ce8e731057f6", "m_Id": 0, @@ -1843,7 +1843,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", "m_ObjectId": "fabb954b7b8d4c808091abd0d2155936", "m_Group": { @@ -1875,7 +1875,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "fb6072c4223747d29244931d20d25f04", "m_Id": 2, @@ -1900,7 +1900,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "fb8ffdfeba6147e2ae2465327051e8a7", "m_Id": 3, @@ -1925,7 +1925,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.StepNode", "m_ObjectId": "fdb11d1eb0af4726a79c097c26ff4972", "m_Group": { @@ -1962,7 +1962,7 @@ } { - "m_Version": 0, + "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", "m_ObjectId": "fdcbb7d717ec40adbb56c094dc0634a7", "m_Id": 1, From de4cba28a1292b480df449d5311e75b35498949b Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Wed, 23 Sep 2020 15:07:53 -0500 Subject: [PATCH 26/34] Changing deprecated help box to return just the update button if Enable Deprecated is turned on in preferences. --- .../Editor/Drawing/Views/HelpBoxRow.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs index 3680d60e9cc..1effa1aa9cf 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/HelpBoxRow.cs @@ -47,20 +47,27 @@ public HelpBoxRow(MessageType type) hierarchy.Add(container); } - public static HelpBoxRow TryGetDeprecatedHelpBoxRow(string deprecatedTypeName, Action upgradeAction) + public static VisualElement TryGetDeprecatedHelpBoxRow(string deprecatedTypeName, Action upgradeAction) { - HelpBoxRow help = null; + string depString = $"The {deprecatedTypeName} has new updates. This version maintains the old behavior. " + + $"If you update a {deprecatedTypeName}, you can use Undo to change it back. See the {deprecatedTypeName} " + + $"documentation for more information."; + Button upgradeButton = new Button(upgradeAction) { text = "Update" , tooltip = depString}; if (!ShaderGraphPreferences.allowDeprecatedBehaviors) { - help = new HelpBoxRow(MessageType.Warning); + HelpBoxRow help = new HelpBoxRow(MessageType.Warning); var label = new Label("DEPRECATED: Hover for info") { - tooltip = $"The {deprecatedTypeName} has new updates. This version maintains the old behavior. If you update a {deprecatedTypeName}, you can use Undo to change it back. See the {deprecatedTypeName} documentation for more information." + tooltip = depString }; help.Add(label); - help.contentContainer.Add(new Button(upgradeAction) { text = "Update" }); + help.contentContainer.Add(upgradeButton); + return help; + } + else + { + return upgradeButton; } - return help; } } } From af01f5fc21a61f5710591817f1fe510c67738172 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Wed, 23 Sep 2020 15:51:30 -0500 Subject: [PATCH 27/34] fixing a few other subgraphs --- .../Input/Basic/ColorNodeHDR.shadergraph | 89 +++---------------- .../Graphs/UV/ParallaxMapping.shadergraph | 2 +- .../UV/ParallaxOcclusionMapping.shadergraph | 2 +- 3 files changed, 12 insertions(+), 81 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph index cefbae793e8..aedf5491f44 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Basic/ColorNodeHDR.shadergraph @@ -57,9 +57,6 @@ { "m_Id": "80daeea527384ab3bd4430902c160801" }, - { - "m_Id": "c378958c8719457d9aba915e7eb0d242" - }, { "m_Id": "18392fe3402440a09eddeda3d1930448" }, @@ -409,7 +406,6 @@ "m_Id": "" }, "m_Name": "Lerp", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -492,7 +488,6 @@ "m_Id": "" }, "m_Name": "VertexDescription.Tangent", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -524,7 +519,6 @@ "m_Id": "" }, "m_Name": "UV", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -556,7 +550,6 @@ "m_Id": "" }, "m_Name": "Color", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -616,7 +609,8 @@ "y": 0.0, "z": 0.0, "w": 0.0 - } + }, + "m_Labels": [] } { @@ -747,7 +741,6 @@ "m_Id": "" }, "m_Name": "Property", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -799,7 +792,6 @@ "m_Id": "" }, "m_Name": "VertexDescription.Position", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -845,7 +837,8 @@ "y": 0.0, "z": 0.0, "w": 0.0 - } + }, + "m_Labels": [] } { @@ -888,7 +881,8 @@ "y": 0.0, "z": 0.0, "w": 0.0 - } + }, + "m_Labels": [] } { @@ -924,7 +918,6 @@ "m_Id": "" }, "m_Name": "Step", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -975,7 +968,8 @@ "y": 0.0, "z": 0.0, "w": 0.0 - } + }, + "m_Labels": [] } { @@ -986,7 +980,6 @@ "m_Id": "" }, "m_Name": "Lerp", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1036,24 +1029,6 @@ ] } -{ - "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", - "m_ObjectId": "8028dd1a7fbc4c1f94b176b16af0f02b", - "m_Id": 0, - "m_DisplayName": "New", - "m_SlotType": 1, - "m_Priority": 2147483647, - "m_Hidden": false, - "m_ShaderOutputName": "New", - "m_StageCapability": 3, - "m_Value": 0.0, - "m_DefaultValue": 0.0, - "m_Labels": [ - "X" - ] -} - { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.PropertyNode", @@ -1062,7 +1037,6 @@ "m_Id": "" }, "m_Name": "Property", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1146,7 +1120,6 @@ "m_Id": "" }, "m_Name": "Lerp", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1273,7 +1246,8 @@ "y": 0.0, "z": 0.0, "w": 0.0 - } + }, + "m_Labels": [] } { @@ -1309,7 +1283,6 @@ "m_Id": "" }, "m_Name": "SurfaceDescription.BaseColor", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1384,7 +1357,6 @@ "m_Id": "" }, "m_Name": "Split", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1419,41 +1391,6 @@ } } -{ - "m_SGVersion": 0, - "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode", - "m_ObjectId": "c378958c8719457d9aba915e7eb0d242", - "m_Group": { - "m_Id": "" - }, - "m_Name": "Custom Function", - "m_NodeVersion": 0, - "m_DrawState": { - "m_Expanded": true, - "m_Position": { - "serializedVersion": "2", - "x": -870.0000610351563, - "y": -408.0000305175781, - "width": 208.0, - "height": 278.0 - } - }, - "m_Slots": [ - { - "m_Id": "8028dd1a7fbc4c1f94b176b16af0f02b" - } - ], - "m_Precision": 0, - "m_PreviewExpanded": true, - "m_CustomColors": { - "m_SerializableColors": [] - }, - "m_SourceType": 0, - "m_FunctionName": "Foo", - "m_FunctionSource": "60404820a3db8e9478bf86a5f0e71594", - "m_FunctionBody": "New = IsGamma();\n" -} - { "m_SGVersion": 0, "m_Type": "UnityEditor.ShaderGraph.BlockNode", @@ -1462,7 +1399,6 @@ "m_Id": "" }, "m_Name": "SurfaceDescription.Alpha", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1519,7 +1455,6 @@ "m_Id": "" }, "m_Name": "Step", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1581,7 +1516,6 @@ "m_Id": "" }, "m_Name": "SurfaceDescription.AlphaClipThreshold", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1767,7 +1701,6 @@ "m_Id": "" }, "m_Name": "Color", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1850,7 +1783,6 @@ "m_Id": "" }, "m_Name": "VertexDescription.Normal", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { @@ -1932,7 +1864,6 @@ "m_Id": "" }, "m_Name": "Step", - "m_NodeVersion": 0, "m_DrawState": { "m_Expanded": true, "m_Position": { diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/UV/ParallaxMapping.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/UV/ParallaxMapping.shadergraph index cc08f5c6060..b7351b7387c 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/UV/ParallaxMapping.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/UV/ParallaxMapping.shadergraph @@ -1,7 +1,7 @@ { "m_Type": "UnityEditor.ShaderGraph.GraphData", "m_ObjectId": "4ea4616e4581427ea9529479eaf564bc", - "m_Version": 2, + "m_SGVersion": 2, "m_Properties": [ { "m_Id": "1cd96718c5744fc191dbead606342d5d" diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/UV/ParallaxOcclusionMapping.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/UV/ParallaxOcclusionMapping.shadergraph index 2503c3decf7..99e91f18526 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/UV/ParallaxOcclusionMapping.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/UV/ParallaxOcclusionMapping.shadergraph @@ -1,7 +1,7 @@ { "m_Type": "UnityEditor.ShaderGraph.GraphData", "m_ObjectId": "4ea4616e4581427ea9529479eaf564bc", - "m_Version": 2, + "m_SGVersion": 2, "m_Properties": [ { "m_Id": "61521253a85d4977aba5572f771b4049" From 20c9d109ba5dd29818597cec3624388897b49da1 Mon Sep 17 00:00:00 2001 From: Sharlene Tan <43795986+sharlenet@users.noreply.github.com> Date: Fri, 25 Sep 2020 11:13:41 -0700 Subject: [PATCH 28/34] Updated Property-Types.md --- com.unity.shadergraph/Documentation~/Property-Types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Documentation~/Property-Types.md b/com.unity.shadergraph/Documentation~/Property-Types.md index 485ce881bcd..1291b7fd93e 100644 --- a/com.unity.shadergraph/Documentation~/Property-Types.md +++ b/com.unity.shadergraph/Documentation~/Property-Types.md @@ -115,7 +115,7 @@ Displays an HDR color field in the material inspector. |:-------------|:------|:------------| | Default | Vector 4 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | -NOTE: Previous versions of HDR colors were not corrected for the project colorspace. The behavior is corrected now, and previously created color properties will continue to use old behavior unless explicilty upgraded through the [Graph Inspector](Internal-Inspector.md). You may convert a new **Color** property back to gamma space with the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to mimic old behavior in a linear space project. +NOTE: In versions prior to 10.0, Shader Graph didn't correct HDR colors for the project colorspace. Version 10.0 corrected this behavior. HDR color properties that you created with older versions maintain the old behavior, but you can use the [Graph Inspector](Internal-Inspector.md) to upgrade them. To mimic the old behavior in a gamma space project, you can use the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to convert a new HDR **Color** property from gamma to linear space. ## Texture 2D From 082bc94f787f09c15a779b7d89a51c6c7ca8efb0 Mon Sep 17 00:00:00 2001 From: Sharlene Tan <43795986+sharlenet@users.noreply.github.com> Date: Fri, 25 Sep 2020 11:16:39 -0700 Subject: [PATCH 29/34] Updated wording --- com.unity.shadergraph/Documentation~/Property-Types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Documentation~/Property-Types.md b/com.unity.shadergraph/Documentation~/Property-Types.md index 1291b7fd93e..44c4bb5ffe2 100644 --- a/com.unity.shadergraph/Documentation~/Property-Types.md +++ b/com.unity.shadergraph/Documentation~/Property-Types.md @@ -115,7 +115,7 @@ Displays an HDR color field in the material inspector. |:-------------|:------|:------------| | Default | Vector 4 | The default value of the [Property](https://docs.unity3d.com/Manual/SL-Properties.html). | -NOTE: In versions prior to 10.0, Shader Graph didn't correct HDR colors for the project colorspace. Version 10.0 corrected this behavior. HDR color properties that you created with older versions maintain the old behavior, but you can use the [Graph Inspector](Internal-Inspector.md) to upgrade them. To mimic the old behavior in a gamma space project, you can use the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to convert a new HDR **Color** property from gamma to linear space. +NOTE: In versions prior to 10.0, Shader Graph didn't correct HDR colors for the project colorspace. Version 10.0 corrected this behavior. HDR color properties that you created with older versions maintain the old behavior, but you can use the [Graph Inspector](Internal-Inspector.md) to upgrade them. To mimic the old behavior in a gamma space project, you can use the [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to convert a new HDR **Color** property from **RGB** to **Linear** space. ## Texture 2D From 3f86a58d2799823c73f5e458edc3d8bd19644d47 Mon Sep 17 00:00:00 2001 From: Sharlene Tan <43795986+sharlenet@users.noreply.github.com> Date: Fri, 25 Sep 2020 11:32:11 -0700 Subject: [PATCH 30/34] Updated Color-Node.md --- com.unity.shadergraph/Documentation~/Color-Node.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.shadergraph/Documentation~/Color-Node.md b/com.unity.shadergraph/Documentation~/Color-Node.md index 1d876a8edc9..5405913ea97 100644 --- a/com.unity.shadergraph/Documentation~/Color-Node.md +++ b/com.unity.shadergraph/Documentation~/Color-Node.md @@ -2,9 +2,9 @@ ## Description -Defines a constant **Vector 4** value in the shader using a **Color** field. Can be converted to a **Color** type [Property](Property-Types.md) via the [Node's](Node.md) context menu. The value of the **Mode** parameter will also respected when generating the [Property](Property-Types.md). +Defines a constant **Vector 4** value in the shader using a **Color** field. Can be converted to a **Color** [Property Type](Property-Types.md) via the [Node's](Node.md) context menu. The value of the **Mode** parameter will also respected when generating the [Property](Property-Types.md). -NOTE: Previous versions of the Color Node would convert HDR colors into the incorrect colorspace. The behavior is corrected now, and previously created Color Nodes will continue to use old behavior unless explicilty upgraded through the [Graph Inspector](Internal-Inspector.md). You may use a new Color Node in HDR space passed through one [Colorspace Conversion Node](Colorspace-Conversion-Node.md) **RGB** to **Linear** to mimic old behavior in a linear space project, and two in a Gamma space project. +NOTE: In versions prior to 10.0, Shader Graph assumed that HDR colors from the Color Node were in gamma space. Version 10.0 corrected this behavior, and Shader Graph now interprets HDR colors in linear space. HDR Color nodes that you created with older versions maintain the old behavior, but you can use the [Graph Inspector](Internal-Inspector.md) to upgrade them. To mimic the old behavior on a new HDR Color node, you can use a [Colorspace Conversion Node](Colorspace-Conversion-Node.md) to convert the HDR color from **RGB** to **Linear**. ## Ports From 343eb3fc848185db0d3750c033e70b0049044171 Mon Sep 17 00:00:00 2001 From: elizabeth-legros <59933602+elizabeth-legros@users.noreply.github.com> Date: Fri, 25 Sep 2020 15:40:06 -0500 Subject: [PATCH 31/34] Update Shader-Graph-Preferences.md --- com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md b/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md index 92a8fe145b1..1d496f6d051 100644 --- a/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md +++ b/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md @@ -8,3 +8,4 @@ To access the Shader Graph Project-wide settings, click **Edit** > **Preferences |:------- |:----------- | |Shader Variant Limit| Enter a value to set the maximum number of shader variants. If your graph exceeds this maximum value, Unity throws the following error: _Validation: Graph is generating too many variants. Either delete Keywords, reduce Keyword variants or increase the Shader Variant Limit in Preferences > Shader Graph._ For more information about shader variants, see [Making multiple shader program variants](https://docs.unity3d.com/Manual/SL-MultipleProgramVariants.html). | | Automatically Add or Remove Block Nodes | Toggle either on or off. If this option is on, when changing Graph Settings any needed Block nodes will be added to the Master Stack. Any incompatible Block nodes that have no incoming connections will be removed from the Master Stack. If this option is off, no Block nodes will be added to or removed from the Master Stack. | +Enable Deprecated Nodes | Enable this setting to turn off warnings for deprecated nodes and properties, which also allows you to create older versions of nodes and properties. If you don't enable this setting, Shader Graph displays warnings for deprecated nodes and properties, and any new nodes and properties you create use the latest version. | From f659bff7d342036811c243c02953a0f053e24f08 Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Mon, 28 Sep 2020 14:44:24 -0500 Subject: [PATCH 32/34] making deprecated flags more consistent and update with preferences --- .../Editor/Data/Graphs/AbstractShaderProperty.cs | 3 ++- .../Drawing/Blackboard/BlackboardFieldView.cs | 14 ++++++++++++++ .../Editor/Drawing/Views/MaterialNodeView.cs | 12 +++++++++++- .../Editor/ShaderGraphPreferences.cs | 11 ++++++++++- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs index f7b5260bec3..c80cf52afc8 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/AbstractShaderProperty.cs @@ -112,7 +112,8 @@ internal virtual string GetPropertyAsArgumentString() public virtual string GetPropertyTypeString() { - return propertyType.ToString() + (sgVersion < latestVersion ? " (Deprecated)" : ""); + string depString = $" (Deprecated{(ShaderGraphPreferences.allowDeprecatedBehaviors ? " V" + sgVersion : "" )})" ; + return propertyType.ToString() + (sgVersion < latestVersion ? depString : ""); } } diff --git a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs index 13fdd1735bf..71a8c6819ce 100644 --- a/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Blackboard/BlackboardFieldView.cs @@ -92,6 +92,14 @@ public void InspectorUpdateTrigger() m_inspectorUpdateTrigger(); } + private void UpdateTypeText() + { + if(shaderInput is AbstractShaderProperty asp) + { + typeText = asp.GetPropertyTypeString(); + } + } + public BlackboardFieldView(GraphData graph, ShaderInput input, BlackBoardCallback updateBlackboardView, Texture icon, string text, string typeText) : base(icon, text, typeText) { @@ -99,6 +107,12 @@ public BlackboardFieldView(GraphData graph, ShaderInput input, BlackBoardCallbac m_Graph = graph; m_Input = input; this.BlackBoardUpdateTrigger = updateBlackboardView; + ShaderGraphPreferences.onAllowDeprecatedChanged += UpdateTypeText; + } + + ~BlackboardFieldView() + { + ShaderGraphPreferences.onAllowDeprecatedChanged -= UpdateTypeText; } public object GetObjectToInspect() diff --git a/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs b/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs index 83e47c0625f..f93718f17b2 100644 --- a/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs +++ b/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs @@ -151,6 +151,8 @@ public void Initialize(AbstractMaterialNode inNode, PreviewManager previewManage // Register OnMouseHover callbacks for node highlighting RegisterCallback(OnMouseHover); RegisterCallback(OnMouseHover); + + ShaderGraphPreferences.onAllowDeprecatedChanged += UpdateTitle; } public bool FindPort(SlotReference slotRef, out ShaderPort port) @@ -443,7 +445,14 @@ void UpdateTitle() { if (node.sgVersion < node.latestVersion) { - title = node.name + $" (Deprecated V{node.sgVersion})"; + if (ShaderGraphPreferences.allowDeprecatedBehaviors) + { + title = node.name + $" (Deprecated V{node.sgVersion})"; + } + else + { + title = node.name + $" (Deprecated)"; + } } else { @@ -713,6 +722,7 @@ public void Dispose() m_PreviewRenderData.onPreviewChanged -= UpdatePreviewTexture; m_PreviewRenderData = null; } + ShaderGraphPreferences.onAllowDeprecatedChanged -= UpdateTitle; } } } diff --git a/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs b/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs index c7d33881f84..1f8dbd081bf 100644 --- a/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs +++ b/com.unity.shadergraph/Editor/ShaderGraphPreferences.cs @@ -16,6 +16,8 @@ static class Keys internal static PreferenceChangedDelegate onVariantLimitChanged; static int m_VariantLimit = 128; + + internal static PreferenceChangedDelegate onAllowDeprecatedChanged; internal static int variantLimit { get { return m_VariantLimit; } @@ -38,7 +40,14 @@ internal static bool autoAddRemoveBlocks internal static bool allowDeprecatedBehaviors { get => m_AllowDeprecatedBehaviors; - set => TrySave(ref m_AllowDeprecatedBehaviors, value, Keys.allowDeprecatedBehaviors); + set + { + TrySave(ref m_AllowDeprecatedBehaviors, value, Keys.allowDeprecatedBehaviors); + if(onAllowDeprecatedChanged != null) + { + onAllowDeprecatedChanged(); + } + } } static ShaderGraphPreferences() From 3deb29793d2e6aef132802e2fcb9fa73682107ee Mon Sep 17 00:00:00 2001 From: Sharlene Tan Date: Tue, 6 Oct 2020 16:46:01 -0700 Subject: [PATCH 33/34] Addition to Upgrade Guide --- .../Documentation~/Upgrade-Guide-10-0-x.md | 18 ++++++++++++++++++ .../images/DeprecatedColorNode.png | 3 +++ .../images/DeprecatedColorProperty.png | 3 +++ .../images/DeprecatedWarning.png | 3 +++ 4 files changed, 27 insertions(+) create mode 100644 com.unity.shadergraph/Documentation~/images/DeprecatedColorNode.png create mode 100644 com.unity.shadergraph/Documentation~/images/DeprecatedColorProperty.png create mode 100644 com.unity.shadergraph/Documentation~/images/DeprecatedWarning.png diff --git a/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md b/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md index bf12cd30c6e..beb9a465f26 100644 --- a/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md +++ b/com.unity.shadergraph/Documentation~/Upgrade-Guide-10-0-x.md @@ -76,3 +76,21 @@ If you have any Custom Function Nodes with custom Shader Graph Preview code that Out = MainLight; #endif ``` + +## Deprecated node and property behaviors + +Previously, some nodes and properties such as the [Color Node](Color-Node.md) didn't behave as intended, but they now work correctly in Shader Graph version 10.0. Older graphs that rely on the incorrect behavior still function the same as before, and you can choose to individually upgrade any deprecated nodes and properties. If you don't enable **Allow Deprecated Behaviors** in [Shader Graph Preferences](Shader-Graph-Preferences.md), newly-created nodes and properties use the latest version node and property behaviors. + +For deprecated nodes, **(Deprecated)** appears after the node title in the main graph view. + +![image](images/DeprecatedColorNode.png) + +For deprecated properties, **(Deprecated)** appears after the property name in the [Blackboard](Blackboard.md). + +![image](images/DeprecatedColorProperty.png) + +When you select a deprecated node or property, a warning appears in the [Internal Inspector](Internal-Inspector.md) along with an **Update** button that allows you to upgrade the selection. You can use undo/redo to reverse this upgrade process. + +![image](images/DeprecatedWarning.png) + +If you enable **Allow Deprecated Behaviors** in [Shader Graph Preferences](Shader-Graph-Preferences.md), Shader Graph displays the version of the deprecated node or property, and doesn't display any warnings even though the **Update** button appears. You can also use the Blackboard or Searcher to create deprecated nodes and properties. \ No newline at end of file diff --git a/com.unity.shadergraph/Documentation~/images/DeprecatedColorNode.png b/com.unity.shadergraph/Documentation~/images/DeprecatedColorNode.png new file mode 100644 index 00000000000..147dc5293a2 --- /dev/null +++ b/com.unity.shadergraph/Documentation~/images/DeprecatedColorNode.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9834cc8a8de80c7fab992862d54898b3cd1a76dafb360490332d7c8bbd743187 +size 21812 diff --git a/com.unity.shadergraph/Documentation~/images/DeprecatedColorProperty.png b/com.unity.shadergraph/Documentation~/images/DeprecatedColorProperty.png new file mode 100644 index 00000000000..d4896a1b637 --- /dev/null +++ b/com.unity.shadergraph/Documentation~/images/DeprecatedColorProperty.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd22355be95f26843a54ddc1a86beca0587b0a10af9eb5b55ae4e5718bcc44c5 +size 11696 diff --git a/com.unity.shadergraph/Documentation~/images/DeprecatedWarning.png b/com.unity.shadergraph/Documentation~/images/DeprecatedWarning.png new file mode 100644 index 00000000000..4f35d0fab8e --- /dev/null +++ b/com.unity.shadergraph/Documentation~/images/DeprecatedWarning.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d63aadb29209ac42046a77c72b9d50b3b2d30ae01bd7b30a11e005f5d6f6bed +size 32578 From 7a42915b20c4d55b181ea359f5cfcf70e7edf59d Mon Sep 17 00:00:00 2001 From: Elizabeth LeGros Date: Wed, 7 Oct 2020 11:54:02 -0500 Subject: [PATCH 34/34] fixing an upgrade issue [Skip CI] --- .../Editor/Data/Graphs/GraphData.cs | 244 +++++++++--------- .../Editor/Data/Legacy/GraphData0.cs | 2 + 2 files changed, 129 insertions(+), 117 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs index 131276f50af..b999f57499b 100644 --- a/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs +++ b/com.unity.shadergraph/Editor/Data/Graphs/GraphData.cs @@ -1792,167 +1792,177 @@ static AbstractMaterialNode DeserializeLegacy(string typeString, string json) public override void OnAfterDeserialize(string json) { + if (sgVersion == 0) { var graphData0 = JsonUtility.FromJson(json); - - var nodeGuidMap = new Dictionary(); - var propertyGuidMap = new Dictionary(); - var keywordGuidMap = new Dictionary(); - var groupGuidMap = new Dictionary(); - var slotsField = typeof(AbstractMaterialNode).GetField("m_Slots", BindingFlags.Instance | BindingFlags.NonPublic); - var propertyField = typeof(PropertyNode).GetField("m_Property", BindingFlags.Instance | BindingFlags.NonPublic); - var keywordField = typeof(KeywordNode).GetField("m_Keyword", BindingFlags.Instance | BindingFlags.NonPublic); - var defaultReferenceNameField = typeof(ShaderInput).GetField("m_DefaultReferenceName", BindingFlags.Instance | BindingFlags.NonPublic); - - m_GroupDatas.Clear(); - m_StickyNoteDatas.Clear(); - - foreach (var group0 in graphData0.m_Groups) + //If a graph was previously updated to V2, since we had to rename m_Version to m_SGVersion to avoid collision with an upgrade system from + //HDRP, we have to handle the case that our version might not be correct - + if (graphData0.m_Version > 0) { - var group = new GroupData(group0.m_Title, group0.m_Position); - m_GroupDatas.Add(group); - if (!groupGuidMap.ContainsKey(group0.m_GuidSerialized)) - { - groupGuidMap.Add(group0.m_GuidSerialized, group); - } - else if (!groupGuidMap[group0.m_GuidSerialized].Equals(group.objectId)) - { - Debug.LogError("Group id mismatch"); - } + sgVersion = graphData0.m_Version; } - - foreach (var serializedProperty in graphData0.m_SerializedProperties) + else { - var property = DeserializeLegacy(serializedProperty.typeInfo.fullName, serializedProperty.JSONnodeData); - if (property == null) - { - continue; - } - m_Properties.Add(property); + var nodeGuidMap = new Dictionary(); + var propertyGuidMap = new Dictionary(); + var keywordGuidMap = new Dictionary(); + var groupGuidMap = new Dictionary(); + var slotsField = typeof(AbstractMaterialNode).GetField("m_Slots", BindingFlags.Instance | BindingFlags.NonPublic); + var propertyField = typeof(PropertyNode).GetField("m_Property", BindingFlags.Instance | BindingFlags.NonPublic); + var keywordField = typeof(KeywordNode).GetField("m_Keyword", BindingFlags.Instance | BindingFlags.NonPublic); + var defaultReferenceNameField = typeof(ShaderInput).GetField("m_DefaultReferenceName", BindingFlags.Instance | BindingFlags.NonPublic); - var input0 = JsonUtility.FromJson(serializedProperty.JSONnodeData); - propertyGuidMap[input0.m_Guid.m_GuidSerialized] = property; + m_GroupDatas.Clear(); + m_StickyNoteDatas.Clear(); - // Fix up missing reference names - // Properties on Sub Graphs in V0 never have reference names serialized - // To maintain Sub Graph node property mapping we force guid based reference names on upgrade - if (string.IsNullOrEmpty((string)defaultReferenceNameField.GetValue(property))) + foreach (var group0 in graphData0.m_Groups) { - // ColorShaderProperty is the only Property case where `GetDefaultReferenceName` was overriden - if (MultiJson.ParseType(serializedProperty.typeInfo.fullName) == typeof(ColorShaderProperty)) + var group = new GroupData(group0.m_Title, group0.m_Position); + m_GroupDatas.Add(group); + if (!groupGuidMap.ContainsKey(group0.m_GuidSerialized)) { - defaultReferenceNameField.SetValue(property, $"Color_{GuidEncoder.Encode(Guid.Parse(input0.m_Guid.m_GuidSerialized))}"); + groupGuidMap.Add(group0.m_GuidSerialized, group); } - else + else if (!groupGuidMap[group0.m_GuidSerialized].Equals(group.objectId)) { - defaultReferenceNameField.SetValue(property, $"{property.concreteShaderValueType}_{GuidEncoder.Encode(Guid.Parse(input0.m_Guid.m_GuidSerialized))}"); + Debug.LogError("Group id mismatch"); } } - } - foreach (var serializedKeyword in graphData0.m_SerializedKeywords) - { - var keyword = DeserializeLegacy(serializedKeyword.typeInfo.fullName, serializedKeyword.JSONnodeData); - if (keyword == null) + foreach (var serializedProperty in graphData0.m_SerializedProperties) { - continue; - } + var property = DeserializeLegacy(serializedProperty.typeInfo.fullName, serializedProperty.JSONnodeData); + if (property == null) + { + continue; + } - m_Keywords.Add(keyword); + m_Properties.Add(property); - var input0 = JsonUtility.FromJson(serializedKeyword.JSONnodeData); - keywordGuidMap[input0.m_Guid.m_GuidSerialized] = keyword; - } + var input0 = JsonUtility.FromJson(serializedProperty.JSONnodeData); + propertyGuidMap[input0.m_Guid.m_GuidSerialized] = property; - foreach (var serializedNode in graphData0.m_SerializableNodes) - { - var node0 = JsonUtility.FromJson(serializedNode.JSONnodeData); + // Fix up missing reference names + // Properties on Sub Graphs in V0 never have reference names serialized + // To maintain Sub Graph node property mapping we force guid based reference names on upgrade + if (string.IsNullOrEmpty((string)defaultReferenceNameField.GetValue(property))) + { + // ColorShaderProperty is the only Property case where `GetDefaultReferenceName` was overriden + if (MultiJson.ParseType(serializedProperty.typeInfo.fullName) == typeof(ColorShaderProperty)) + { + defaultReferenceNameField.SetValue(property, $"Color_{GuidEncoder.Encode(Guid.Parse(input0.m_Guid.m_GuidSerialized))}"); + } + else + { + defaultReferenceNameField.SetValue(property, $"{property.concreteShaderValueType}_{GuidEncoder.Encode(Guid.Parse(input0.m_Guid.m_GuidSerialized))}"); + } + } + } - var node = DeserializeLegacy(serializedNode.typeInfo.fullName, serializedNode.JSONnodeData); - if (node == null) + foreach (var serializedKeyword in graphData0.m_SerializedKeywords) { - continue; - } + var keyword = DeserializeLegacy(serializedKeyword.typeInfo.fullName, serializedKeyword.JSONnodeData); + if (keyword == null) + { + continue; + } - nodeGuidMap.Add(node0.m_GuidSerialized, node); - m_Nodes.Add(node); + m_Keywords.Add(keyword); - if (!string.IsNullOrEmpty(node0.m_PropertyGuidSerialized) && propertyGuidMap.TryGetValue(node0.m_PropertyGuidSerialized, out var property)) - { - propertyField.SetValue(node, (JsonRef)property); + var input0 = JsonUtility.FromJson(serializedKeyword.JSONnodeData); + keywordGuidMap[input0.m_Guid.m_GuidSerialized] = keyword; } - if (!string.IsNullOrEmpty(node0.m_KeywordGuidSerialized) && keywordGuidMap.TryGetValue(node0.m_KeywordGuidSerialized, out var keyword)) + foreach (var serializedNode in graphData0.m_SerializableNodes) { - keywordField.SetValue(node, (JsonRef)keyword); - } + var node0 = JsonUtility.FromJson(serializedNode.JSONnodeData); - var slots = (List>)slotsField.GetValue(node); - slots.Clear(); - - foreach (var serializedSlot in node0.m_SerializableSlots) - { - var slot = DeserializeLegacy(serializedSlot.typeInfo.fullName, serializedSlot.JSONnodeData); - if (slot == null) + var node = DeserializeLegacy(serializedNode.typeInfo.fullName, serializedNode.JSONnodeData); + if (node == null) { continue; } - slots.Add(slot); - } + nodeGuidMap.Add(node0.m_GuidSerialized, node); + m_Nodes.Add(node); - if(!String.IsNullOrEmpty(node0.m_GroupGuidSerialized)) - { - if(groupGuidMap.TryGetValue(node0.m_GroupGuidSerialized, out GroupData foundGroup)) + if (!string.IsNullOrEmpty(node0.m_PropertyGuidSerialized) && propertyGuidMap.TryGetValue(node0.m_PropertyGuidSerialized, out var property)) { - node.group = foundGroup; + propertyField.SetValue(node, (JsonRef)property); + } + + if (!string.IsNullOrEmpty(node0.m_KeywordGuidSerialized) && keywordGuidMap.TryGetValue(node0.m_KeywordGuidSerialized, out var keyword)) + { + keywordField.SetValue(node, (JsonRef)keyword); + } + + var slots = (List>)slotsField.GetValue(node); + slots.Clear(); + + foreach (var serializedSlot in node0.m_SerializableSlots) + { + var slot = DeserializeLegacy(serializedSlot.typeInfo.fullName, serializedSlot.JSONnodeData); + if (slot == null) + { + continue; + } + + slots.Add(slot); + } + + if (!String.IsNullOrEmpty(node0.m_GroupGuidSerialized)) + { + if (groupGuidMap.TryGetValue(node0.m_GroupGuidSerialized, out GroupData foundGroup)) + { + node.group = foundGroup; + } } } - } - foreach (var stickyNote0 in graphData0.m_StickyNotes) - { - var stickyNote = new StickyNoteData(stickyNote0.m_Title, stickyNote0.m_Content, stickyNote0.m_Position); - if(!String.IsNullOrEmpty(stickyNote0.m_GroupGuidSerialized)) + foreach (var stickyNote0 in graphData0.m_StickyNotes) { - if(groupGuidMap.TryGetValue(stickyNote0.m_GroupGuidSerialized, out GroupData foundGroup)) + var stickyNote = new StickyNoteData(stickyNote0.m_Title, stickyNote0.m_Content, stickyNote0.m_Position); + if (!String.IsNullOrEmpty(stickyNote0.m_GroupGuidSerialized)) { - stickyNote.group = foundGroup; + if (groupGuidMap.TryGetValue(stickyNote0.m_GroupGuidSerialized, out GroupData foundGroup)) + { + stickyNote.group = foundGroup; + } } + stickyNote.theme = stickyNote0.m_Theme; + stickyNote.textSize = stickyNote0.m_TextSize; + m_StickyNoteDatas.Add(stickyNote); } - stickyNote.theme = stickyNote0.m_Theme; - stickyNote.textSize = stickyNote0.m_TextSize; - m_StickyNoteDatas.Add(stickyNote); - } - var subgraphOuput = GetNodes(); - isSubGraph = subgraphOuput.Any(); + var subgraphOuput = GetNodes(); + isSubGraph = subgraphOuput.Any(); - if (isSubGraph) - { - m_OutputNode = subgraphOuput.FirstOrDefault(); - } - else if (!string.IsNullOrEmpty(graphData0.m_ActiveOutputNodeGuidSerialized)) - { - m_OutputNode = nodeGuidMap[graphData0.m_ActiveOutputNodeGuidSerialized]; - } - else - { - m_OutputNode = (AbstractMaterialNode)GetNodes().FirstOrDefault(); - } + if (isSubGraph) + { + m_OutputNode = subgraphOuput.FirstOrDefault(); + } + else if (!string.IsNullOrEmpty(graphData0.m_ActiveOutputNodeGuidSerialized)) + { + m_OutputNode = nodeGuidMap[graphData0.m_ActiveOutputNodeGuidSerialized]; + } + else + { + m_OutputNode = (AbstractMaterialNode)GetNodes().FirstOrDefault(); + } - foreach (var serializedElement in graphData0.m_SerializableEdges) - { - var edge0 = JsonUtility.FromJson(serializedElement.JSONnodeData); - m_Edges.Add(new Edge( - new SlotReference( - nodeGuidMap[edge0.m_OutputSlot.m_NodeGUIDSerialized], - edge0.m_OutputSlot.m_SlotId), - new SlotReference( - nodeGuidMap[edge0.m_InputSlot.m_NodeGUIDSerialized], - edge0.m_InputSlot.m_SlotId))); + foreach (var serializedElement in graphData0.m_SerializableEdges) + { + var edge0 = JsonUtility.FromJson(serializedElement.JSONnodeData); + m_Edges.Add(new Edge( + new SlotReference( + nodeGuidMap[edge0.m_OutputSlot.m_NodeGUIDSerialized], + edge0.m_OutputSlot.m_SlotId), + new SlotReference( + nodeGuidMap[edge0.m_InputSlot.m_NodeGUIDSerialized], + edge0.m_InputSlot.m_SlotId))); + } } } diff --git a/com.unity.shadergraph/Editor/Data/Legacy/GraphData0.cs b/com.unity.shadergraph/Editor/Data/Legacy/GraphData0.cs index 9814fa95986..0179f8d5b35 100644 --- a/com.unity.shadergraph/Editor/Data/Legacy/GraphData0.cs +++ b/com.unity.shadergraph/Editor/Data/Legacy/GraphData0.cs @@ -20,5 +20,7 @@ class GraphData0 public List m_StickyNotes; public List m_Groups; + + public int m_Version = -1; } }