summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Nodes/Vertex/VertexDataNode.cs
blob: 9fa8cffdb8e16305a694bd200b62c62b1f3f8eff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Amplify Shader Editor - Visual Shader Editing Tool
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>

using UnityEngine;
using System;

namespace AmplifyShaderEditor
{
	//public enum VertexData
	//{
	//	vertex = 0,
	//	tangent,
	//	normal,
	//	texcoord,
	//	texcoord1,
	//	color
	//}

	[Serializable]
	public class VertexDataNode : ParentNode
	{
		[SerializeField]
		protected string m_currentVertexData;

		protected override void CommonInit( int uniqueId )
		{
			base.CommonInit( uniqueId );
			m_currentVertexData = "vertex";

//			Type type = typeof( StandardSurfaceOutputNode );
			//m_restictions.AddPortRestriction( type, 0 );
			//m_restictions.AddPortRestriction( type, 2 );
			//m_restictions.AddPortRestriction( type, 3 );
			//m_restictions.AddPortRestriction( type, 4 );
			//m_restictions.AddPortRestriction( type, 5 );
			//m_restictions.AddPortRestriction( type, 6 );
			//m_restictions.AddPortRestriction( type, 7 );
			//m_restictions.AddPortRestriction( type, 8 );
			//m_restictions.AddPortRestriction( type, 9 );
			//m_restictions.AddPortRestriction( type, 10 );
			AddOutputVectorPorts( WirePortDataType.FLOAT4, "Out" );
		}

		public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar )
		{
			base.GenerateShaderForOutput( outputId, ref dataCollector, ignoreLocalVar );
			return GetOutputVectorItem( 0, outputId, Constants.VertexShaderInputStr + "." + m_currentVertexData );
		}
	}
}