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 --- .../Nodes/ImageEffects/SimpleContrastOpNode.cs | 55 ---------------------- 1 file changed, 55 deletions(-) delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/ImageEffects/SimpleContrastOpNode.cs (limited to 'Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/ImageEffects/SimpleContrastOpNode.cs') diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/ImageEffects/SimpleContrastOpNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/ImageEffects/SimpleContrastOpNode.cs deleted file mode 100644 index 01310922..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/ImageEffects/SimpleContrastOpNode.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Amplify Shader Editor - Visual Shader Editing Tool -// Copyright (c) Amplify Creations, Lda -using System; - -namespace AmplifyShaderEditor -{ - [Serializable] - [NodeAttributes( "Simple Contrast", "Image Effects", "Simple contrast matrix multiplication" )] - public sealed class SimpleContrastOpNode : ParentNode - { - private const string InputTypeStr = "Contrast"; - private const string FunctionHeader = "CalculateContrast({0},{1})"; - private readonly string[] m_functionBody = { "float4 CalculateContrast( float contrastValue, float4 colorTarget )\n", - "{\n", - "\tfloat t = 0.5 * ( 1.0 - contrastValue );\n", - "\treturn mul( float4x4( contrastValue,0,0,t, 0,contrastValue,0,t, 0,0,contrastValue,t, 0,0,0,1 ), colorTarget );\n", - "}"}; - protected override void CommonInit( int uniqueId ) - { - base.CommonInit( uniqueId ); - AddPorts(); - m_textLabelWidth = 70; - m_useInternalPortData = true; - m_previewShaderGUID = "8d76799413f9f0547ac9b1de7ba798f1"; - } - - void AddPorts() - { - AddInputPort( WirePortDataType.COLOR, false, "RGBA", -1, MasterNodePortCategory.Fragment, 1 ); - AddInputPort( WirePortDataType.FLOAT, false, "Value", -1, MasterNodePortCategory.Fragment, 0 ); - AddOutputPort( WirePortDataType.COLOR, Constants.EmptyPortValue ); - } - - public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar ) - { - if( m_outputPorts[ 0 ].IsLocalValue( dataCollector.PortCategory ) ) - return m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory ); - - string contrastValue = m_inputPorts[ 1 ].GeneratePortInstructions( ref dataCollector ); - string colorTarget = m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector ); - string result = dataCollector.AddFunctions( FunctionHeader, m_functionBody, false, contrastValue, colorTarget ); - - return CreateOutputLocalVariable( 0, result, ref dataCollector ); - } - - public override void ReadFromString( ref string[] nodeParams ) - { - base.ReadFromString( ref nodeParams ); - if( UIUtils.CurrentShaderVersion() < 5004 ) - { - m_inputPorts[ 1 ].FloatInternalData = Convert.ToSingle( GetCurrentParam( ref nodeParams ) ); - } - } - } -} -- cgit v1.1-26-g67d0