Announcing SL#: C#-to-GLSL Translator

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!

2 thoughts on “Announcing SL#: C#-to-GLSL Translator

  1. Pingback: Bytecode is Evil « Zor's Blog

  2. Pingback: SL# 1.3 Released as Open Source « Zor's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s