Using 3D Acceleration

If you have a video card with 3D acceleration features, you may want to enable those features in X. You won't see any improvement in performance when using most programs, though; 3D acceleration is most commonly used by first-person-perspective games. A few other programs, such as 3D modeling tools, may also use these features.

When displaying a 3D object, a video card must account for many visual effects. For instance, where is the light source? What is the object's texture, and how does this interact with the light? How reflective is the object? 3D video cards include circuitry to help compute these effects. If a card lacks that circuitry, the computer's CPU must take over part of the job. This will reduce the performance of the 3D application, and may yield inferior results, as well. Video cards may use a variety of techniques to render 3D objects, and these techniques may produce better or worse results.

As with many hardware features, a series of software layers exist between a video card's 3D acceleration features and software that uses these features. In the Linux world, the biggest chunk of this interface is implemented in one of several implementations of OpenGL ( Specific OpenGL implementations for Linux include:

Xi Graphics' Summit Xi Graphics ( markets a line of commercial X servers that can replace XFree86. Some of these products, known as the Summit series, include OpenGL support.

Mesa This package is an open source implementation of the OpenGL specification. You can learn more from the project's web page, This package is used by XFree86's official 3D system, DRI.

If you want to use 3D acceleration features, you must configure both the Linux kernel and XFree86. In the kernel, you must add DRI support. This support is present in the Character Devices section. You must activate the main DRI support area and compile support for your specific card. If your card isn't supported, you'll get only unaccelerated 3D features from 3D applications, even if your video card includes 3D circuitry.

In XF86Config, you must load two modules in the Module section:

Load "glx" Load "dri"

You can also configure a DRI section, which may look something like this:

Section "DRI" Group "video"

Mode 0660 EndSection

This section uses Unix-style permissions to control access to the 3D features. In this example, those features are given permissions of 0660 and ownership by the video group—in other words, only users who belong to the video group can use the 3D acceleration features. If you want to allow anybody to use those features, you could omit the Group specification and change 0660 to 0666.

Once you've set up these features, you should install the Mesa package from your distribution or from the Mesa website. To test it, install the Mesa demo programs (they're often in a package called Mesa-demos or something similar) and try running one or more demos from this system, such as bounce or gears. Be sure to run the demos from an xterm window so that you can look for messages from the programs. For instance, if the program reports that the XFree86-DRI extension is missing, it means that your kernel's DRI module didn't load. Perhaps your video card isn't supported, or perhaps the module just didn't load for some reason. Try loading the module manually, as described in Chapter 1, or build the driver directly into the kernel and reboot.

Team LiB

1 previous

Team LIB

^ previous

0 0

Post a comment