HijackGL--Non-Invasive Extensibility for Graphics Applications

Alex Mohr, Michael Gleicher and Christopher Herrman
Questions or comments? Send them to me: amohr@cs.wisc.edu


Non-Invasive, Interactive, Stylized Rendering
Reconstructing From Streams for Stylized Rendering


HijackGL is a system in development by Alex Mohr and Christopher Herrman under the direction of Michael Gleicher at the University of Wisconsin. The goal of this work is to develop a system that allows us to explore what can be done by intercepting, interpreting, and transforming the calls an application makes to the OpenGL graphics library. Preliminary work on this system led to research presented at the 2001 Interactive 3D Graphics Symposium. This work focused on generating non-photorealistic renderers for existing applications. For example, we demonstrated a pencil-sketch-style renderer running on id Software's Quake III Arena, as shown at the top of this page. We did not modify the source code of Quake III Arena at all. In fact, we do not even have access to the Quake III Arena source code. Current work involves developing a more general system to allow us to experiment with other kinds of non-invasive extensions.


Here we show our pencil-sketch plug-in renderer. On the left is a scene from Quake III Arena, and on the right is an image from the Atlantis test program.

Here are screenshots of Maya viewing the geometry of level q3dm17, captured by our 3D-Screenshot system plug-in, and also the geometry of the Atlantis program, captured the same way.

Download Binaries

We have decided to make some binaries available for download. BE WARNED! These are very rough and not well tested. It is likely they will not work for you, but they might.


Place these files in the directory that you run your program from:

opengl32.dll -- Intercepting OpenGL library (do NOT replace your system library with this!)
pencilsketch.glr -- Pencil-sketch plugin.
screencap.glr -- 3D geometry capture plugin.
blueprint.glr -- Blueprint rendering plugin.
toon.glr -- Cartoon rendering plugin.
pencil.tga -- Texture map used by pencil-sketch plugin.

These files do not need to be moved:

README.txt -- Instructions for use.
atlantis.exe -- Simple OpenGL test program.
glsample.exe -- Another simple test program.

After you've extracted the package to some directory, try running the atlantis program, and see if a dialog box pops up. If it does, select the pencilsketch.glr file. Now the atlantis program should start, and you should see some sea creatures swimming on a field of blue. To turn on the pencil-sketch version, simply press the SCROLL LOCK key. The background should turn gray, and the sea creatures should look "sketchy". To turn off the pencil-sketch renderer, press SCROLL LOCK again.

To make pencilsketch work with Quake 3, it takes some work. First, run Quake 3 WITHOUT having the HijackGL stuff in the directory. That is, run it normally. Make sure you have Quake 3 set up to run in NON-FULLSCREEN mode. If it is in fullscreen mode, you will not be able to get at the dialog box to select a renderer. Also, go into game options and turn off "high quality sky". At the console, type the command /cg_draw2D 0, to turn off drawing UI elements. You may also want to turn off drawing the first-person gun with /cg_drawGun 0 to get a better view of the screen.

Now, go ahead and copy the HijackGL binaries to the Quake 3 directory and run the program. Things should look normal. Start up a game like normal. When the map comes up and you are running around, try pressing SCROLL LOCK to turn on the renderer. It should work. Pressing SCROLL LOCK again will turn off the renderer. If your colors seem to be wrong, after it's turned off, try pulling down the console.

If it doesn't work for you, there's nothing much we can do. Certainly don't bother id Software about it -- they are not affiliated with us. Also, you will probably notice a big speed hit, and some people might consider it cheating if you use this in online play.

Operation of the screencap plugin: Pressing SCROLL LOCK while using the screencap plugin will take a "3D screenshot" of the scene's geometry and write it to a file called "screencap.obj" in the program's directory. This is a standard Wavefront OBJ file that can be viewed with a program like Maya. If you notice bits of geometry missing from scenes taken from Quake 3, this is normal. Quake 3 does very aggressive visibility culling, so much of what you cannot see does not show up.

We are not releasing source code at this time for a couple of reasons. First, the system is being reengineered, so the code is changing very quickly. Second, this system can be used to cheat at online games -- it's very easy to write a plugin that makes walls translucent, for instance. We don't want to encourage that at all. We all know what the ASUS drivers did.