2
0

Abs.hx 389 B

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