EE 7700-1 - Code Examples

Code used in class. The links below may point to out-of-date copies, use anonymous svn to retrieve the latest copies. Code is also available via anonymous svn from https://svn.ece.lsu.edu/svn/gp. Those not familiar with SVN should read these SVN instructions.

CPU-Only Code Examples

Code in which 3D graphics computed entirely on the CPU. The intent here is to understand 3D algorithms and their computational characteristics. Code Repository
Screenshot

Single Triangle

Demonstrates the most basic 3D techniques: how to project a triangle specified in object space onto a frame buffer. Draws one lonely (presumably) triangle.

Screenshot

Many Triangles

Demonstrates how to apply 3D techniques to a list of possibly unrelated primitives (triangles). The routine draws a grid of identical triangles pierced by a unique one.

Screenshot

Color & Z Buffering

Demonstrates color interpolation and Z buffering. The routine draws a grid of triangles pierced by a triangle. The angle of the grid can be interactively adjusted.

Screenshot

Lighting

Demonstrates simple lighting techniques. The routine draws a gold tube pierced by a triangle. There is a bright light in the tube that can dimmed, brightened, and moved around.

Screenshot

Textures

Demonstrates simple texture application and perspective-correct interpolation. Draws the tube, this time it surrounds two rectangles, one composed of many triangles, the other composed of two big ones. Textures can be applied to the tube and rectangles.

OpenGL Examples

Code using OpenGL for rendering. Code Repository
Screenshot

Textures

Texturing Examples. The code shows an undulating tube pierced by a purple quadrilateral. After turning on texturing the course syllabus will appear on the quadrilateral and tube. Filtering and texture mode can be changed using the UI.

Screenshot

Fragment Shader / Phong Shading

Simple fragment shader example. A fragment shader is used to implement Phong shading. Also see the shader code.

GPU Physics

Code using OpenGL and CUDA for physics and OpenGL for rendering. Code Repository
Screenshot

Balloon Simulation Using GLSL and CUDA

Simulation of a balloon, with physics performed by GPU using either OpenGL Shader Language (GLSL) or CUDA. Also see the OpenGL shader code used for physics, the CUDA code used for physics, the PTX pseudo GPU assembly language of the CUDA code, and the true (maybe) GPU assembly language of the CUDA code.


ECE Home Page Course Home Page
David M. Koppelman - koppel@ece.lsu.edu
Modified 2 May 2009 9:15 (1415 UTC)