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 --- .../Misc/Transformation/ObjectToWorldTransfNode.cs | 30 ------------ .../Transformation/ObjectToWorldTransfNode.cs.meta | 12 ----- .../Nodes/Misc/Transformation/ParentTransfNode.cs | 53 --------------------- .../Misc/Transformation/ParentTransfNode.cs.meta | 12 ----- .../Misc/Transformation/WorldToObjectTransfNode.cs | 54 ---------------------- .../Transformation/WorldToObjectTransfNode.cs.meta | 12 ----- 6 files changed, 173 deletions(-) delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs.meta delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ParentTransfNode.cs delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ParentTransfNode.cs.meta delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/WorldToObjectTransfNode.cs delete mode 100644 Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/WorldToObjectTransfNode.cs.meta (limited to 'Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation') diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs deleted file mode 100644 index 48de5fbe..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Amplify Shader Editor - Visual Shader Editing Tool -// Copyright (c) Amplify Creations, Lda - -namespace AmplifyShaderEditor -{ - [System.Serializable] - [NodeAttributes( "Object To World", "Object Transform", "Transforms input to World Space" )] - public sealed class ObjectToWorldTransfNode : ParentTransfNode - { - protected override void CommonInit( int uniqueId ) - { - base.CommonInit( uniqueId ); - m_matrixName = "unity_ObjectToWorld"; - m_matrixHDName = "GetObjectToWorldMatrix()"; - m_matrixLWName = "GetObjectToWorldMatrix()"; - m_previewShaderGUID = "a4044ee165813654486d0cecd0de478c"; - } - - public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) - { - string result = base.GenerateShaderForOutput( 0, ref dataCollector, ignoreLocalvar ); - if( dataCollector.IsTemplate && dataCollector.TemplateDataCollectorInstance.CurrentSRPType == TemplateSRPType.HD && !string.IsNullOrEmpty( m_matrixHDName ) ) - { - dataCollector.AddLocalVariable( UniqueId, string.Format( "{0}.xyz", result ), string.Format( "GetAbsolutePositionWS(({0}).xyz);", result ) ); - } - - return GetOutputVectorItem( 0, outputId, result ); - } - } -} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs.meta deleted file mode 100644 index 40b45c87..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ObjectToWorldTransfNode.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 545417ad304cea84b9f625a3b6ad4e56 -timeCreated: 1488205951 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ParentTransfNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ParentTransfNode.cs deleted file mode 100644 index 5781e115..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ParentTransfNode.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Amplify Shader Editor - Visual Shader Editing Tool -// Copyright (c) Amplify Creations, Lda - -namespace AmplifyShaderEditor -{ - [System.Serializable] - public class ParentTransfNode : ParentNode - { - protected string m_matrixName; - protected string m_matrixHDName; - protected string m_matrixLWName; - - protected override void CommonInit( int uniqueId ) - { - base.CommonInit( uniqueId ); - AddInputPort( WirePortDataType.FLOAT4, false, string.Empty ); - AddOutputVectorPorts( WirePortDataType.FLOAT4, "XYZW" ); - m_useInternalPortData = true; - m_inputPorts[ 0 ].Vector4InternalData = new UnityEngine.Vector4( 0, 0, 0, 1 ); - } - - public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) - { - if ( m_outputPorts[ 0 ].IsLocalValue( dataCollector.PortCategory ) ) - return GetOutputVectorItem( 0, outputId, m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory ) ); - - string value = m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector ); - string matrixName = string.Empty; - if( dataCollector.IsTemplate ) - { - if( dataCollector.TemplateDataCollectorInstance.CurrentSRPType == TemplateSRPType.HD && !string.IsNullOrEmpty( m_matrixHDName ) ) - { - matrixName = m_matrixHDName; - } - else if( dataCollector.TemplateDataCollectorInstance.CurrentSRPType == TemplateSRPType.Lightweight && !string.IsNullOrEmpty( m_matrixLWName ) ) - { - matrixName = m_matrixLWName; - } - else - { - matrixName = m_matrixName; - } - } - else - { - matrixName = m_matrixName; - } - - RegisterLocalVariable( 0, string.Format( "mul({0},{1})", matrixName, value ),ref dataCollector,"transform"+ OutputId ); - return GetOutputVectorItem( 0, outputId, m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory ) ); - } - } -} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ParentTransfNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ParentTransfNode.cs.meta deleted file mode 100644 index 5a714ba2..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/ParentTransfNode.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 11f04432b7f1ffb43b584adb226614c6 -timeCreated: 1488206086 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/WorldToObjectTransfNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/WorldToObjectTransfNode.cs deleted file mode 100644 index ccc57813..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/WorldToObjectTransfNode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Amplify Shader Editor - Visual Shader Editing Tool -// Copyright (c) Amplify Creations, Lda - -namespace AmplifyShaderEditor -{ - [System.Serializable] - [NodeAttributes( "World To Object", "Object Transform", "Transforms input to Object Space" )] - public sealed class WorldToObjectTransfNode : ParentTransfNode - { - protected override void CommonInit( int uniqueId ) - { - base.CommonInit( uniqueId ); - m_matrixName = "unity_WorldToObject"; - m_matrixHDName = "GetWorldToObjectMatrix()"; - m_matrixLWName = "GetWorldToObjectMatrix()"; - m_previewShaderGUID = "79a5efd1e3309f54d8ba3e7fdf5e459b"; - } - - public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) - { - if( m_outputPorts[ 0 ].IsLocalValue( dataCollector.PortCategory ) ) - return GetOutputVectorItem( 0, outputId, m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory ) ); - - string value = m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector ); - string matrixName = string.Empty; - if( dataCollector.IsTemplate ) - { - if( dataCollector.TemplateDataCollectorInstance.CurrentSRPType == TemplateSRPType.HD && !string.IsNullOrEmpty( m_matrixHDName ) ) - { - string varName = "localWorldVar" + OutputId; - dataCollector.AddLocalVariable( UniqueId, PrecisionType.Float, WirePortDataType.FLOAT4, varName, value ); - dataCollector.AddLocalVariable( UniqueId, string.Format( "({0}).xyz", varName ), string.Format( "GetCameraRelativePositionWS(({0}).xyz);", varName ) ); - value = varName; - matrixName = m_matrixHDName; - } - else if( dataCollector.TemplateDataCollectorInstance.CurrentSRPType == TemplateSRPType.Lightweight && !string.IsNullOrEmpty( m_matrixLWName ) ) - { - matrixName = m_matrixLWName; - } - else - { - matrixName = m_matrixName; - } - } - else - { - matrixName = m_matrixName; - } - - RegisterLocalVariable( 0, string.Format( "mul({0},{1})", matrixName, value ), ref dataCollector, "transform" + OutputId ); - return GetOutputVectorItem( 0, outputId, m_outputPorts[ 0 ].LocalValue( dataCollector.PortCategory ) ); - } - } -} diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/WorldToObjectTransfNode.cs.meta b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/WorldToObjectTransfNode.cs.meta deleted file mode 100644 index 8ad85ca4..00000000 --- a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Misc/Transformation/WorldToObjectTransfNode.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8a25ccf8973bfae46ae3df2823f58229 -timeCreated: 1488205986 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: -- cgit v1.1-26-g67d0