Chapter 8. Specifying OpenGL Environment Variable Settings
Prev | Part I. Installation and Configuration Instructions | Next

## Chapter 8. Specifying OpenGL Environment Variable Settings

### Full scene antialiasing

Antialiasing is a technique used to smooth the edges of objects in a scene to reduce the jagged "stairstep" effect that sometimes appears. Full-scene antialiasing is supported on GeForce or newer hardware. By setting the appropriate environment variable, you can enable full-scene antialiasing in any OpenGL application on these GPUs.

Several antialiasing methods are available and you can select between them by setting the __GL_FSAA_MODE environment variable appropriately. Note that increasing the number of samples taken during FSAA rendering may decrease performance.

The following tables describe the possible values for __GL_FSAA_MODE and the effects that they have on various NVIDIA GPUs.

__GL_FSAA_MODE | GeForce, GeForce2, Quadro, and Quadro2 Pro
--- | ---
0 | FSAA disabled
1 | FSAA disabled
2 | FSAA disabled
3 | 1.5 x 1.5 Supersampling
4 | 2 x 2 Supersampling
5 | FSAA disabled
6 | FSAA disabled
7 | FSAA disabled

__GL_FSAA_MODE | GeForce4 MX, GeForce4 4xx Go, Quadro4 380,550,580 XGL, and Quadro4 NVS
--- | ---
0 | FSAA disabled
1 | 2x Bilinear Multisampling
2 | 2x Quincunx Multisampling
3 | FSAA disabled
4 | 2 x 2 Supersampling
5 | FSAA disabled
6 | FSAA disabled
7 | FSAA disabled

__GL_FSAA_MODE | GeForce3, Quadro DCC, GeForce4 Ti, GeForce4 4200 Go, and Quadro4 700,750,780,900,980 XGL
--- | ---
0 | FSAA disabled
1 | 2x Bilinear Multisampling
2 | 2x Quincunx Multisampling
3 | FSAA disabled
4 | 4x Bilinear Multisampling
5 | 4x Gaussian Multisampling
6 | 2x Bilinear Multisampling by 4x Supersampling
7 | FSAA disabled

__GL_FSAA_MODE | GeForce FX, GeForce 6xxx, GeForce 7xxx, Quadro FX
--- | ---
0 | FSAA disabled
1 | 2x Bilinear Multisampling
2 | 2x Quincunx Multisampling
3 | FSAA disabled
4 | 4x Bilinear Multisampling
5 | 4x Gaussian Multisampling
6 | 2x Bilinear Multisampling by 4x Supersampling
7 | 4x Bilinear Multisampling by 4x Supersampling
8 | 4x Bilinear Multisampling by 2x Supersampling (available on GeForce FX and later GPUs; not available on Quadro GPUs)

__GL_FSAA_MODE | GeForce 8xxx, G8xGL
--- | ---
0 | FSAA disabled
1 | 2x Bilinear Multisampling
2 | FSAA disabled
3 | FSAA disabled
4 | 4x Bilinear Multisampling
5 | FSAA disabled
6 | FSAA disabled
7 | 4x Bilinear Multisampling by 4x Supersampling
8 | FSAA disabled
9 | 8x Bilinear Multisampling
10 | 8x
11 | 16x
12 | 16xQ
13 | 8x Bilinear Multisampling by 4x Supersampling

### Anisotropic texture filtering

Automatic anisotropic texture filtering can be enabled by setting the environment variable __GL_LOG_MAX_ANISO. The possible values are:

__GL_LOG_MAX_ANISO | Filtering Type
--- | ---
0 | No anisotropic filtering
1 | 2x anisotropic filtering
2 | 4x anisotropic filtering
3 | 8x anisotropic filtering
4 | 16x anisotropic filtering

4x and greater are only available on GeForce3 or newer GPUs; 16x is only available on GeForce 6800 or newer GPUs.

### Vblank syncing

Setting the environment variable __GL_SYNC_TO_VBLANK to a non-zero value will force glXSwapBuffers to sync to your monitor's vertical refresh (perform a swap only during the vertical blanking period).

When using __GL_SYNC_TO_VBLANK with TwinView, OpenGL can only sync to one of the display devices; this may cause tearing corruption on the display device to which OpenGL is not syncing. You can use the environment variable __GL_SYNC_DISPLAY_DEVICE to specify to which display device OpenGL should sync. You should set this environment variable to the name of a display device; for example "CRT-1". Look for the line "Connected display device(s):" in your X log file for a list of the display devices present and their names. You may also find it useful to review Chapter 10, Configuring TwinView "Configuring Twinview" and the section on Ensuring Identical Mode Timings in Chapter 16, Programming Modes.

### Disabling CPU-specific features

Setting the environment variable __GL_FORCE_GENERIC_CPU to a non-zero value will inhibit the use of CPU-specific features such as MMX, SSE, or 3DNOW!. Use of this option may result in performance loss.

### Controlling the sorting of OpenGL FBConfigs

The NVIDIA GLX implementation sorts FBConfigs returned by glXChooseFBConfig() as described in the GLX specification. To disable this behavior set __GL_SORT_FBCONFIGS to 0 (zero), then FBConfigs will be returned in the order they were received from the X server. To examine the order in which FBConfigs are returned by the X server run:

    nvidia-settings --glxinfo

This option may be be useful to work around problems in which applications pick an unexpected FBConfig.

### OpenGL yield behavior

There are several cases where the NVIDIA OpenGL driver needs to wait for external state to change before continuing. To avoid consuming too much CPU time in these cases, the driver will sometimes yield so the kernel can schedule other processes to run while the driver waits. For example, when waiting for free space in a command buffer, if the free space has not become available after a certain number of iterations, the driver will yield before it continues to loop.

By default, the driver calls sched_yield() to do this. However, this can cause the calling process to be scheduled out for a relatively long period of time if there are other, same-priority processes competing for time on the CPU. One example of this is when an OpenGL-based composite manager is moving and repainting a window and the X server is trying to update the window as it moves, which are both CPU-intensive operations.

You can use the __GL_YIELD environment variable to work around these scheduling problems. This variable allows the user to specify what the driver should do when it wants to yield. The possible values are:

__GL_YIELD | Behavior
--- | ---
<unset> | By default, OpenGL will call sched_yield() to yield.
"NOTHING" | OpenGL will never yield.
"USLEEP" | OpenGL will call usleep(0) to yield.

### Controlling which OpenGL FBConfigs are available

The NVIDIA GLX implementation will hide FBConfigs that are associated with a 32-bit ARGB visual when the XLIB_SKIP_ARGB_VISUALS environment variable is defined. This matches the behavior of libX11, which will hide those visuals from XGetVisualInfo and XMatchVisualInfo. This environment variable is useful when applications are confused by the presence of these FBConfigs.

Prev | Up | Next
Chapter 7. Known Issues | Home | Chapter 9. Configuring AGP