pontifikas's picture

c# glsl wrapper

Is there such a thing as a C# glsl wrapper for .net out there (or in here)?
I'm talking about being able to write glsl code within Visual Studio and having highlighting, intellisence, auto-completion, class member listing e.t.c
I did some digging but I couldn't find sth relevant.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

As far as I know, no such thing exists.

The best I've been able to find is a way to add syntax highlighting to keywords. According to this post on opengl.org:

Quote:

For syntax highlighting, just create a usertype.dat file with all the keywords and put in \Common7\IDE. The go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\File Extensions and add the extensions you need highlighted and copy the value from .cpp.

I haven't tried this. Personally, I use Ati's Rendermonkey for developing / testing shaders, which works pretty well. The only annoying limitation is that you cannot use GLSL structures as uniforms (or if you can, I've never been able to find a way to specify their values).

Of course, the best approach would be to create a GLSL language add-on for visual studio. The relevant VS2008 API is pretty painful but Visual Studio 2010 is said to simplify language add-ons, so this might be worth looking into.

pontifikas's picture

Thank you for the reply Fiddler. The truth is, I'm making my first step with glsl and advanced opengl in general, so I don't understand what you mean by using structures as uniforms (I will soon though :) ) and the importance of it. I too saw some posts like the one you provide(e.g. this) but that is a painful approach especially for a novice.
Another question, concerning Rendermonkey is, does it integrate with VS or is it used as an external tool that formats the shader files to be loaded by the code?

I thank you again.

the Fiddler's picture

Rendermonkey is an external tool, but it's very useful for designing and testing shaders. The idea is simple: you write your shader and provide the necessary uniform and texture parameters. Rendermonkey then applies the shader to a model and allows you to tweak the result in real time.

It does force you to leave the IDE but at least the process is straightforward.

zahirtezcan's picture

There is NShader for highlighting but does not support intellisense. You can investigate the code and add new keywords or remove deprecated ones .

the Fiddler's picture

Nice, haven't seen that before.

pontifikas's picture

I know about NShader but it isn't so helpful.
The way I see it neither Rendermonkey is very helpful (though very interesting in general) as far as editing is concerned. Structure fields are not listed (is that what you meant Fiddler about using them as uniforms?).
Anyway thank you for the feedback.There are still lot of things to be done for shaders.

XtremeLeo's picture
the Fiddler wrote:

As far as I know, no such thing exists.

The best I've been able to find is a way to add syntax highlighting to keywords. According to this post on opengl.org:

Quote:

For syntax highlighting, just create a usertype.dat file with all the keywords and put in \Common7\IDE. The go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\File Extensions and add the extensions you need highlighted and copy the value from .cpp.

I haven't tried this. Personally, I use Ati's Rendermonkey for developing / testing shaders, which works pretty well. The only annoying limitation is that you cannot use GLSL structures as uniforms (or if you can, I've never been able to find a way to specify their values).

Of course, the best approach would be to create a GLSL language add-on for visual studio. The relevant VS2008 API is pretty painful but Visual Studio 2010 is said to simplify language add-ons, so this might be worth looking into.

Also besides using RenderMonkey, you may try nVidia's software, named FXComposer, which I think is easier and more powerful to use.

the Fiddler's picture

FXComposer is a great tool but it doesn't support GLSL. It's DirectX/HLSL-only.

XtremeLeo's picture
the Fiddler wrote:

FXComposer is a great tool but it doesn't support GLSL. It's DirectX/HLSL-only.

Well, the official webpage says it features OpenGL. You are right, it doesn't support GLSL but I think the support is given via CG.

the Fiddler's picture

I was mainly going by this blob in their faq:

Quote:

Does FX Composer work with Cg or GLSL?

We are always evaluating opportunites to provide powerful tools for developers, but have no plans to add support for other languages to FX Composer. FX Composer was built to support the large number of developers using HLSL in their applications.

Which means either the frontpage or the faq is out of date. :)

Never used it myself, but my curiosity is now piqued.