import NVIDIA-FreeBSD-x86-185.18.36
[nvidia.git] / doc / html / chapter-10.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta name="generator" content=
5 "HTML Tidy for FreeBSD (vers 1 September 2005), see www.w3.org">
6 <meta http-equiv="Content-Type" content=
7 "text/html; charset=us-ascii">
8 <title>Chapter&nbsp;10.&nbsp;Specifying OpenGL Environment Variable
9 Settings</title>
10 <meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
11 <link rel="start" href="index.html" title=
12 "NVIDIA Accelerated FreeBSD Graphics Driver README and Installation Guide">
13 <link rel="up" href="part-01.html" title=
14 "Part&nbsp;I.&nbsp;Installation and Configuration Instructions">
15 <link rel="prev" href="chapter-09.html" title=
16 "Chapter&nbsp;9.&nbsp;Known Issues">
17 <link rel="next" href="chapter-11.html" title=
18 "Chapter&nbsp;11.&nbsp;Configuring AGP">
19 </head>
20 <body>
21 <div class="navheader">
22 <table width="100%" summary="Navigation header">
23 <tr>
24 <th colspan="3" align="center">Chapter&nbsp;10.&nbsp;Specifying
25 OpenGL Environment Variable Settings</th>
26 </tr>
27 <tr>
28 <td width="20%" align="left"><a accesskey="p" href=
29 "chapter-09.html">Prev</a>&nbsp;</td>
30 <th width="60%" align="center">Part&nbsp;I.&nbsp;Installation and
31 Configuration Instructions</th>
32 <td width="20%" align="right">&nbsp;<a accesskey="n" href=
33 "chapter-11.html">Next</a></td>
34 </tr>
35 </table>
36 <hr></div>
37 <div class="chapter" lang="en">
38 <div class="titlepage">
39 <div>
40 <div>
41 <h2 class="title"><a name="openglenvvariables" id=
42 "openglenvvariables"></a>Chapter&nbsp;10.&nbsp;Specifying OpenGL
43 Environment Variable Settings</h2>
44 </div>
45 </div>
46 </div>
47 <h3>Full scene antialiasing</h3>
48 <p>Antialiasing is a technique used to smooth the edges of objects
49 in a scene to reduce the jagged "stairstep" effect that sometimes
50 appears. By setting the appropriate environment variable, you can
51 enable full-scene antialiasing in any OpenGL application on these
52 GPUs.</p>
53 <p>Several antialiasing methods are available and you can select
54 between them by setting the __GL_FSAA_MODE environment variable
55 appropriately. Note that increasing the number of samples taken
56 during FSAA rendering may decrease performance.</p>
57 <p>To see the available values for __GL_FSAA_MODE along with their
58 descriptions, run:</p>
59 <pre class="screen">
60     nvidia-settings --query=fsaa --verbose
61 </pre>
62 <p>The __GL_FSAA_MODE environment variable uses the same integer
63 values that are used to configure FSAA through nvidia-settings and
64 the NV-CONTROL X extension. In other words, these two commands are
65 equivalent:</p>
66 <pre class="screen">
67     export __GL_FSAA_MODE=5
68
69     nvidia-settings --assign FSAA=5
70 </pre>
71 <p>Note that there are three FSAA related configuration attributes
72 (FSAA, FSAAAppControlled and FSAAAppEnhanced) which together
73 determine how a GL application will behave. If FSAAAppControlled is
74 1, the FSAA specified through nvidia-settings will be ignored, in
75 favor of what the application requests through FBConfig selection.
76 If FSAAAppControlled is 0 but FSAAAppEnhanced is 1, then the FSAA
77 value specified through nvidia-settings will only be applied if the
78 application selected a multisample FBConfig.</p>
79 <p>Therefore, to be completely correct, the nvidia-settings command
80 line to unconditionally assign FSAA should be:</p>
81 <pre class="screen">
82     nvidia-settings --assign FSAA=5 --assign FSAAAppControlled=0 --assign FSAAAppEnhanced=0
83 </pre>
84 <p></p>
85 <h3>Anisotropic texture filtering</h3>
86 <p>Automatic anisotropic texture filtering can be enabled by
87 setting the environment variable __GL_LOG_MAX_ANISO. The possible
88 values are:</p>
89 <div class="informaltable">
90 <table summary="(no summary available)" border="0">
91 <colgroup>
92 <col>
93 <col></colgroup>
94 <thead>
95 <tr>
96 <th>__GL_LOG_MAX_ANISO</th>
97 <th>Filtering Type</th>
98 </tr>
99 </thead>
100 <tbody>
101 <tr>
102 <td>0</td>
103 <td>No anisotropic filtering</td>
104 </tr>
105 <tr>
106 <td>1</td>
107 <td>2x anisotropic filtering</td>
108 </tr>
109 <tr>
110 <td>2</td>
111 <td>4x anisotropic filtering</td>
112 </tr>
113 <tr>
114 <td>3</td>
115 <td>8x anisotropic filtering</td>
116 </tr>
117 <tr>
118 <td>4</td>
119 <td>16x anisotropic filtering</td>
120 </tr>
121 </tbody>
122 </table>
123 </div>
124 <p>4x and greater are only available on GeForce3 or newer GPUs; 16x
125 is only available on GeForce 6800 or newer GPUs.</p>
126 <h3>Vblank syncing</h3>
127 <p>Setting the environment variable __GL_SYNC_TO_VBLANK to a
128 non-zero value will force glXSwapBuffers to sync to your monitor's
129 vertical refresh (perform a swap only during the vertical blanking
130 period).</p>
131 <p>When using __GL_SYNC_TO_VBLANK with TwinView, OpenGL can only
132 sync to one of the display devices; this may cause tearing
133 corruption on the display device to which OpenGL is not syncing.
134 You can use the environment variable __GL_SYNC_DISPLAY_DEVICE to
135 specify to which display device OpenGL should sync. You should set
136 this environment variable to the name of a display device; for
137 example "CRT-1". Look for the line "Connected display device(s):"
138 in your X log file for a list of the display devices present and
139 their names. You may also find it useful to review <a href=
140 "chapter-12.html" title=
141 "Chapter&nbsp;12.&nbsp;Configuring TwinView">Chapter&nbsp;12,
142 <i>Configuring TwinView</i></a> "Configuring Twinview" and the
143 section on Ensuring Identical Mode Timings in <a href=
144 "chapter-18.html" title=
145 "Chapter&nbsp;18.&nbsp;Programming Modes">Chapter&nbsp;18,
146 <i>Programming Modes</i></a>.</p>
147 <h3>Controlling the sorting of OpenGL FBConfigs</h3>
148 <p>The NVIDIA GLX implementation sorts FBConfigs returned by
149 glXChooseFBConfig() as described in the GLX specification. To
150 disable this behavior set __GL_SORT_FBCONFIGS to 0 (zero), then
151 FBConfigs will be returned in the order they were received from the
152 X server. To examine the order in which FBConfigs are returned by
153 the X server run:</p>
154 <pre class="screen">
155 nvidia-settings --glxinfo
156 </pre>
157 <p>This option may be be useful to work around problems in which
158 applications pick an unexpected FBConfig.</p>
159 <h3>OpenGL yield behavior</h3>
160 <p>There are several cases where the NVIDIA OpenGL driver needs to
161 wait for external state to change before continuing. To avoid
162 consuming too much CPU time in these cases, the driver will
163 sometimes yield so the kernel can schedule other processes to run
164 while the driver waits. For example, when waiting for free space in
165 a command buffer, if the free space has not become available after
166 a certain number of iterations, the driver will yield before it
167 continues to loop.</p>
168 <p>By default, the driver calls sched_yield() to do this. However,
169 this can cause the calling process to be scheduled out for a
170 relatively long period of time if there are other, same-priority
171 processes competing for time on the CPU. One example of this is
172 when an OpenGL-based composite manager is moving and repainting a
173 window and the X server is trying to update the window as it moves,
174 which are both CPU-intensive operations.</p>
175 <p>You can use the __GL_YIELD environment variable to work around
176 these scheduling problems. This variable allows the user to specify
177 what the driver should do when it wants to yield. The possible
178 values are:</p>
179 <div class="informaltable">
180 <table summary="(no summary available)" border="0">
181 <colgroup>
182 <col>
183 <col></colgroup>
184 <thead>
185 <tr>
186 <th>__GL_YIELD</th>
187 <th>Behavior</th>
188 </tr>
189 </thead>
190 <tbody>
191 <tr>
192 <td>&lt;unset&gt;</td>
193 <td>By default, OpenGL will call sched_yield() to yield.</td>
194 </tr>
195 <tr>
196 <td>"NOTHING"</td>
197 <td>OpenGL will never yield.</td>
198 </tr>
199 <tr>
200 <td>"USLEEP"</td>
201 <td>OpenGL will call usleep(0) to yield.</td>
202 </tr>
203 </tbody>
204 </table>
205 </div>
206 <p></p>
207 <h3>Controlling which OpenGL FBConfigs are available</h3>
208 <p>The NVIDIA GLX implementation will hide FBConfigs that are
209 associated with a 32-bit ARGB visual when the
210 XLIB_SKIP_ARGB_VISUALS environment variable is defined. This
211 matches the behavior of libX11, which will hide those visuals from
212 XGetVisualInfo and XMatchVisualInfo. This environment variable is
213 useful when applications are confused by the presence of these
214 FBConfigs.</p>
215 <p><a name="unofficialprotoenv" id="unofficialprotoenv"></a></p>
216 <h3>Using Unofficial GLX protocol</h3>
217 <p>By default, the NVIDIA GLX implementation will not expose GLX
218 protocol for GL commands if the protocol is not considered
219 complete. Protocol could be considered incomplete for a number of
220 reasons. The implementation could still be under development and
221 contain known bugs, or the protocol specification itself could be
222 under development or going through review. If users would like to
223 test the client-side portion of such protocol when using indirect
224 rendering, they can set the __GL_ALLOW_UNOFFICIAL_PROTOCOL
225 environment variable to a non-zero value before starting their GLX
226 application. When an NVIDIA GLX server is used, the related X
227 Config option <a href=
228 "appendix-b.html#AllowUnofficialGLXProtocol">AllowUnofficialGLXProtocol</a>
229 will need to be set as well to enable support in the server.</p>
230 </div>
231 <div class="navfooter">
232 <hr>
233 <table width="100%" summary="Navigation footer">
234 <tr>
235 <td width="40%" align="left"><a accesskey="p" href=
236 "chapter-09.html">Prev</a>&nbsp;</td>
237 <td width="20%" align="center"><a accesskey="u" href=
238 "part-01.html">Up</a></td>
239 <td width="40%" align="right">&nbsp;<a accesskey="n" href=
240 "chapter-11.html">Next</a></td>
241 </tr>
242 <tr>
243 <td width="40%" align="left" valign="top">
244 Chapter&nbsp;9.&nbsp;Known Issues&nbsp;</td>
245 <td width="20%" align="center"><a accesskey="h" href=
246 "index.html">Home</a></td>
247 <td width="40%" align="right" valign="top">
248 &nbsp;Chapter&nbsp;11.&nbsp;Configuring AGP</td>
249 </tr>
250 </table>
251 </div>
252 </body>
253 </html>