You've already forked FateViewer
							
							Add project files.
This commit is contained in:
		| @@ -0,0 +1,30 @@ | ||||
|  | ||||
| // Amplify Shader Editor - Visual Shader Editing Tool | ||||
| // Copyright (c) Amplify Creations, Lda <info@amplify.pt> | ||||
|  | ||||
|  | ||||
| namespace AmplifyShaderEditor | ||||
| { | ||||
| 	[System.Serializable] | ||||
| 	[NodeAttributes( "Distance-based Tessellation", "Miscellaneous", "Calculates tessellation based on distance from camera" )] | ||||
| 	public sealed class DistanceBasedTessNode : TessellationParentNode | ||||
| 	{ | ||||
| 		private const string FunctionBody = "UnityDistanceBasedTess( v0.vertex, v1.vertex, v2.vertex, {0},{1},{2})"; | ||||
| 		protected override void CommonInit( int uniqueId ) | ||||
| 		{ | ||||
| 			base.CommonInit( uniqueId ); | ||||
| 			AddInputPort( WirePortDataType.FLOAT, false,"Factor"); | ||||
| 			AddInputPort( WirePortDataType.FLOAT, false, "Min Dist" ); | ||||
| 			AddInputPort( WirePortDataType.FLOAT, false, "Max Dist" ); | ||||
| 			AddOutputPort( WirePortDataType.FLOAT4, Constants.EmptyPortValue ); | ||||
| 		} | ||||
|  | ||||
| 		protected override string BuildTessellationFunction( ref MasterNodeDataCollector dataCollector ) | ||||
| 		{ | ||||
| 			return string.Format(	FunctionBody, | ||||
| 									m_inputPorts[ 1 ].GeneratePortInstructions( ref dataCollector ), | ||||
| 									m_inputPorts[ 2 ].GeneratePortInstructions( ref dataCollector ), | ||||
| 									m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector ) ); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,12 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 5a83fb450d164d34bb756f46b3f4290e | ||||
| timeCreated: 1482150091 | ||||
| licenseType: Store | ||||
| MonoImporter: | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
| @@ -0,0 +1,27 @@ | ||||
| // Amplify Shader Editor - Visual Shader Editing Tool | ||||
| // Copyright (c) Amplify Creations, Lda <info@amplify.pt> | ||||
|  | ||||
|  | ||||
| namespace AmplifyShaderEditor | ||||
| { | ||||
| 	[System.Serializable] | ||||
| 	[NodeAttributes( "Edge Length Tessellation With Cull", "Miscellaneous", "Tessellation level computed based on triangle edge length on the screen with patch frustum culling" )] | ||||
| 	public sealed class EdgeLengthCullTessNode : TessellationParentNode | ||||
| 	{ | ||||
| 		private const string FunctionBody = "UnityEdgeLengthBasedTessCull( v0.vertex, v1.vertex, v2.vertex, {0},{1})"; | ||||
| 		protected override void CommonInit( int uniqueId ) | ||||
| 		{ | ||||
| 			base.CommonInit( uniqueId ); | ||||
| 			AddInputPort( WirePortDataType.FLOAT, false, "Edge Length" ); | ||||
| 			AddInputPort( WirePortDataType.FLOAT, false, "Max Disp." ); | ||||
| 			AddOutputPort( WirePortDataType.FLOAT4, Constants.EmptyPortValue ); | ||||
| 		} | ||||
| 		 | ||||
| 		protected override string BuildTessellationFunction( ref MasterNodeDataCollector dataCollector ) | ||||
| 		{ | ||||
| 			return string.Format(	FunctionBody, | ||||
| 									m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector ), | ||||
| 									m_inputPorts[ 1 ].GeneratePortInstructions( ref dataCollector ) ); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,12 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 4b09c64ce2fd06a4cb4036d8cc0f8b2a | ||||
| timeCreated: 1482150962 | ||||
| licenseType: Store | ||||
| MonoImporter: | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
| @@ -0,0 +1,23 @@ | ||||
| // Amplify Shader Editor - Visual Shader Editing Tool | ||||
| // Copyright (c) Amplify Creations, Lda <info@amplify.pt> | ||||
|  | ||||
| namespace AmplifyShaderEditor | ||||
| { | ||||
| 	[System.Serializable] | ||||
| 	[NodeAttributes( "Edge Length Tessellation", "Miscellaneous", "Tessellation level computed based on triangle edge length on the screen" )] | ||||
| 	public sealed class EdgeLengthTessNode : TessellationParentNode | ||||
| 	{ | ||||
| 		private const string FunctionBody = "UnityEdgeLengthBasedTess (v0.vertex, v1.vertex, v2.vertex, {0})"; | ||||
| 		protected override void CommonInit( int uniqueId ) | ||||
| 		{ | ||||
| 			base.CommonInit( uniqueId ); | ||||
| 			AddInputPort( WirePortDataType.FLOAT, false, "Edge Length" ); | ||||
| 			AddOutputPort( WirePortDataType.FLOAT4, Constants.EmptyPortValue ); | ||||
| 		} | ||||
|  | ||||
| 		protected override string BuildTessellationFunction( ref MasterNodeDataCollector dataCollector ) | ||||
| 		{ | ||||
| 			return string.Format( FunctionBody, m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector ) ); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,12 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: abe3e8fa4d49c9742a95ac801fd14d7d | ||||
| timeCreated: 1482150962 | ||||
| licenseType: Store | ||||
| MonoImporter: | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
| @@ -0,0 +1,29 @@ | ||||
| namespace AmplifyShaderEditor | ||||
| { | ||||
| 	public class TessellationParentNode : ParentNode | ||||
| 	{ | ||||
|  | ||||
| 		protected override void CommonInit( int uniqueId ) | ||||
| 		{ | ||||
| 			base.CommonInit( uniqueId ); | ||||
| 			m_useInternalPortData = true; | ||||
| 		} | ||||
|  | ||||
|  | ||||
| 		public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) | ||||
| 		{ | ||||
| 			if ( dataCollector.PortCategory != MasterNodePortCategory.Tessellation ) | ||||
| 			{ | ||||
| 				UIUtils.ShowMessage( UniqueId, m_nodeAttribs.Name + " can only be used on Master Node Tessellation port" ); | ||||
| 				return "(-1)"; | ||||
| 			} | ||||
|  | ||||
| 			return BuildTessellationFunction( ref dataCollector ); | ||||
| 		} | ||||
|  | ||||
| 		protected virtual string BuildTessellationFunction( ref MasterNodeDataCollector dataCollector ) | ||||
| 		{ | ||||
| 			return string.Empty; | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,12 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 79c24faef1fec884d937e74bdc9209da | ||||
| timeCreated: 1482162387 | ||||
| licenseType: Store | ||||
| MonoImporter: | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
		Reference in New Issue
	
	Block a user