Maximum.hx 502 B

1234567891011121314151617181920212223242526272829
  1. package hrt.shgraph.nodes;
  2. import hxsl.*;
  3. using hxsl.Ast;
  4. @name("Maximum")
  5. @description("The output is the maximum between A and B")
  6. @group("Math")
  7. class Maximum extends ShaderFunction {
  8. @input("A") var a = SType.Number;
  9. @input("B") var b = SType.Number;
  10. public function new() {
  11. super(Max);
  12. }
  13. override public function createOutputs() {
  14. if (a != null)
  15. addOutput("output", a.getType());
  16. else if (b != null)
  17. addOutput("output", b.getType());
  18. else
  19. removeOutput("output");
  20. }
  21. }