diff options
author | chai <chaifix@163.com> | 2020-10-22 23:30:02 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-22 23:30:02 +0800 |
commit | 917e9e0b320775634dc2e710f7deac74fd0822f0 (patch) | |
tree | 637f3cccc80e7738c8a077fa3ff59218b8b18ee8 /Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various | |
parent | 8268e4e308bd110dfea4ad849a7ff74e66951349 (diff) |
* amplify shader editor
Diffstat (limited to 'Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various')
16 files changed, 467 insertions, 0 deletions
diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/ColorSpaceDouble.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/ColorSpaceDouble.cs new file mode 100644 index 00000000..231a0111 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/ColorSpaceDouble.cs @@ -0,0 +1,37 @@ +namespace AmplifyShaderEditor +{ + [System.Serializable] + [NodeAttributes( "Color Space Double", "Miscellaneous", "Color Space Double" )] + public class ColorSpaceDouble : ParentNode + { + private const string ColorSpaceDoubleStr = "unity_ColorSpaceDouble"; + + private readonly string[] ColorSpaceDoubleDef = + { + "#ifdef UNITY_COLORSPACE_GAMMA//ASE Color Space Def", + "#define unity_ColorSpaceDouble half4(2.0, 2.0, 2.0, 2.0)//ASE Color Space Def", + "#else // Linear values//ASE Color Space Def", + "#define unity_ColorSpaceDouble half4(4.59479380, 4.59479380, 4.59479380, 2.0)//ASE Color Space Def", + "#endif//ASE Color Space Def" + }; + + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + AddOutputColorPorts( "RGBA" ); + m_previewShaderGUID = "ac680a8772bb97c46851a7f075fd04e3"; + } + + public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) + { + if( dataCollector.IsTemplate && dataCollector.IsSRP ) + { + for( int i = 0; i < ColorSpaceDoubleDef.Length; i++ ) + { + dataCollector.AddToDirectives( ColorSpaceDoubleDef[ i ], -1 ); + } + } + return GetOutputVectorItem( 0, outputId, ColorSpaceDoubleStr ); ; + } + } +} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/ColorSpaceDouble.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/ColorSpaceDouble.cs.meta new file mode 100644 index 00000000..32721b88 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/ColorSpaceDouble.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7d1204234983b3c4499da752961185be +timeCreated: 1481888315 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/FaceVariableNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/FaceVariableNode.cs new file mode 100644 index 00000000..0570939c --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/FaceVariableNode.cs @@ -0,0 +1,53 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda <info@amplify.pt> + +using System; + +namespace AmplifyShaderEditor +{ + [Serializable] + [NodeAttributes( "Face", "Vertex Data", "Indicates whether the rendered surface is facing the camera (1), or facing away from the camera(-1)" )] + public class FaceVariableNode : ParentNode + { + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + AddOutputPort( WirePortDataType.FLOAT, "Out" ); + m_previewShaderGUID = "4b0b5b9f16353b840a5f5ad2baab3c3c"; + } + + public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) + { + if ( dataCollector.PortCategory == MasterNodePortCategory.Tessellation ) + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " node does not work on Tessellation port" ); + return m_outputPorts[0].ErrorValue; + } + + if ( dataCollector.PortCategory == MasterNodePortCategory.Vertex ) + { + if ( dataCollector.TesselationActive ) + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " node does not work properly on Vertex/Tessellation ports" ); + return m_outputPorts[ 0 ].ErrorValue; + } + else + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " node does not work propery on Vertex ports" ); + return m_outputPorts[ 0 ].ErrorValue; + } + } + + if ( dataCollector.IsTemplate ) + { + return dataCollector.TemplateDataCollectorInstance.GetVFace( UniqueId ); + } + else + { + dataCollector.AddToInput( UniqueId, SurfaceInputs.VFACE ); + string variable = ( dataCollector.PortCategory == MasterNodePortCategory.Vertex ) ? Constants.VertexShaderOutputStr : Constants.InputVarStr; + return variable + "." + Constants.VFaceVariable; + } + } + } +} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/FaceVariableNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/FaceVariableNode.cs.meta new file mode 100644 index 00000000..b583327e --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/FaceVariableNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4b4a6f07436b05a4cbc2559e4e704000 +timeCreated: 1492513159 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/InstanceIdNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/InstanceIdNode.cs new file mode 100644 index 00000000..c845e063 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/InstanceIdNode.cs @@ -0,0 +1,43 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda <info@amplify.pt> + +using System; + +namespace AmplifyShaderEditor +{ + [Serializable] + [NodeAttributes( "Instance ID", "Vertex Data", "Indicates the per-instance identifier" )] + public class InstanceIdNode : ParentNode + { + private readonly string[] InstancingVariableAttrib = + { "uint currInstanceId = 0;", + "#ifdef UNITY_INSTANCING_ENABLED", + "currInstanceId = unity_InstanceID;", + "#endif"}; + private const string InstancingInnerVariable = "currInstanceId"; + + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + AddOutputPort( WirePortDataType.INT, "Out" ); + m_previewShaderGUID = "03febce56a8cf354b90e7d5180c1dbd7"; + } + + public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) + { + if( dataCollector.IsTemplate ) + { + dataCollector.TemplateDataCollectorInstance.SetupInstancing(); + } + + if( !dataCollector.HasLocalVariable( InstancingVariableAttrib[ 0 ] ) ) + { + dataCollector.AddLocalVariable( UniqueId, InstancingVariableAttrib[ 0 ] ,true ); + dataCollector.AddLocalVariable( UniqueId, InstancingVariableAttrib[ 1 ] ,true ); + dataCollector.AddLocalVariable( UniqueId, InstancingVariableAttrib[ 2 ] ,true ); + dataCollector.AddLocalVariable( UniqueId, InstancingVariableAttrib[ 3 ] ,true ); + } + return InstancingInnerVariable; + } + } +} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/InstanceIdNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/InstanceIdNode.cs.meta new file mode 100644 index 00000000..efae4fb9 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/InstanceIdNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c449923583a9fbe4283acebc97756ea1 +timeCreated: 1547811127 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/LODFadeNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/LODFadeNode.cs new file mode 100644 index 00000000..f2a1959f --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/LODFadeNode.cs @@ -0,0 +1,44 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda <info@amplify.pt> + +using System; +namespace AmplifyShaderEditor +{ + [Serializable] + [NodeAttributes( "LOD Fade", "Miscellaneous", "LODFadeNode" )] + public sealed class LODFadeNode : ConstVecShaderVariable + { + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + ChangeOutputName( 1, "Fade[0...1]" ); + ChangeOutputName( 2, "Fade[16Lvl]" ); + ChangeOutputName( 3, "Unused" ); + ChangeOutputName( 4, "Unused" ); + m_value = "unity_LODFade"; + m_previewShaderGUID = "fcd4d93f57ffc51458d4ade10df2fdb4"; + } + + public override void RefreshExternalReferences() + { + base.RefreshExternalReferences(); + if( !m_outputPorts[ 0 ].IsConnected ) + { + m_outputPorts[ 0 ].Visible = false; + m_sizeIsDirty = true; + } + + if( !m_outputPorts[ 3 ].IsConnected ) + { + m_outputPorts[ 3 ].Visible = false; + m_sizeIsDirty = true; + } + + if( !m_outputPorts[ 4 ].IsConnected ) + { + m_outputPorts[ 4 ].Visible = false; + m_sizeIsDirty = true; + } + } + } +} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/LODFadeNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/LODFadeNode.cs.meta new file mode 100644 index 00000000..a83635a4 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/LODFadeNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f96cf34c2936c96458403e9cf75e8e10 +timeCreated: 1481126960 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/PrimitiveIdVariableNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/PrimitiveIdVariableNode.cs new file mode 100644 index 00000000..b60f8472 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/PrimitiveIdVariableNode.cs @@ -0,0 +1,38 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda <info@amplify.pt> +#if UNITY_EDITOR_WIN +using System; + +namespace AmplifyShaderEditor +{ + [Serializable] + [NodeAttributes( "Primitive ID", "Vertex Data", "Per-primitive identifier automatically generated by the runtime" )] + public class PrimitiveIDVariableNode : ParentNode + { + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + AddOutputPort( WirePortDataType.INT, "Out" ); + m_previewShaderGUID = "92c1b588d7658594cb219696f593f64b"; + } + + public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) + { + if( !dataCollector.IsTemplate ) + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " is not supported on surface shaders." ); + return m_outputPorts[0].ErrorValue; + } + + if ( dataCollector.PortCategory == MasterNodePortCategory.Vertex ) + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " is not supported on Vertex ports" ); + return m_outputPorts[0].ErrorValue; + } + + return dataCollector.TemplateDataCollectorInstance.GetPrimitiveId(); + } + } +} +#endif + diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/PrimitiveIdVariableNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/PrimitiveIdVariableNode.cs.meta new file mode 100644 index 00000000..6d7d119b --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/PrimitiveIdVariableNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dd0af9fbbba750341a7b09316178f285 +timeCreated: 1492513159 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/SwitchByFaceNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/SwitchByFaceNode.cs new file mode 100644 index 00000000..6bfd7f36 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/SwitchByFaceNode.cs @@ -0,0 +1,70 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda <info@amplify.pt> + +using System; + +using UnityEngine; + +namespace AmplifyShaderEditor +{ + [Serializable] + [NodeAttributes( "Switch by Face", "Miscellaneous", "Switch which automaticaly uses a Face variable to select which input to use" )] + public class SwitchByFaceNode : DynamicTypeNode + { + private const string SwitchOp = "((({0}>0)?({1}):({2})))"; + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + m_inputPorts[ 0 ].Name = "Front"; + m_inputPorts[ 1 ].Name = "Back"; + m_textLabelWidth = 50; + m_previewShaderGUID = "f4edf6febb54dc743b25bd5b56facea8"; + } + + + + public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) + { + if ( dataCollector.PortCategory == MasterNodePortCategory.Tessellation ) + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " does not work on Tessellation port" ); + return GenerateErrorValue(); + } + + if ( dataCollector.PortCategory == MasterNodePortCategory.Vertex ) + { + if ( dataCollector.TesselationActive ) + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " does not work properly on Vertex/Tessellation ports" ); + return GenerateErrorValue(); + } + else + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " does not work properly on Vertex ports" ); + return GenerateErrorValue(); + } + } + + if ( m_outputPorts[ 0 ].IsLocalValue( dataCollector.PortCategory ) ) + return m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory ); + + string front = m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector ); + string back = m_inputPorts[ 1 ].GeneratePortInstructions( ref dataCollector ); + + dataCollector.AddToInput( UniqueId, SurfaceInputs.VFACE ); + string variable = string.Empty; + if ( dataCollector.IsTemplate ) + { + variable = dataCollector.TemplateDataCollectorInstance.GetVFace( UniqueId ); + } + else + { + variable = ( ( dataCollector.PortCategory == MasterNodePortCategory.Vertex ) ? Constants.VertexShaderOutputStr : Constants.InputVarStr ) + "." + Constants.VFaceVariable; + } + + string value = string.Format( SwitchOp, variable, front, back ); + RegisterLocalVariable( 0, value, ref dataCollector, "switchResult" + OutputId ); + return m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory ); + } + } +} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/SwitchByFaceNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/SwitchByFaceNode.cs.meta new file mode 100644 index 00000000..b12692c4 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/SwitchByFaceNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b0464d8b27caa7d4d8fa5d1828934da8 +timeCreated: 1492515561 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/VertexIdVariableNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/VertexIdVariableNode.cs new file mode 100644 index 00000000..d2b75192 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/VertexIdVariableNode.cs @@ -0,0 +1,54 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda <info@amplify.pt> + +using System; + +namespace AmplifyShaderEditor +{ + [Serializable] + [NodeAttributes( "Vertex ID", "Vertex Data", "Indicates current vertex number" )] + public class VertexIdVariableNode : ParentNode + { + private const string VertexIdVarName = "ase_vertexId"; + private const string VertexIdRegistry = "uint "+ VertexIdVarName + " : SV_VertexID;"; + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + AddOutputPort( WirePortDataType.INT, "Out" ); + m_previewShaderGUID = "5934bf2c10b127a459177a3b622cea65"; + } + + public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) + { + if ( dataCollector.PortCategory == MasterNodePortCategory.Tessellation ) + { + UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " does not work on Tessellation port" ); + return m_outputPorts[0].ErrorValue; + } + + if ( dataCollector.IsTemplate ) + { + return dataCollector.TemplateDataCollectorInstance.GetVertexId(); + } + else + { + if( dataCollector.IsFragmentCategory ) + { + GenerateValueInVertex( ref dataCollector, WirePortDataType.UINT, Constants.VertexShaderInputStr + "."+ VertexIdVarName, VertexIdVarName, true ); + return Constants.InputVarStr + "."+ VertexIdVarName; + } + else + { + return Constants.VertexShaderInputStr + "."+ VertexIdVarName; + } + } + } + public override void PropagateNodeData( NodeData nodeData, ref MasterNodeDataCollector dataCollector ) + { + if( !dataCollector.IsTemplate ) + dataCollector.AddCustomAppData( VertexIdRegistry ); + + base.PropagateNodeData( nodeData, ref dataCollector ); + } + } +} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/VertexIdVariableNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/VertexIdVariableNode.cs.meta new file mode 100644 index 00000000..cad8fe04 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/VertexIdVariableNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ce37a30cae7677942ad44f0945ab7b77 +timeCreated: 1492513159 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/WorldTransformParams.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/WorldTransformParams.cs new file mode 100644 index 00000000..49966a09 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/WorldTransformParams.cs @@ -0,0 +1,32 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda <info@amplify.pt> + +using System; +namespace AmplifyShaderEditor +{ + [Serializable] + [NodeAttributes( "World Transform Params", "Object Transform", "World Transform Params contains information about the transform, W is usually 1.0, or -1.0 for odd-negative scale transforms" )] + public sealed class WorldTransformParams : ConstVecShaderVariable + { + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + ChangeOutputName( 1, "X" ); + ChangeOutputName( 2, "Y" ); + ChangeOutputName( 3, "Z" ); + ChangeOutputName( 4, "W" ); + m_value = "unity_WorldTransformParams"; + m_previewShaderGUID = "5a2642605f085da458d6e03ade47b87a"; + } + + public override void RefreshExternalReferences() + { + base.RefreshExternalReferences(); + if( !m_outputPorts[ 0 ].IsConnected ) + { + m_outputPorts[ 0 ].Visible = false; + m_sizeIsDirty = true; + } + } + } +} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/WorldTransformParams.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/WorldTransformParams.cs.meta new file mode 100644 index 00000000..b28aa84a --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/Various/WorldTransformParams.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aec376443deca354789bc36ba18af898 +timeCreated: 1481126960 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |