ATI™ is used under license and are registered trademarks of ATI Technologies Inc. in the United States and other
countries.
UNIX® is a registered trademark of The Open Group.
Intel® Itanium™ Processor Family is a trademark of Intel Corporation in the U.S. and other countries and is used
under license.
X/Open® is a registered trademark, and the X device is a trademark of X/Open Company Ltd. in the UK and
other countries.
Hewlett-Packard Company shall not be liable for technical or editorial errors or omissions contained herein or for
incidental or consequential damages in connection with the furnishing, performance, or use of this material. The
information in this document is provided “as is” without warranty of any kind, including, but not limited to, the
implied warranties of merchantability and fitness for a particular purpose, and is subject to change without notice.
The warranties for HP products are set forth in the express limited warranty statements accompanying such
products. Nothing herein should be construed as constituting an additional warranty.
This document contains proprietary information that is protected by copyright. No part of this document may be
photocopied, reproduced, or translated to another language without the prior written consent of Hewlett-Packard
Company.
WARNING: Text set off in this manner indicates that failure to follow directions could result in bodily
Å
harm or loss of life.
CAUTION: Text set off in this manner indicates that failure to follow directions could result in damage to
Ä
equipment or loss of information.
OpenGL implementation guide
for HP-UX 11.X (IPF version)
First Edition (june 2003)
OpenGL is a hardware-independent application programming interface (API) that provides an
interface to graphics operations. HP’s implementation of OpenGL converts API commands to
graphical images via hardware and/or software functionality.
The information in this manual is valid only for OpenGL on IPF. For information on OpenGL on
PA-RISC, refer to the PA-RISC version of the OpenGL Implementation Guide.
introduction
The OpenGL interface consists of a set of commands that allow applications to define and
manipulate three-dimensional objects. The commands include:
■ geometric primitive definitions
■ viewing operations
■ lighting specifications
■ primitive attributes
1
overview of OpenGL
■ pipeline control
■ rasterization control
OpenGL has been implemented on a large number of vendor platforms where the graphics
hardware supports a wide range of capabilities (for example, frame buffer only devices, fully
accelerated devices, devices without a frame buffer, and so on).
For more information on OpenGL, refer to these documents, published by Addison-Wesley and
shipped with HP’s implementation of OpenGL:
■ OpenGL Programming Guide
Instruction on programming in OpenGL, offered in a tutorial format.
■ OpenGL Reference Manual
A reference that contains details on all standard OpenGL functions, as well as utility (GLU)
functions and X Window (GLX) functions.
■ OpenGL Programming for the X Window System
Instruction on interfacing OpenGL with the X Window system.
the OpenGL product
This section provides information about HP’ s implementation of the OpenGL product, as well as
information about the standard OpenGL product.
OpenGL implementation guide1–1
overview of OpenGL
hp’s implementation of OpenGL
Topics covered in this section are:
■ HP’s implementation of the OpenGL libraries
■ supported graphics devices
■ supported visuals
■ visual support for other graphics devices
■ buffer sharing between multiple processes
■ support for 64-bit programming
■ support for threads
hp’s implementation of the OpenGL libraries
The OpenGL product does not support archived libraries.
HP’s implementation of OpenGL provides the following libraries:
■ libGL.so.2: Stub library that loads the appropriate rendering library
■ libXfGL.so.2: OpenGL library for use with XFree86
■ libGLU.so.2: OpenGL utilities library
There are two sets of libraries:
■ The path for the 32-bit libraries is:
/opt/graphics/OpenGL/lib/hpux32
■ The path for the 64-bit libraries is:
/opt/graphics/OpenGL/lib/hpux64
supported graphics devices
The graphics devices that support OpenGL on IPF are ATI™Fire GL4, ATI FireGL X1, and ATI
FireGL Z1.
1–2OpenGL implementation guide
supported visuals
In this section, each visual table will have a graphics device associated with it. For information
on visual support for graphics devices not in the above list, read the subsequent section “visual
support for other graphics devices” on page 1-4.
Visual Table for ATI Fire GL4
X Visual InformationOpenGL GLX Information
overview of OpenGL
ClassDepth Color
Map
Size
Buffer
Size
Overlay=1
or
Image=0
RGBA=1
or
Index=0
Double
Buffer
# Aux.
Buffers
Color
Buffer
Stencil Accumulation
Buffer
RGBA ZR G B A
PseudoColor 8256810000000 0 00 0 0 0
PseudoColor 8256810100000 0 00 0 0 0
TrueColor 242562401008880 24 416 16 16 0
TrueColor 242562401108880 24 416 16 16 0
TrueColor 242563201008888 24 416 16 16 16
TrueColor 242563201108888 24 416 16 16 16
Visual Table for ATI FireGL X1 and ATI FireGL Z1
X Visual InformationOpenGL GLX Information
ClassDepth Color
Map
Size
Buffer
Size
Overlay=1
or
Image=0
RGBA=1
or
Index=0
Double
Buffer
# Aux.
Buffers
Color
Buffer
Stencil Accumulation
Buffer
PseudoColor 8256810000000 0 00 0 0 0
PseudoColor 8256810100000 0 00 0 0 0
TrueColor 242562401008880 24 816 16 16 0
TrueColor 242562401108880 24 816 16 16 0
TrueColor 242563201008888 24 816 16 16 16
TrueColor 242563201108888 24 816 16 16 16
OpenGL implementation guide1–3
RGBA ZR G B A
overview of OpenGL
stereo visual support for ATI Fire GL4
When a monitor is configured in a stereo capable mode, ATI Fire GL4 will have the following
additional stereo visuals available. For more information on OpenGL stereo, read the section
“running hp's implementation of the OpenGL stereo application” on page 3-2.
Stereo Visual Support for ATI Fire GL4
X Visual InformationOpenGL GLX Information
ClassDepth Color
Map
Size
Buffer
Size
Overlay=1
or
Image=0
RGBA=1
or
Index=0
Double
Buffer
Stereo # Aux.
Buffers
Color Buffer Stencil Accumulation
Buffer
RGBAZR G B A
TrueColor 2425624011108 8 8 0 24 416 16 16 0
TrueColor 2425632011108 8 8 8 24 416 16 16 16
stereo visual support for ATI Fire GL4
Stereo is not supported in the initial release of the FireGL X1/Z1 driver. It will be supported in a
future release.
visual support for other graphics devices
The OpenGL product can also be used with the Virtual Memory Driver (VMD) in Virtual GLX
mode (VGL). VMD allows you to use many X11 dra wables (local or remote) as “virtual de vices”
for three-dimensional graphics with OpenGL. This includes rendering to X terminals and other
non-GLX extended X Servers.
Visual Table for VMD/VGL
X Visual InformationOpenGL GLX Information
ClassDepth Color
Map
Size
Buffer
Size
Overlay=1
or Image=0
RGBA=1
or
Index=0
Double
Buffer
# Aux.
Buffers
Color BufferStencil Accumulation
Buffer
RGBAZR G B A
PseudoColor 8256 800*0000024 40 0 0 0
PseudoColor 8256 800*000000 00 0 0 0
TrueColor 8256 811*0332024 416 16 16 0
TrueColor 24256 2401*0888**24 416 16 16 16
*Double buffering is set to True (1) if the X visual supports the X double-buffering extension (DBE).
**Alpha will only work correctly on 12- and 24-bit TrueColor and DirectColor visuals when the X Server does not use the
high-order nybble/byte in the X visual. Also, note that when alpha is present, Buffer Size will be 16 for the 12-bit visuals
and 32 for the 24-bit visuals.
1–4OpenGL implementation guide
threads support
OpenGL supports Level 2 threads. This means HP OpenGL can be used in threaded applications,
and more than one thread can use OpenGL.
Using OpenGL graphics in a kernel threaded application requires that the application link with
libpthread.so (not the archived version, libpthread.a).
OpenGL libraries are not cancel safe or fork safe.
A given context can only be current in one thread at a time.
Enable your X11 library to use threads by calling XInitThreads () in your program. An example
of a threaded OpenGL program is given in /opt/graphics/OpenGL/demos/threads.
additional documentation
For more information on using threads, see the following documentation:
■ The http://docs.hp.com Web site (search for “Threads” and “Multiprocessing”)
■ The OpenGL Programming Guide
■ The OpenGL Reference Manual
■ Threadtime by S. Norton and M. Dipasquale
overview of OpenGL
OpenGL implementation guide1–5
overview of OpenGL
64-bit programming
For information on porting your application to take advantage of 64-bit capabilities, see the
http://docs.hp.com
64-bit OpenGL allows “large data space” because the pointers are now 64-bit. But, the OpenGL
data types themselves are the same as the 32-bit library. For example, GLint is a 32-bit integer,
not a 64-bit long.
All 64-bit OpenGL libraries are located in /opt/graphics/OpenGL/lib/hpux64. The
following sample compile and link lines may help you to build your application once it has been
ported to take advantage of 64-bit capabilities:
Web site. Search for “64-bit Computing” to find the topic on “Porting.”
standard OpenGL product
This section covers the following topics:
■ the OpenGL utilities library (GLU)
■ input and output routines
■ the OpenGL extensions for the X Window system (GLX)
OpenGL Utilities Library (GLU)
The OpenGL Utilities Library (GLU) provides a useful set of drawing routines that perform such
tasks as:
■ generating texture coordinates
■ transforming coordinates
■ tessellating polygons
■ rendering surfaces
■ providing descriptions of curves and surfaces (NURBS)
■ handling errors
For a detailed description of these routines, refer to the Reference section or the OpenGL
Reference Manual.
input and output routines
OpenGL was designed to be independent of operating systems and window systems, therefore, it
does not have commands that perform such tasks as opening a window. To obtain these
capabilities, you will need to use X Windows routines (those whose names start with “glX”).
1–6OpenGL implementation guide
the OpenGL extensions for the X Window system (GLX)
HP’s OpenGL implementation currently supports version 1.2 of the glx extension.
The OpenGL Extension to the X Window System (GLX) provide routines for:
■ choosing a visual
■ managing the OpenGL rendering context
■ off-screen rendering
■ double buffering
■ using X fonts
For a detailed description of these routines, refer to the Reference section or the OpenGL
Reference Manual.
mixing of OpenGL and Xlib
The OpenGL implementation conforms to the specification definition for mixing Xlib and
OpenGL rendering to the same drawable. The following points should be considered when
mixing Xlib and OpenGL:
overview of OpenGL
■ OpenGL and Xlib renderers are implemented through separate pipelines and control streams.
Thus, rendering synchronization must be performed as necessary by the user’s application
via the GLX glXWaitX() and glXWaitGL() function calls.
■ Xlib rendering does not affect the Z-buffer, so rendering in X and then OpenGL w ould result
in the OpenGL rendering replacing the Xlib rendering. This is true if the last OpenGL
rendering to the Z-buffer at that location resulted in the depth test passing. Xlib rendering is
always to the visible buffer (front buffer).
Note that mixing Xlib rendering with OpenGL rendering as well as with VMD, when using alpha
buffers, can produce unexpected side effects and should be avoided.
gamma correction
Gamma correction is used to alter hardware colormaps to compensate for the non-linearities in
the phosphor brightness of monitors. Gamma correction can be used to improve the “ropy” or
modulated appearance of antialiased lines. Gamma correction is also used to improve the
appearance of shaded graphics images, as well as scanned photographic images that have not
already been gamma corrected. A utility for adjusting the display’s gamma correction is pro vided
at /opt/graphics/common/bin/gamma.
For details on this feature, read the section “Gamma Correction” found in the Graphics
Administration Guide.
OpenGL implementation guide1–7
overview of OpenGL
OpenGL extensions
The extensions listed in this section are extensions that HP has created; that is, in addition to
those standard functions described in the OpenGL Programming Guide, OpenGL Reference Manual, and OpenGL Programming for the X Window System.
draw array set extension
For additional information, see Chapter 5, “programming hints.”
3D texture extension
The 3D-texture extension is useful for volumetric rendering of solid surfaces such as a marble
vase, or for rendering images where geometric alignment is important (such as an MRI medical
image). For this extension, the texture maps ha ve width and height as the y did for 2D, b ut also an
additional dimension depth not included in 2D. The third coordinate forms a right-handed
coordinate system, as the following illustration shows.
r (depth)
t (height)
s (width)
Right-Handed Coordinate System for 3D Texturing
Each MIPmap level consists of a block of data (see Each MIPmap is a Block in 3-D Texturing
below). Each MIPmap level of the texture map is treated as being arranged in a sequence of
adjacent rectangles. Each rectangle is a 2-dimensional image, so each MIPmap level is a (2m +
2b) (2n + 2b) (2l + 2b) block where b is a border width of either 0 or 1, and m, n and l are
non-negative integers.
Each MIPmap is a Block in 3-D Texturing
1–8OpenGL implementation guide
GL_LINEAR_MIPMAP_LINEAR Filtering may use Two Blocks
Enumerated Types for 3D Texturing
Extended AreaEnumerated TypeDescription
overview of OpenGL
Pixel StorageGL_[UN]PACK_IMAGE_HEIGHT_EXT
Default: 0 for each
Pixel StorageGL_[UN]PACK_SKIP_IMAGES_EXT
Default: 0 for each
Texture Wrap ModesGL_TEXTURE_WRAP_R_EXT
Default: GL_REPEAT
Enable/DisableGL_MAX_3D_TEXTURE_SIZE_EXT,
GL_TEXTURE_BINDING_3D_EXT
Default: N/A
Get FormatsGL_MAX_3D_TEXTURE_SIZE_EXT,
GL_TEXTURE_BINDING_3D_EXT
Default: N/A
ProxyGL_PROXY_TEXTURE_3D_EXT
Default: N/A
steps for 3D texturing programming
To use the 3D texture extension (see sample program below):
1. Enable the 3D texture extension using glEnable(GL_TEXTURE_3D_EXT);
The height of the image from which the
texture is created; it supersedes the value of
the height passed into glTexImage3DEXT.
The initial skip of contiguous rectangles of
the texture.
The wrap mode applied to the r texture
coordinate.
The method to enable/disable 3D
texturing.
The maximum size of the 3D texture
allowed; bind query
The proxy texture that can be used to query
the configurations.
2. Create a 3D texture using glTexImage3DEXT;
3. Specify or generate the s, t and r texture coordinates using glTexGen or glTexCoord3*;
4. Specify other parameters such as filters just as you would for 2D texturing, but use
GL_TEXTURE_3D_EXT for the target.
OpenGL implementation guide1–9
Loading...
+ 29 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.