Code Resources

From OpenGL Wiki
Jump to navigation Jump to search

What follows are links to small bits of code and examples submitted by outside parties. Many of these use functionality no longer available in core OpenGL.

OpenGL Specific Resources

Underlying commonalities of OpenGL implementations, how simple considerations kept in mind while authoring an application can greatly help in achieving better performance across all OpenGL capable platforms, and present techniques to determine where the performance bottleneck (and there always will be one) is occurring.
The Advanced OpenGL Game Programming Course covers many advanced rendering topics in detail, starting with the mathematical principles behind them. Then, the corresponding OpenGL interfaces are presented, and followed by suggested applications for next generation games. Finally, demos are shown to illustrate the concepts. The techniques presented not only increase realism in games, but also increase performance by offloading many operations onto the GPU that were previously performed on the CPU. The Optimized Stencil Shadow Volumes slides discusses fast “possible silhouette” determination and stenciled shadow volume culling and scissoring approaches minimize both the GPU and CPU burden.
In October and November of 1997, Silicon Graphics, 3DLabs, and Texas Instruments presented a series of lectures and programming labs to game developers working principally on Microsoft Windows platforms. These lectured discussed basic techniques for improving performance and visual realism. The are the presentations from those lectures., ,
SGI courses from the SIGGRAPH conferences on Developing Efficient Graphics Software: The Yin and Yang of Graphic and Programming with OpenGL: Advanced Rendering. Includes presentations, notes example programs and source.
Programs to show the texture encoding and texture mapping using Texfont and GLUT
The MUI portable user interface written in OpenGL with GLUT.
GLUT versions of the demonstration programs that come with the Mesa 3D library.
Example programs that are part of the GLUT distribution
Demos from the Advanced Programming in OpenGL course at SIGGRAPH '96
Programs that were contributed to the GLUT distribution
Programs from the Advanced Programming in OpenGL course at SIGGRAPH '96 + a few more that snuck in
These courses were presented at the 1999 SIGGRAPH Conference in Los Angeles, California. The Lighting and Shading Techniques for Interactive Applications course demonstrated lighting and shading techniques useful for interactive applications. The Advanced Graphics Programming Techniques Using OpenGL demonstrated more sophisticated and novel techniques possible using the OpenGL library.
How to quickly render a graph paper-like grid. Grids are often used as backdrops for 3D models to get extra distance cues to the viewer.
This code shows a particle system rendered as OpenGL points with attenuation of point size based on eye distance.
Reflections in puddles of water can add an extra eerie realism to first-person advantures. It is straightforward to render patchy planar reflections with OpenGL.
Light hitting the rippling surface of the water creates focusing effects or caustics on underwater surfaces (such as the walls of a pool). These effects are straightforward to generate using a second blended rendering pass with OpenGL's texture coordinate generation functionality and some caustic texture patterns
To help you quickly determine your application's real rendering speed on a given piece of hardware, it often helps to isolate the important rendering code in your application into a small application-specific benchmark.
OpenGL GLUT-based source code demonstrating projected textures used to cast a spotlight or a 35mm slide onto arbitrary surfaces
This code demonstrates real-time shadows cast by object of arbitary shape onto arbitary geometry. The shadows are not the simple planar shadow projections but can be cast onto curved surfaces and can even be cast by objects with holes in them.
Virtualized light sources refers to having a large number of scene light sources are mapped dynamically to OpenGL's limited number of (potentially hardware accelerated) OpenGL light sources using per-vertex lighting.
When you're writing an OpenGL application, how do you know whether a particular feature (like depth buffering or texture mapping) is fast enough to be useful? Measure it.
OpenGL's texture mapping and pixel processing facilities make it an excellent hardware acceleratable image processing API. This page shows how to write OpenGL programs that read, display, and write TIFF image files.
OpenGL provides rendering capabilities that enable real-time halo effects around 3D objects within your game scene that can also combine with other OpenGL rendering techniques
How OpenGL provides all the rendering functionality needed to combine texturing, lighting, reflections, and shadows all in a single scene.
How to use OpenGL's feedback mechanism to generate resolution independent versions of scenes rendered by OpenGL programs.
OpenGL has all the features needed to render fast high-quality reflections on planar surfaces. Artifact-free planar reflections require 3D transformations, blending, and stenciling.
A scale & bias operation lets an application quickly adjust the contrast and/or bightness of an image. In place refers to a scale & bias *after* texture filtering.
This FAQ about Binary Space Partitioning (BSP) Trees is intendedfor developers with working knowledge of computer graphics principles such as viewing transformations, clipping, and polygons, and of binary searching and sorting trees as covered in most computer algorithms textbooks.
Presentation notes and tutorials, as well as some background papers regarding OpenGL presented at Siggraph 2001. The tutorials include versions compiled for SGI’s Irix, Linux, and Microsoft Windows 9X/NT operating systems, as well as source code. All necessary data is included with the programs.
Windows 95/NT specific programs intended to be a tutorial for those getting started with OpenGL and Win32 including mouse events, pixel zoom, Window DIB, and more.
More interesting samples collected from a variety of places including CSG, distorting an image, drips, simple games, particles, mesh with a color ramp scale, palette animation, real-time soft shadows, and more.
Collection of simple programs helpful for testing an OpenGL implementation including accumulation testing, bitmap rendering, depth buffering, simple NURBs, packed pixels, shape primitives, warping, and more. Many have keyboard options.
Examples from the OpenGL Programming Guide v1.1 (Redbook) including drawing anti-aliased lines, accumulation buffer, texturing, clipping planes, fog, display lists, mipmaps, gl lighting, vector fonts, and more.