Paul Rajlich
Research Programmer
Visualization and Virtual Environments
National Center for Supercomputing Applications
prajlich@ncsa.uiuc.edu
http://brighton.ncsa.uiuc.edu/~prajlich/
MAIN
WORK
CODE
PLAY
CAVE
WALL
miniWALL
STUFF


WireGL modifications

In order to support distributed textures, I made some modifications to WireGL. The idea for this came from an email conversation with Ian Buck of the WireGL team. Essentially, I added two new features to glTexImage2D to support caching of textures across the cluster.

The spec for glTexImage2D is:

void glTexImage2D( GLenum target,
                        GLint level,
                        GLint internalformat,
                        GLsizei width,
                        GLsizei height,
                        GLint border,
                        GLenum format,
                        GLenum type,
                        const GLvoid *pixels )
Normally, type is one of GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, etc.

I added two more options for type that are normally invalid. The two options are GL_TRUE and GL_FALSE.

If the type is set to GL_TRUE then the pixels data is interpreted as a filename followed by the texture data. On the unpacking side, the filename is extracted and the texture data is saved to local disk.

If the type is set to GL_FALSE then the pixels data is interpreted as only a filename. On the unpacking side, the filename is extracted and the texture is loaded from local disk.


With these two simple modifications to WireGL, I was able to write a distributed movieplayer with good performance. Since the new calls to glTexImage2D are invalid in regular OpenGL, they do not interfere with other users of the system. However, I made sure to have modes so that the movieplayer can also be used with normal OpenGL.

Note: These modifications have been added to the official WireGL distribution starting with version 1.2.1.

This functionality was put into the "dist_texture" SPU for Chromium by David Thompson.


(C)opyright 2003, Paul Rajlich       Want to see what I am doing now? Visit www.visbox.com