Log.hx 444 B

123456789101112131415161718192021222324
  1. package hrt.shgraph.nodes;
  2. using hxsl.Ast;
  3. @name("Log")
  4. @description("The output is the result of log(x)")
  5. @width(80)
  6. @group("Math")
  7. class Log extends ShaderFunction {
  8. @input("X") var x = SType.Number;
  9. @input("P", true) var p = SType.Number;
  10. public function new() {
  11. super(Log);
  12. }
  13. override public function computeOutputs() {
  14. if (x != null && !x.isEmpty())
  15. addOutput("output", x.getType());
  16. else
  17. removeOutput("output");
  18. }
  19. }