GLIntercept 0.4 = Shader edit/ free camera + more

EDIT: GLIntercept 0.41 has been released with some tiny bug fixes. Get it (and future versions) from: or

GLIntercept version 0.4 is complete and before I start posting on news sites I though I would let the people have first go (in case of any fatal bugs)

You can get it here: (~900Kb)
(source will be posted when I update the main website)

New features (besides bug fixes and a new plugin interface):

  1. Shader editor:

The shader editor allows the editing of ARB/NV VP/FP/GLSL shaders/programs
at run time by simply pressing a key combination (default ctrl-shift-s). Once edited, the shader can be compiled back into the application. (Very useful if a shader is mis-behaving – you can edit and dump individual textures/uniforms to the output color to see if it is valid)

Note: ATI users may have problems with the GLSL editor until they fix a few bugs.(uniform sampler retrieval is broken) (Nvidia had a few bugs like rect. textures but have already stated they will fix this soon)

  1. Free Camera
    Screen shot:

The “free” camera allows the user to “fly” around the rendered scene to view what actual geometry is sent to the graphics card. This plugin relies on correct usage of the modelview matrix and its usage in all vertex programs.
(Some applications with reverse perspective matrices may need to change the key combinations as the controls will be flipped - Humus demos are the only ones I found that do this)

Default key options of note:
ctrl,shift,c - Enable/Disable the free camera keys
p - Reset camera position
o - Reset camera orientation
ctrl,shift,u - Enable/Disable back face culling
ctrl,shift,w - Enable/Disable wire frame mode
ctrl,shift,v - Enable/Disable rendering of the view frustum

i,k,j,l, - Forward/Back/Left/Right movement when in free cam mode
Num pad keys - Pith/Roll/Yaw movement when in free cam mode
Shift - Movement multiplier (settable value - default = 10x)

There are many other options that can be configured scissoring/ortho views/lighting etc

  1. Extension/Version override
    Screen shot:
    The extension override plugin allows the user to add/remove/replace OpenGL reported extensions. This plugin also allows the overiding of version/vender/renderer etc string. This is probably most useful for high end card users to allow them to test the low end rendering pathways without swapping cards. (or to possibly fix old broken apps that don’t check the version/extension strings properly)

BTW: Here is what the next releases of GLI will contain:

GLI 0.41 - Fix any critical bugs in 0.4
GLI 0.42 - Add OGL 2.0 support (assuming I have a 2.0 driver by then)

I would also like to get your opinions on what I should do next for GLI 0.5.
On my mile long todo list:

  • “Artist” shader tweak. By specifying in comments at the top of the shader files line like:
    //GLIEdit- range:0.0-3.0:slider

Which specify uniform name/valid values/ control type. Then at run time all the shaders that are used have this data gathered so when a “magic key” is pressed a dialog with controls for all the uniform tweakables is presented (only for shaders on that frame). Then you can get “Artists” to adjust the shaders at runtime to get the appropiate effect. (Kinda like FX Composer except at runtime)

  • Image editor - similar to the current shader editor with a “worse than MS Paint” image editor so you can put dot’s or characters in textures at runtime (or load a completly new texture) Probably useful if you are wondering how a texture is tiling or if it is flipped/oriented the wrong way.

  • Newbie warning plugin - Take all the common questions from these forums (GL_CLAMP/ GL_RGB and not GL_RGB8 / Ms software renderer/ VBO usage/ basic GL errors etc) and write a plugin that checks for all these types of things and displays a dialog and explaination when these events happen in code. (Problem is - getting new OpenGL people to use GLIntercept with this plugin)

  • A GUI that generates the GLI config files. May help new OpenGL people with my tool.

  • A Direct3D-PIX like profiling tool or a NVPerfHUD-like plugin - May wait and see what Nvidia cooks up first.

  • A Linux port.

None of the above options I really need at the moment so I thoght if people want to vote (or suggest something) I’ll see what I can do.

Crikey! Thanks! =)

I want to have in GLIntercept some profiling tool.
Like NVPerfHud or something else maybe using NV_fence extension to get some object rendering time.

Wow, very impressive! Of the future features you listed, my vote goes to to change textures. I don’t care about editing, just giving you a list of thumbnails of the textures available and allowing you to choose one and change it to some default one, like maybe just a logo or some text (so you can check mirroring/tiling easily) would be great.

