GLSL Shader Tester
Shader testing program

TranslationAuthorCourtesy of
Romanian EWS Translate
Bahasa Indonesia Jordan Silaen Chameleon John
Spanish Speedyessay

What is it?

This is a small program I wrote to help me design some of the lighting effects for my physxDraw program. It is slowly evolving into a GLSL shader test bed for Linux. I had tried Shader Designer in Linux but I had some trouble with the way it sets up the camera. Also, I use a dark desktop theme (similar to the style of these pages) and I couldn't see the code. Plus I'm a big fan of Gvim for editing text or code anyway, so I was avoiding the editor and using it as a test bed. But I couldn't get around the camera issues, so I ended up writing my own system.

I admit this is a very primitive app, and I've never used any of the pro tools like NVIDIA's FX Composer or AMD/ATI's RenderMonkey since they don't run on Linux. So I wasn't really trying to emulate them, I was just writing something that worked for me.

The teaser image above shows the basic GUI for shaderDev. The "Shaders" panel allows you to load in any number of vertex and fragment shaders and compile them into a single program. It will also load any non-reserved uniform values and set their values. The value setting interface is fairly clunky--I'll probably revisit it in the future. But it was a quick and dirty job. The image shows my per pixel phong lighting shader with a texture for the diffuse color.

Shader testing program

This image shows the same setup as before, but using the fixed OpenGL pipeline. Notice how different the shading is! The wood texture masks some of the discretization effects, and my shader has more of the reflective properties of polished wood. I did originally design this shader for use in physxDraw, but it turns out that at full screen performance drops by a factor of 10!

This image also shows the lighting panel, which lets you set up all the properties of the lights. The remaining panels are shown below and allow you to specify materials, textures, and shapes.

Remaining panels

What needs to be done

ShaderDev is far from finished. There is plenty of work to do. Here are some of the things that need improvement and some unimplemented features.

Known bugs:

Try it out!

The code for shaderDev is available here. You will also need the following multi-platform libraries:

I've only tested this on Ubuntu Linux Gutsy, but I think it should work fine on any other Linux platform.