- Chapter 1 "OpenGL on Silicon Graphics Systems,"
(8 pages)
This chapter introduces the basic issues you need to
know about if you want to write an OpenGL application
for Silicon Graphics systems. The chapter contains
the following topics, which are all discussed in more
detail elsewhere in this guide:
- "Using OpenGL With the X Window System"
- "Extensions to OpenGL"
- "Debugging and Performance Optimization"
- Chapter 2, "OpenGL and X: Getting Started,"
(18 pages)
This chapter first presents background
information that you will find useful when
working with OpenGL and the X Window
System. It then helps you get started right away
by discussing a simple example program that
displays OpenGL code in an X window. Topics
include:
- "Background and Terminology"
- "Librariess, Toolkits, and Tools"
- "Integrating Your OpenGL Program With IRIS IM"
- "Summary"
- "Compiling With OpenGL and Related Libraries"
- Chapter 3, "OpenGL and X: Examples,"
(24 pages)
- Chapter 4, "OpenGL and X: Advanced Topics,"
(30 pages)
This chapter helps you integrate your OpenGL program
with the X Window System by discussing several advanced
topics. While understanding the techniques and concepts
discussed here is not relevant for all applications, it
is important that you master them for certain special
situations. The chapter covers the following topics:
- "Using Animations"
- "Using Overlays"
- "Using Visuals"
- "Using Colormaps"
- "Stereo Rendering"
- "Using Pixmaps"
- "Performance Considerations for X and OpenGL"
- "Portability"
- Chapter 5, "Introduction to OpenGL Extensions,"
(4 pages)
OpenGL extensions introduce new features and enhance
performance. Some extensions provide completely new
functionality; for example, the convolution extension
allows you to blur or sharpen images using a filter
kernel. Other extensions enhance existing
functionality; for example, the subtexture extension
lets you replace a portion of a texture without
reloading the entire image.
Several extensions provide IRIS GL functionality
that is not available in OpenGL 1.0. If you are
porting a program from IRIS GL to OpenGL, you
may therefore find some extensions particularly
helpful. See Appendix A, "OpenGL and IRIS
GL," for a list of IRIS GL commands and
corresponding OpenGL functionality.
This chapter provides basic information about
OpenGL extensions. You learn about:
- "Determining Extension Availability"
- "Finding Information About Extensions"
- Chapter 6, "Texturing Extensions,"
(38 pages)
This chapter explains how to use the different
OpenGL texturing extensions. You learn about:
- "The Texture Extension"
- "The Texture Object Extension"
- "The Subtexture Extension"
- "The Copy Texture Extension"
- "The 3D Texture Extension"
- "The Texture Color Table Extension"
- "The Sharpen Texture Extension"
- "The Detail Texture Extension"
- "Texture Clamp Extensions"
- "The Texture LOD Extension"
- Chapter 7, "Imaging and Blending Extensions,"
(22 pages)
This chapter discusses imaging and
blending extensions. After some
introductory information, it looks at each
extension in some detail. You learn about:
- "Introduction to Imaging and Blending Extensions"
- "The ABGR Extension"
- "The Packed Pixels Extension"
- "The Color Matrix Extension"
- "The Convolution Extension"
- "The Histogram and Minmax Extensions"
- "The Color Table Extension"
- "The Interlace Extension"
- "Blending Extensions"
- Chapter 8, "Miscellaneous OpenGL Extensions,"
(18 pages)
This chapter explains how to use several
extensions that are not easily grouped
with texturing, imaging, or GLX
extensions, providing example code as
needed. You learn about:
- "The Polygon Offset Extension"
- "The Vertex Array Extension"
- "The Multisample Extension"
- Chapter 9, "Extensions to GLX,"
(32 pages)
GLX is an extension to the X Window System that makes
OpenGL available in an X Window System environment. All
GLX functions and other elements have the prefix glX
(just as all OpenGL elements have the prefix gl). For
more information about GLX, see "The GLX Extension to the
X Window System" in this document, and Appendix D, "The
OpenGL Extension to the X Window System," in the OpenGL
Programming Guide.
This chapter explains how to use extensions to
GLX. You learn about:
- "The Make Current Read Extension"
- "The Visual Info Extension"
- "The Visual Rating Extension"
- "The Video Synchronization Extension"
- "The Swap Control Extension"
- "The Import Context Extension"
The following sections describe
extensions that are experimental:
- "The Framebuffer Configuration Extension"
- "The Pixel Buffer Extension"
- "The Video Source Extension"
Note: Using OpenGL in an X Window
System environment is discussed in the
following chapters of this guide:
- "Chapter 2, "OpenGL and X: Getting Started"
- "Chapter 3, "OpenGL and X: Examples"
- "Chapter 4, "OpenGL and X: Advanced Topics"
- Chapter 10, "Debugging OpenGL Programs,"
(14 pages)
This chapter explains how to debug
graphics applications with the OpenGL
debugging tool ogldebug by discussing
the following topics:
- "Ogldebug Overview"
- "Basic Debugging With ogldebug"
- "Using Menus to Interact With ogldebug"
- "Tips for Debugging Graphics Programs"
- Chapter 11, "Tuning Graphics Applications: Fundamentals,"
(14 pages)
Tuning your software makes it use hardware capabilities
more effectively. This chapter looks at tuning graphics
applications. It discusses pipeline tuning as a
conceptual framework for tuning graphics applications,
and introduces some other fundamentals of tuning:
- "Why Is Tuning Useful?"
- "What Is Pipeline Tuning?"
- "Tuning Animation"
- "Optimizing Cache and Memory Use"
- "Taking Timing Measurements"
Writing high-performance code is usually more complex
than just following a set of rules. Most often, it
involves making trade-offs between special functions,
quality, and performance for a particular
application. For more information about
the issues you need to consider, and for a
tuning example, look at the following
chapters in this book:
- "Chapter 12, "Tuning the Pipeline"
- "Chapter 13, "Tuning Graphics Applications: Examples"
- "Chapter 14, "System-Specific Tuning"
After reading these chapters, experiment
with the different techniques described to
help you decide where to make these
trade-offs.
Note: If optimum performance is crucial,
consider using the IRIS Performer
rendering toolkit. See "Maximizing
Performance With IRIS Performer".
- Chapter 12, "Tuning the Pipeline,"
(26 pages)
This chapter looks in some detail at
tuning the graphics pipeline. It presents a
variety of techniques for optimizing the
different parts of the pipeline, providing
code fragments and examples as
appropriate. You learn about:
- "CPU Tuning: Basics"
- "CPU Tuning: Immediate Mode Drawing"
- "CPU Tuning: Display Lists"
- "CPU Tuning: Advanced Techniques"
- "Tuning the Geometry Subsystem"
- "Tuning the Raster Subsystem"
- "Tuning the Imaging Pipeline"
- Chapter 13, "Tuning Graphics Applications: Examples,"
(18 pages)
This chapter first presents a code
fragment that helps you draw pixels fast.
The second section steps through an
example of tuning a small graphics
program, showing changes to the program
and discussing the speed improvements
that result.
- Chapter 14, "System-Specific Tuning,"
(20 pages)
This chapter provides tuning information that's
relevant for particular Silicon Graphics
systems. Use these techniques as needed if
you expect your program to be used primarily
on one kind of system, or a group of
systems. The chapter discusses:
- "Optimizing Performance on Low-End Graphics Systems"
- "Optimizing Performance on Mid-Range Systems"
- "Optimizing Performance on Indigo2 IMPACT Systems"
- "Optimizing Performance on RealityEngine Systems"
Some points are also discussed in earlier
chapters but repeated here because they
result in particularly noticeable
performance improvement on certain
platforms.
Note: To determine your particular
hardware configuration, execute
/usr/gfx/gfxinfo. See the reference page
for gfxinfo for more information. You can
also call glGetString() with a
GL_RENDERER argument. See the
reference page for information about the
renderer strings for different systems.
- Appendix A, "OpenGL and IRIS GL,"
(10 pages)
The first step in porting a RealityEngine
IRIS GL application to OpenGL is to
consult the OpenGL Porting Guide. It
covers all the core IRIS GL and OpenGL
functionality, window and event
handling, and OpenGL extensions up to
and including those in IRIX 5.3.
This appendix provides some additional
information about porting IRIS GL to
OpenGL, pointing to the extensions
discussed in earlier chapters of this book
where appropriate. In order to make it as
short and comprehensible as possible, it
won't repeat any information from the
OpenGL Porting Guide.
- Appendix B, "Benchmarks,"
(8 pages)
This appendix contains a sample program
you can use to measure the performance
of an OpenGL operation. For an example
of how the program can be used with a
small graphics applications, see Chapter
13, "Tuning Graphics Applications: Examples."
- Appendix C, "Benchmarking Libaries: libpdb and libisfast,"
(8 pages)
When optimizing an OpenGL application, there
are two problems you need to address:
- When you're writing an OpenGL
application, it's difficult to know
whether a particular feature (like
depth buffering or texture mapping) is
fast enough to be useful.
- If you want your application to run
fast on a variety of machines, while
taking advantage of as many
hardware features as possible, you
need to write code that makes
configuration decisions at runtime.
For the OpenGL predecessor IRIS GL,
you could call getgdesc() to determine
whether a feature had hardware support.
For example, you could determine
whether a Z buffer existed. If it did, you
might assume that Z buffering was fast,
and therefore your application would use
it.
In OpenGL, things are more complicated. All
the core features are provided, even when
there is no hardware support for them and
they must be implemented completely in
software. There is no OpenGL routine that
reports whether a feature is implemented
partly or completely in hardware.
Furthermore, features interact in unpredictable
ways. For example, a machine might have
hardware support for depth buffering, but only
for some comparison functions. Or depth
buffering might be fast only as long as
stencilling is not enabled. Or depth
buffering might be
fast when drawing to a window, but slow
when drawing to a pixmap. And so on. A
routine that identifies hardware support
for particular features is actually a lot
more complicated and less useful than
you might think.
To decide whether a given OpenGL
feature is fast, you have to measure it.
Since the performance of a section of
graphics code is dependent on many
pieces of information from the runtime
environment, no other method is as
well-defined and reliable.
Keep in mind that while the results of the
libisfast routines are interesting, they
apply to limited special cases. Always
consider using a more general tool like
Open Inventor or IRIS Performer.
Performance measurement can be tricky:
- You need to handle the cases when
you're displaying over a network, as
well as locally.
- Think about flushing the graphics
pipeline properly, and accounting for
the resulting overhead.
- Measuring all the features needed by
your application may take a while.
Save performance measurements and
reuse them whenever possible; users
won't want to wait for measurements
each time the application starts.
- Consider measuring things other than
graphics: Disk and network
throughput, processing time for a
particular set of data, performance on
uniprocessor and multiprocessor systems.
Libraries for Benchmarking
This appendix describes two libraries that can
help with all of the tasks just mentioned:
- libpdb (Performance DataBase). Routines
for measuring execution rates and
maintaining a simple database.
- libisfast. A set of routines
demonstrating libpdb that answer
common questions about the
performance of OpenGL features
(using reasonable but subjective
criteria).
These libraries can't substitute for
comprehensive benchmarking and
performance analysis, and don't replace
more sophisticated tools (like IRIS
Performer and IRIS Inventor) that
optimize application performance in a
variety of ways. However, they can
handle simple tasks easily.
- Index, "Index,"
(22 pages)
- Tech Pubs Wants To Hear From You,
(1 page)