TangentSignVertexDataNode.cs 905 B

1234567891011121314151617181920212223
  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. namespace AmplifyShaderEditor
  4. {
  5. [System.Serializable]
  6. [NodeAttributes( "Vertex Tangent Sign", "Vertex Data", "Vertex tangent sign in object space, return the W value of tangent vector that contains only the sign of the tangent" )]
  7. public sealed class TangentSignVertexDataNode : ParentNode
  8. {
  9. protected override void CommonInit( int uniqueId )
  10. {
  11. base.CommonInit( uniqueId );
  12. AddOutputVectorPorts( WirePortDataType.FLOAT, "Sign" );
  13. m_drawPreviewAsSphere = true;
  14. m_previewShaderGUID = "f5466d126f4bb1f49917eac88b1cb6af";
  15. }
  16. public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalVar )
  17. {
  18. return GeneratorUtils.GenerateVertexTangentSign( ref dataCollector, UniqueId, CurrentPrecisionType ); ;
  19. }
  20. }
  21. }