This is the first formal product release from Ignite Interactive Studio: SL# (or SLSharp).
SL# is a runtime translation engine that translates C# (IL) code to GLSL (OpenGL shader language) code. What it does is relatively simple: It takes a stream of compiled IL code and translates it to a valid GLSL code string. This is achieved through reconstructing an AST (abstract syntax tree) from the IL (effectively decompiling it at runtime).
The engine is freeware. That is, it is not open source, but you are free to use it for whatever project you want. Be it commercial or non-commercial. See the license here.
There is a bunch of benefits in doing this:
- IntelliSense and refactoring support for free
- Compile-time type safety
- No need to learn GLSL; just code in the language you know
- Obfuscation of the generated GLSL string
Currently, we’re primarily targeting C#. However, theoretically, SL# will translate any IL to valid GLSL. We have not tested VB.NET and F# yet, but intend to do so in the near future, as well as add any necessary support for these languages.
It should be noted that there are still some unsupported IL patterns and GLSL constructs. Namely, the :? operator and if-then-else statements don’t quite work yet (although if-then works fine). We do, of course, plan to support these in the future, as well as many other constructs.
So with that said, this is in all practicality an experimental release. Any feedback is greatly appreciated (especially tests on ATI cards). You can post feature requests and bug reports here.
The website for the project can be found here. It has some information regarding the library’s internals, a couple of samples, and a download link.
Enjoy! And remember to give feedback!