PROJECT #2

Project 2: The Programmable Pipeline

The purpose of this project is to gain experience with the programmable pipeline and the OPENGL Shading Language.

In the interest of compatibility with available hardware, we'll be using GLSL version 1.20, which is slightly out of date but by no means obsolete. For your reference, here is the full GLSL 1.20 specification.

1. Acquire

You'll need a scene to work with. Create or otherwise download two or more 3D models in OBJ format. Free tools including Wings3D and Blender export OBJ nicely. Surprisingly, recent versions of Photoshop do a great job of exporting to OBJ. If you're comfortable using Maya or 3ds Max, then by all means do. Textured models are great, but not required. You may Google for OBJ models on the web, but prepare yourself for frustration.

2. Zoom In

Use the OBJ module to load and render your models. Allow the user to interactively view the scene using one of the mechanisms covered in the Interaction & Viewing lectures.

3. Enhance

Write at least three separate vertex programs and three separate fragment programs. One of the vertex programs should be the “wave” example, and one of the fragment programs should be the “brick” example from the lecture. Compile, link, and apply these programs to your loaded OBJ objects. Allow the user to select which programs are applied.

4. Extra

The effect of the remaining two vertex and fragment programs is left for you to choose. Have them do something interesting. For example, design a procedural material with user-tweakable parameters. Also think about using the surface normal, texture coordinates, viewer position, light sources, and any other uniforms and varyings at your disposal. Imagine unconventional uses for texture images. Consider a per-pixel illumination model. In general, try to make things configurable using uniform values mapped to user inputs and menus. If you accidentally create something weird and unexpected, that's good.

Of course, vertex and fragment programs often come in matched pairs. For example, if you wrote a normal-mapping Phong shader implemented using both a vertex and a fragment program components, then that counts as one of each.

5. Document

As always, make a web site documenting your work completely. Include screenshots of each program in action. Include all source code and assets necessary to reproduce the project, preferably in a ZIP archive. Describe each of your shaders, and explain how each one works in detail. Use your documentation to convince your instructor that you understand what you've presented instead of having simply copied it from a web site.