Looking good, but I’m having some trouble.

Is it possible the dll replacement is calling glGet functions at times when no context is current?

The log is full of

GL ERROR - Function glEnable generated error GL_INVALID_ENUM
GL ERROR - Function glBindTexture generated error GL_INVALID_ENUM
GL ERROR - Function glEnable generated error GL_INVALID_ENUM
GL ERROR - Function glBindTexture generated error GL_INVALID_ENUM
GL ERROR - Function glEnable generated error GL_INVALID_ENUM
GL ERROR - Function glBindTexture generated error GL_INVALID_ENUM

The shader editor says

Awaiting other GLI command
== Command timed out -GLIntercept unresponsive (hung OpenGL app?) ==
== Unexpected command from GLIntercept ==
== Command timed out -GLIntercept unresponsive (hung OpenGL app?) ==

but the program isn’t hung. It does not list the GLSL shaders. I did one test with a ARBvp and ARBfp pair but it took a while for it to show them in the dialog.
Then did File-> Open Selected File name but nothing would happen. I assumed it would open one of the selected shaders.

Very strange, I have not seen this before.
Awaiting other GLI command
== Command timed out -GLIntercept unresponsive (hung OpenGL app?) ==

should only happen if the editor send a command to the application but does not get any response back in about 16 seconds. I have only observed this occuring in some applications that have a modal dialog open when pressing the key combination. (also the commands are procesed on the swap buffers - so if that is not called or your frame rate is very, very low you may get that.)

I always check for a valid context before making OpenGL calls - is there any other errors in the gliLog.txt?
(are there any errors reported when running your app with just the fulldebug settings and no shader editor?)

Are you using multiple threads with multiple OpenGL contexts at once? (ie. have more than one context active at a time?) GLintercept does not support that and will complain in the log if it is attempted.

To open shaders, either double click on the shader row/number or click on the “Open” button on the shader dialog. The Open Selected Filename is used if you have a selected filename in the editing text field. (legacy as the editor can edit more than shader files - like cpp files and you select a header file name in text to open. I may take this out if it confuses people - and make it more obvious how to edit shaders.)

Also, what card are you using? (I develop on Nvidia and the simple ATI tests only had some problems with GLSL uniforms.)

Is there a possibility of a demo app(or link) you can send me with this problem? I have had zero (real) problems with all the Nvidia/3DLabs/Humus GLSL demos. Could you perhaps download a humus demo and see if you have the same problems?

There is also a minor update to version 0.41 on the website. This includes some ultra-tiny bug fixes that probably don’t relate to your problem…

This tool seems to be pretty cool!

BTW, is there something similar for DirectX?

The closest thing would be PIX in the DX SDK. It was improved quite a bit in the December Update. Unfortunately, it’s not open source, so you can’t do any quick ‘n’ dirty hacks to see what the effect is of say removing a call to glDrawPixels() etc.

OK, I thought it had something to do with the frame rate. My program only updates on paint messages. It is single context. Context is not always current.

I’m using the shader version for gliConfig.ini
When the scene is empty, I get

GL Intercept Log. Version : 0.4    Compile Date: Dec 14 2004    Run on: Fri Dec 24 21:28:19 2004

Diagnostic: Unknown function glMultiDrawArraysEXT being logged.
Diagnostic: Unknown function glMultiDrawElementsEXT being logged.
Diagnostic: Unknown function glPointParameterfEXT being logged.
Diagnostic: Unknown function glPointParameterfvEXT being logged.
Diagnostic: Unknown function glAreTexturesResidentEXT being logged.
Diagnostic: Unknown function glBindTextureEXT being logged.
Diagnostic: Unknown function glDeleteTexturesEXT being logged.
Diagnostic: Unknown function glGenTexturesEXT being logged.
Diagnostic: Unknown function glIsTextureEXT being logged.
Diagnostic: Unknown function glPrioritizeTexturesEXT being logged.
Diagnostic: Unknown function glArrayElementEXT being logged.
Diagnostic: Unknown function glColorPointerEXT being logged.
Diagnostic: Unknown function glDrawArraysEXT being logged.
Diagnostic: Unknown function glEdgeFlagPointerEXT being logged.
Diagnostic: Unknown function glGetPointervEXT being logged.
Diagnostic: Unknown function glIndexPointerEXT being logged.
Diagnostic: Unknown function glNormalPointerEXT being logged.
Diagnostic: Unknown function glTexCoordPointerEXT being logged.
Diagnostic: Unknown function glVertexPointerEXT being logged.
Diagnostic: Unknown function glAddSwapHintRectWIN being logged.
GL ERROR - Function glGetIntegerv generated error GL_INVALID_ENUM

