Jim has found a C# to HLSL compiler. Do you still think code is not data?
ThumbBl thumbB = new ThumbBl(canvas) { Background = Brushes.Blue, LeftTop = new PointBl(0,0), CanDrag = true }; label.Effect.Custom = (input, uv) => { /*L1*/ PointBl p = label.RenderTransform.Inverse. Transform(thumbB.CenterPosition - label.LeftTop); /*L2*/ PointBl q = uv * label.Size; /*L3*/ DoubleBl d = (p - q).Length; /*L4*/ d = 1 - (d / 500).Min(1); /*L5*/ ColorBl clr = (d).Lerp(Colors.Black, Colors.Blue); /*L6*/ return ColorBl.FromScRgb ((input[uv].ScA).Min((1 - (d * d)).Max(.4)), clr.ScRGB); };











[...] jsc also support converting (C#, F#) IL to HLSL [...]
Pingback by WebGL on Old Hardware with MESA « c# to javascript, actionscript — March 9, 2010 @ 8:04 am
[...] you want to program your shaders in C# instead? It would look something like this once [...]
Pingback by Write WebGL in C# with JSC « c# to javascript, actionscript — July 12, 2010 @ 7:09 am