VertexDataNode.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. using UnityEngine;
  4. using System;
  5. namespace AmplifyShaderEditor
  6. {
  7. //public enum VertexData
  8. //{
  9. // vertex = 0,
  10. // tangent,
  11. // normal,
  12. // texcoord,
  13. // texcoord1,
  14. // color
  15. //}
  16. [Serializable]
  17. public class VertexDataNode : ParentNode
  18. {
  19. [SerializeField]
  20. protected string m_currentVertexData;
  21. protected override void CommonInit( int uniqueId )
  22. {
  23. base.CommonInit( uniqueId );
  24. m_currentVertexData = "vertex";
  25. // Type type = typeof( StandardSurfaceOutputNode );
  26. //m_restictions.AddPortRestriction( type, 0 );
  27. //m_restictions.AddPortRestriction( type, 2 );
  28. //m_restictions.AddPortRestriction( type, 3 );
  29. //m_restictions.AddPortRestriction( type, 4 );
  30. //m_restictions.AddPortRestriction( type, 5 );
  31. //m_restictions.AddPortRestriction( type, 6 );
  32. //m_restictions.AddPortRestriction( type, 7 );
  33. //m_restictions.AddPortRestriction( type, 8 );
  34. //m_restictions.AddPortRestriction( type, 9 );
  35. //m_restictions.AddPortRestriction( type, 10 );
  36. AddOutputVectorPorts( WirePortDataType.FLOAT4, "Out" );
  37. }
  38. public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar )
  39. {
  40. base.GenerateShaderForOutput( outputId, ref dataCollector, ignoreLocalVar );
  41. return GetOutputVectorItem( 0, outputId, Constants.VertexShaderInputStr + "." + m_currentVertexData );
  42. }
  43. }
  44. }