public override string ToHlsl() { if (operat.Symbol == '^') { // do max(..) to prevent undefined behaviour + warning return($"pow(max({left.ToHlsl()}, 0.0),{right.ToHlsl()})"); } // + - * / is easy return($"({left.ToHlsl()} {operat.Symbol} {right.ToHlsl()})"); }
public override string ToHlsl() { if (operat.Symbol == '^') { // use extended pow return($"powEx({left.ToHlsl()},{right.ToHlsl()})"); } // + - * / is easy return($"({left.ToHlsl()} {operat.Symbol} {right.ToHlsl()})"); }
public string GetHlslExpression() { return(finalToken.ToHlsl()); }