Is the error because of my code or yours?

I tested on another program of mine with an render in infinite loop and that works better. No gl errors.

Do you use the glGet functions to check states?

Humm, only updating on paint messages … That is somethng I did not think of. I may have to give it some though…

I am not sure if it my code or yours that is generating the error.(I call glGet a lot) Have you tried running your program with out the shader editor and with all the debug options on? (at least with ExtendedErrorLog and ThreadChecking )

It is not impossible that I am making bad OpenGL calls -but you would be only the second person to report a bug. (The first bug from someone else was not really my fault as the OpenGL spec was updated)

I just tried PIX, thanks for the hint Humus.

I can log all calls, but is it correct that I can’t see the resources, for example the shader code or texture data?


Hi sqrt,

You said you are creatig the shader editor as a separate process. How are you communicating between it and your dll?

I’ll have to sprinkle some glGetErrors then.
I can’t find the xml (or xsl?) file that is suppose to be generated.
gliConfig.ini has a line that says
LogFileName = “gliInterceptLog”
LogFormat = XML;

Maybe you should put both error log and this one together so that I’ll know what call causes the error.

The process communication is performed by windows messages.

The log file is not generated as LogPerFrame is probably on. (ie press Ctrl-Shift-F to grab a single frames’ worth of logging)

If you enable ExtendedErrorLog you will see all the parameters that caused the error.

The GL errors ARE embedded in the OpenGL call log. Disable the XML log (comment out the line) and disable PerFrame logging (set the Enabled flag to False) (or just use the default gliconfig.ini which is just flat text logging with basic errors reported)

Then do a search in the output log for “error”.

V-man make sure it can find your headers for the function prototyping. This software does not come with all prototypes hard coded in, it does a runtime parse of .h files and can add new methods. If it’s missing some functions either it can’t find the headers it came with or those functions aren’t in those headers and you need to add some with your own .h

My guess for your problem is that you’re using EXT instead of core functions for stuff that’s now in core and the shipped headers with the parser has the non EXT versions, (just a wild guess), you could add your own .h to the list of parsed headers.

One thing I noticed is that glIntercept isn’t perfect when it comes to legacy stuff but has a lot of the latest features.

sqrt, you should try running occasionally on stuff like the original half-life game and maybe other earlier code if you can.

might I also add GlIntercept is a wonderful way to perform an evil hack with maya (by intercepting the wgl function requesting a visual, forcing maya to open an RGBA framebuffer for destination alpha blending with CgFX in maya)

ok, now let the EVIL HACK comments begin ;>


GLIntercept does not need the headers to log the functions (infact is has no inbuilt function info) It just needs the headers to know the parameters to functions. If a unknown function is intercepted, it is still logged but without parameters. (these headers are only used for the text and XML loggers - the shader/image loggers and editors etc. don’t use it)

I doubt that this is the problem here as while there a few legacy functions being called and logged, it should not be causing any gl errors. (I’ll just see what happens when V-man runs with proper error logging and that should indicate where the error is)

I suppose I should update the function headers for some of the legacy stuff. (but with 300 or so extensions I was only really going to support core+ARB extensions - Though I do have the common Nvidai and ATI there as well)

sqrt, thanks for the help. It is creating the xml+xsl files now.

I located the problem (and silly me), I had even put a message in my code that “the following causes a GL error”.

I am not using any of those ancient EXT functions. It’s because of glew.
The call that causes the GL error is


and glew.h has invalid values for all the tokens for GL_EXT_texture_rectangle.

//edit// I downloaded glew 1.2.5 and it has the correct tokens.

For the record: GLIntercept is still the best Ev-AR!

Sorry to resurrect this old thread, but I can’t get ShaderEdit to work properly with a test app. I can evoke it just fine and edit the shaders, but as soon as I change anything in the fragment shader and hit F7, it’s as if the glsl shader is disabled, I get a standard fixed function output, in this case white material and a single directional light.