Tools for CS446: Realtime Rendering


Outside Tools

CVS

CVS is a versioning system that keeps full backups of all changes to your source code and allows more easilly for concurrent development. There is a freely available book online describing both basic and advanced usage. For Windows users, there's also TortoiseCVS which is a CVS frontend that integrates with the Windows explorer.

You are required to keep your projects on the department CVS. Following are directions for using your CVS repository.

Your group has a repository on the grad machines at /home/luebke/446-?-CVS/ where ? is your group number. To access this, you'll have to set your CVSROOT to something like the following:

mst3k@grad13.cs.virginia.edu:/home/luebke/446-9-CVS

Though substitute your computing ID for mst3k and your group number for the 9 in 446-9-CVS. In TortoiseCVS, this should be available in a dialog box. In UNIX CVS (also Cygwin), just set the CVSROOT environmental variable. If for whatever reason grad13 is down, grad12 should work just as well, as should any of the grad machines that are booted into Linux.

You'll also have to specify the method by which you'll be connecting to the CVS repository. Under TortoiseCVS, this is ":ext:". Under UNIX CVS, you have to set the environment variable CVS_RSH to "ssh" and have ssh installed. More information on this should be available in the CVS book and on the TortoiseCVS webpage.

Information on how to actually use the repositories is available online from the above sources. The first thing you'll have to do is start a project with the "import" command. Remember, though: CVS doesn't understand moving files, so you might want to give some thought to project layout from the beginning. Do not alter the files directly through unix on the command line! You can really screw yourself over. If you need help, ask.

Also, the repositories are setup to send out email notifications of commits and imports to members in the group. If you aren't receiving these, you're receiving another group's, or there are other problems with this, let me know. These are being sent to your CS accounts, so if you don't check that email account, use a ".forward" file. This is an important method of communication within your group!


In-House Tools

Following are a few tools developed within the UVA computer graphics lab that we use to simplify writing 3D, OpenGL applications. They are generally poorly documented and somewhat buggy, but useful nonetheless. We'd be happy to accept patches, documentation, and to a lesser extent, bug reports on any of these tools. Some of them may be maturing over the course of this semester, as well.

gfx-tools

gfx-tools (available for Linux, and Windows) is the package to bootstrap yourself with our toolset. It includes builds of most of our tools, and header files so that you can build dependant packages (whether of your own or of ours). Under Linux, most of our packages expect this to be in /usr/local/gfx-tools, though they're configurable. On Windows, you'll just have to set the library paths.

This package replaces GLUT, so don't even think about linking against standard GLUT and this, or using standard GLUT headers and these libraries, or gfx-tools GLUT header and standard binaries.

You may also want to take a look at using unwindows.h on either platform, as it provides some nice functionality, such as asprintf on Windows and GetTickCount on Linux in a cross-platform manner.

libanyview

Of particular note is libanyview-fileio (that's "lib/libanyview-fileio3.lib" on Windows and "lib/linux/libanyview3-fileio.a" on Linux). In "include/anyview-3/fileio.h", you'll find the following functions:

Model* av_fileio_read_modfile(const char *filename);
Takes a name of a model file and returns a pointer to a model structure of the loaded file.
void* av_fileio_read_texfile(const char *filename, int *w, int *h, GLenum *dataformat, GLenum *datatype)
Takes a filename and pointers to ints w and h, where it stores the width and the height of the loaded image. Also takes pointers to GLenums dataformat and datatype, which are the same as the format and type parameters to glTexImage2D(). Returns a pointer to the pixel data.
GLuint av_fileio_bind_texfile(const char *filename, unsigned char buildmipmaps, int *w, int *h);
This function just takes a string for the filename, and a boolean value for whether or not to build mipmaps, and pointers to ints w and h, to which, if non-null, it will store the width and height of the loaded texture. It binds the image file to a GL texture and returns the handle as a GLuint.

This library supports ppm, png (on Linux, at least), and bmp image formats, and ply, off, and obj model formats, though ply is the only well tested format of those. You may have to link against libpng yourself.

To make use of these formats, you must include the proper header file (ppm.h, bmp.h, or avpng.h), and call the av_[format]_init function. For example, to use BMP loading, #include<anyview-3/bmp.h> and then call av_bmp_init().

glh

GL/glh.h provides the function glhInit(const char *extensions) to which you pass a list of extensions for it to initialize. This works for both Windows and Linux.

Mathlib

mathlib/mathlib.h provides many common matrix and vector operations for array-typed vectors and matrices in C. It is composed mostly of preprocessor macros, but is generally very fast and will save you a lot of typing.

Texture class

This class (texture.h) provides a nice wrapper for floating point textures which can also be bound as rendering targets. Builds exist for both NVidia and ATI hardware on Windows.

Shader class

This class (shader.h) provides a nice wrapper for both Cg and GL shaders that handles a lot of the details of using a shader.

gsh

gsh (available for Linux and Windows) is a library that's included in gfx-tools, that provides a Quake-like drop-down console for debugging and interacting with your program. Take a few minutes to look at the source for gtest to figure out how this program is used. It's easy to add new functions, but it also comes with gshglcontrol, which allows you to interactively change GL state and inspect variables via glGet. Link against libgcon.a or gcon.lib for this graphical console.

Grab the demo application, gtest, for Windows.

Links: