You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  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( "DDY", "Math Operators", "Approximate partial derivative with respect to window-space Y" )]
  7. public sealed class DdyOpNode : SingleInputOp
  8. {
  9. protected override void CommonInit( int uniqueId )
  10. {
  11. base.CommonInit( uniqueId );
  12. m_opName = "ddy";
  13. m_previewShaderGUID = "197dcc7f05339da47b6b0e681c475c5e";
  14. m_inputPorts[ 0 ].CreatePortRestrictions( WirePortDataType.OBJECT,
  15. WirePortDataType.FLOAT,
  16. WirePortDataType.FLOAT2,
  17. WirePortDataType.FLOAT3,
  18. WirePortDataType.FLOAT4,
  19. WirePortDataType.COLOR,
  20. WirePortDataType.INT );
  21. }
  22. public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
  23. {
  24. if( dataCollector.IsFragmentCategory )
  25. return base.GenerateShaderForOutput( outputId, ref dataCollector, ignoreLocalvar );
  26. else
  27. return m_inputPorts[ 0 ].GeneratePortInstructions( ref dataCollector );
  28. }
  29. }
  30. }