From b82da95b5181ac8bbae38efb13e950d5e88a4caa Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 23 Oct 2020 13:08:43 +0800 Subject: =?UTF-8?q?*=E7=A7=BB=E5=8A=A8amplify=20shader=20editor=E5=88=B0th?= =?UTF-8?q?ird=20party=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FogAndAmbient/FogAndAmbientColorsNode.cs | 126 --------------------- .../FogAndAmbient/FogAndAmbientColorsNode.cs.meta | 12 -- .../ShaderVariables/FogAndAmbient/FogParamsNode.cs | 32 ------ .../FogAndAmbient/FogParamsNode.cs.meta | 12 -- 4 files changed, 182 deletions(-) delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogAndAmbientColorsNode.cs delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogAndAmbientColorsNode.cs.meta delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogParamsNode.cs delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogParamsNode.cs.meta (limited to 'Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient') diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogAndAmbientColorsNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogAndAmbientColorsNode.cs deleted file mode 100644 index 2af78f78..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogAndAmbientColorsNode.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Amplify Shader Editor - Visual Shader Editing Tool -// Copyright (c) Amplify Creations, Lda - -using UnityEngine; -using UnityEditor; -using System; - -namespace AmplifyShaderEditor -{ - public enum BuiltInFogAndAmbientColors - { - UNITY_LIGHTMODEL_AMBIENT = 0, - unity_AmbientSky, - unity_AmbientEquator, - unity_AmbientGround, - unity_FogColor - } - - [Serializable] - [NodeAttributes( "Fog And Ambient Colors", "Light", "Fog and Ambient colors" )] - public sealed class FogAndAmbientColorsNode : ShaderVariablesNode - { - private const string ColorLabelStr = "Color"; - private readonly string[] ColorValuesStr = { - "Ambient light ( Legacy )", - "Sky ambient light", - "Equator ambient light", - "Ground ambient light", - "Fog" - }; - - [SerializeField] - private BuiltInFogAndAmbientColors m_selectedType = BuiltInFogAndAmbientColors.UNITY_LIGHTMODEL_AMBIENT; - - private UpperLeftWidgetHelper m_upperLeftWidget = new UpperLeftWidgetHelper(); - - protected override void CommonInit( int uniqueId ) - { - base.CommonInit( uniqueId ); - ChangeOutputProperties( 0, ColorValuesStr[ ( int ) m_selectedType ], WirePortDataType.COLOR ); - m_textLabelWidth = 50; - m_autoWrapProperties = true; - m_hasLeftDropdown = true; - m_previewShaderGUID = "937c7bde062f0f942b600d9950d2ebb2"; - } - - public override void AfterCommonInit() - { - base.AfterCommonInit(); - if( PaddingTitleLeft == 0 ) - { - PaddingTitleLeft = Constants.PropertyPickerWidth + Constants.IconsLeftRightMargin; - if( PaddingTitleRight == 0 ) - PaddingTitleRight = Constants.PropertyPickerWidth + Constants.IconsLeftRightMargin; - } - } - - public override void SetPreviewInputs() - { - base.SetPreviewInputs(); - m_previewMaterialPassId = (int)m_selectedType; - } - - public override void Destroy() - { - base.Destroy(); - m_upperLeftWidget = null; - } - - public override void Draw( DrawInfo drawInfo ) - { - base.Draw( drawInfo ); - EditorGUI.BeginChangeCheck(); - m_selectedType = (BuiltInFogAndAmbientColors)m_upperLeftWidget.DrawWidget( this, (int)m_selectedType, ColorValuesStr ); - if( EditorGUI.EndChangeCheck() ) - { - ChangeOutputName( 0, ColorValuesStr[ (int)m_selectedType ] ); - } - } - - public override void DrawProperties() - { - base.DrawProperties(); - EditorGUI.BeginChangeCheck(); - m_selectedType = ( BuiltInFogAndAmbientColors ) EditorGUILayoutPopup( ColorLabelStr, ( int ) m_selectedType, ColorValuesStr ); - - if ( EditorGUI.EndChangeCheck() ) - { - ChangeOutputName( 0, ColorValuesStr[ ( int ) m_selectedType ] ); - } - } - - public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) - { - base.GenerateShaderForOutput( outputId, ref dataCollector, ignoreLocalvar ); - if( dataCollector.IsTemplate && dataCollector.CurrentSRPType == TemplateSRPType.HD ) - { - switch( m_selectedType ) - { - case BuiltInFogAndAmbientColors.unity_AmbientSky: - return "_Ambient_ColorSky"; - case BuiltInFogAndAmbientColors.unity_AmbientEquator: - return "_Ambient_Equator"; - case BuiltInFogAndAmbientColors.unity_AmbientGround: - return "_Ambient_Ground"; - case BuiltInFogAndAmbientColors.unity_FogColor: - return "_FogColor"; - } - } - return m_selectedType.ToString(); - } - - public override void ReadFromString( ref string[] nodeParams ) - { - base.ReadFromString( ref nodeParams ); - m_selectedType = ( BuiltInFogAndAmbientColors ) Enum.Parse( typeof( BuiltInFogAndAmbientColors ), GetCurrentParam( ref nodeParams ) ); - ChangeOutputName( 0, ColorValuesStr[ ( int ) m_selectedType ] ); - } - - public override void WriteToString( ref string nodeInfo, ref string connectionsInfo ) - { - base.WriteToString( ref nodeInfo, ref connectionsInfo ); - IOUtils.AddFieldValueToString( ref nodeInfo, m_selectedType ); - } - } -} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogAndAmbientColorsNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogAndAmbientColorsNode.cs.meta deleted file mode 100644 index f2ab7d02..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogAndAmbientColorsNode.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e2bdfc2fa6fcd0640b01a8b7448a1a11 -timeCreated: 1481126959 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogParamsNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogParamsNode.cs deleted file mode 100644 index 63a635d1..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogParamsNode.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Amplify Shader Editor - Visual Shader Editing Tool -// Copyright (c) Amplify Creations, Lda - -using System; -namespace AmplifyShaderEditor -{ - [Serializable] - [NodeAttributes( "Fog Params", "Light", "Parameters for fog calculation" )] - public sealed class FogParamsNode : ConstVecShaderVariable - { - protected override void CommonInit( int uniqueId ) - { - base.CommonInit( uniqueId ); - ChangeOutputName( 1, "Density/Sqrt(Ln(2))" ); - ChangeOutputName( 2, "Density/Ln(2)" ); - ChangeOutputName( 3, "-1/(End-Start)" ); - ChangeOutputName( 4, "End/(End-Start))" ); - m_value = "unity_FogParams"; - m_previewShaderGUID = "42abde3281b1848438c3b53443c91a1e"; - } - - 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/FogAndAmbient/FogParamsNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogParamsNode.cs.meta deleted file mode 100644 index ccc0df5e..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/ShaderVariables/FogAndAmbient/FogParamsNode.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a3d8c31159e07bc419a7484ab5e894ed -timeCreated: 1481126958 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: -- cgit v1.1-26-g67d0