LuminanceHlpNode.cs 863 B

1234567891011121314151617181920212223242526
  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. using System;
  4. namespace AmplifyShaderEditor
  5. {
  6. [Serializable]
  7. [NodeAttributes( "Luminance", "Image Effects", "Converts color to luminance (grayscale)", Deprecated = true, DeprecatedAlternativeType = typeof( TFHCGrayscale ), DeprecatedAlternative = "Grayscale" )]
  8. public sealed class LuminanceHlpNode : HelperParentNode
  9. {
  10. protected override void CommonInit( int uniqueId )
  11. {
  12. base.CommonInit( uniqueId );
  13. m_funcType = "Luminance";
  14. m_inputPorts[ 0 ].ChangeType( WirePortDataType.FLOAT3, false );
  15. m_inputPorts[ 0 ].Name = "RGB";
  16. m_outputPorts[ 0 ].ChangeType( WirePortDataType.FLOAT, false );
  17. }
  18. protected override void OnUniqueIDAssigned()
  19. {
  20. base.OnUniqueIDAssigned();
  21. m_localVarName = "luminance" + OutputId;
  22. }
  23. }
  24. }