예제 #1
0
 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()})");
 }
예제 #2
0
 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()})");
 }
예제 #3
0
 public string GetHlslExpression()
 {
     return(finalToken.ToHlsl());
 }