89145f0cb88c128b02e99d2d1118531f7821c0b8
[mesa.git] / docs / faq.html
1 <html>
2
3 <head><title>Mesa FAQ</title></head>
4
5 <BODY text="#000000" bgcolor="#55bbff" link="#111188">
6
7
8 <center>
9 <h1>Mesa Frequently Asked Questions</h1>
10 Last updated: 30 March 2003
11 </center>
12
13 <br>
14 <br>
15 <h2>Index</h2>
16 <a href="#part1">1. High-level Questions and Answers</a>
17 <br>
18 <a href="#part2">2. Compilation and Installation Problems</a>
19 <br>
20 <a href="#part3">3. Runtime / Rendering Problems</a>
21 <br>
22 <a href="#part4">4. Developer Questions</a>
23 <br>
24 <br>
25 <br>
26
27
28
29 <a name="part1">
30 </a><h1><a name="part1">1. High-level Questions and Answers</a></h1>
31
32 <h2><a name="part1">1.1 What is Mesa?</a></h2>
33 <p>
34 <a name="part1">Mesa is an open-source implementation of the OpenGL specification.
35 OpenGL is a programming library for writing interactive 3D applications.
36 See the </a><a href="http://www.opengl.org/">OpenGL website</a> for more
37 information.
38 </p>
39 <p>
40 Mesa 5.x supports the OpenGL 1.4 specification.
41 </p>
42
43
44 <h2>1.2 Does Mesa support/use graphics hardware?</h2>
45 <p>
46 Yes. Specifically, Mesa serves as the OpenGL core for the open-source
47 XFree86/DRI OpenGL drivers. See the <a href="http://dri.sf.net/">DRI
48 website</a> for more information.
49 </p>
50 <p>
51 There have been other hardware drivers for Mesa over the years (such as
52 the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
53 are the modern ones.
54 </p>
55
56 <h2>1.3 What purpose does Mesa (software-based rendering) serve today?</h2>
57 <p>
58 Hardware-accelerated OpenGL implementations are available for most popular
59 operating systems today.
60 Still, Mesa serves at least these purposes:
61 </p>
62 <ul>
63 <li>Mesa is used as the core of the open-source XFree86/DRI hardware drivers.
64 </li>
65 <li>Mesa is quite portable and allows OpenGL to be used on systems
66 that have no other OpenGL solution.
67 </li>
68 <li>Software rendering with Mesa serves as a reference for validating the
69 hardware drivers.
70 </li>
71 <li>A software implementation of OpenGL is useful for experimentation,
72 such as testing new rendering techniques.
73 </li>
74 <li>Mesa can render images with deep color channels: 16-bit integer
75 and 32-bit floating point color channels are supported.
76 This capability is only now appearing in hardware.
77 </li>
78 <li>Mesa's internal limits (max lights, clip planes, texture size, etc) can be
79 changed for special needs (hardware limits are hard to overcome).
80 </li>
81 </ul>
82
83 <h2>1.4 How do I upgrade my DRI installation to use a new Mesa release?</h2>
84 <p>
85 You don't! A copy of the Mesa source code lives inside the XFree86/DRI source
86 tree and gets compiled into the individual DRI driver modules.
87 If you try to install Mesa over an XFree86/DRI installation, you'll lose
88 hardware rendering (because stand-alone Mesa's libGL.so is different than
89 the XFree86 libGL.so).
90 </p>
91 <p>
92 The DRI developers will incorporate the latest release of Mesa into the
93 DRI drivers when the time is right.
94 </p>
95
96 <h2>1.5 Are there other open-source implementations of OpenGL?</h2>
97 <p>
98 Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html">
99 OpenGL Sample Implemenation (SI)</a> is available.
100 The SI was written during the time that OpenGL was originally designed.
101 Unfortunately, development of the SI has stagnated.
102 Mesa is much more up to date with modern features and extensions.
103 </p>
104 <p>
105 <a href="http://www.dsbox.com/minigl.html">miniGL</a> is a subset of OpenGL
106 for PalmOS devices.
107
108 <a href="http://fabrice.bellard.free.fr/TinyGL/">TinyGL</a> is another
109 subset of OpenGL.
110 </p>
111 <p>
112 There may be others but Mesa is the most popular and feature-complete.
113 </p>
114
115 <br>
116 <br>
117
118
119 <a name="part2">
120 </a><h1><a name="part2">2. Compilation and Installation Problems</a></h1>
121
122
123 <h2><a name="part2">2.1 What's the easiest way to install Mesa?</a></h2>
124 <p>
125 <a name="part2">If you're using a Linux-based system, your distro CD most likely already
126 has Mesa packages (like RPM or DEB) which you can easily install.
127 </a></p>
128
129
130 <h2><a name="part2">2.2 Running <code>configure; make</code> Doesn't Work</a></h2>
131 <p>
132 <a name="part2">Unfortunately, the GNU autoconf/automake/libtool system doesn't seem to work
133 too well on non GNU/Linux systems, even after installing gmake, gcc, etc.
134 For that reason, Mesa's <b>old-style</b> makefile system is still included.
135 The old-style system uses good old traditional Makefiles. Try the following:
136 </a></p><pre><a name="part2"> cd Mesa-x.y.z
137 cp Makefile.X11 Makefile
138 make
139 </a></pre>
140 <a name="part2">You'll see a list of system configurations from which to choose.
141 For example:
142 </a><pre><a name="part2"> make linux-x86
143 </a></pre>
144 <p>
145 <a name="part2">If you're experienced with GNU autoconf/automake/libtool and think you can help
146 with maintence, contact the Mesa developers.
147 FYI, the Mesa developers generally don't use the autoconf/automake system.
148 We're especially annoyed with the fact that a +5000-line script (libtool)
149 is needed to make shared libraries (ugh).
150 </a></p>
151
152 <h2><a name="part2">2.3 Mesa still doesn't compile</a></h2>
153 <p>
154 <a name="part2">If the old-style Makefile system doesn't work either, make sure you have
155 the most recent version of Mesa.
156 Otherwise, file a bug report or post to the Mesa3d-users mailing list.
157 Give as much info as possible when describing your problem.
158 </a></p>
159
160
161 <h2><a name="part2">2.4 I get undefined symbols such as bgnpolygon, v3f, etc...</a></h2>
162 <p>
163 <a name="part2">You're application is written in IRIS GL, not OpenGL.
164 IRIS GL was the predecessor to OpenGL and is a different thing (almost)
165 entirely.
166 Mesa's not the solution.
167 </a></p>
168
169
170 <h2><a name="part2">2.5 Where is the GLUT library?</a></h2>
171 <p>
172 <a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaDemos-x.y.z.tar.gz file.
173 If you don't already have GLUT installed, you should grab the MesaDemos
174 package and unpack it before compiling Mesa.
175 </a></p>
176
177
178
179 <h2><a name="part2">2.6 What's the proper place for the libraries and headers?</a></h2>
180 <p>
181 <a name="part2">On Linux-based systems you'll want to follow the
182 </a><a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html">Linux ABI</a>
183 standard.
184 Basically you'll want the following:
185 </p>
186 <ul>
187 <li>/usr/include/GL/gl.h - the main OpenGL header
188 </li><li>/usr/include/GL/glu.h - the OpenGL GLU (utility) header
189 </li><li>/usr/include/GL/glx.h - the OpenGL GLX header
190 </li><li>/usr/include/GL/glext.h - the OpenGL extensions header
191 </li><li>/usr/include/GL/glxext.h - the OpenGL GLX extensions header
192 </li><li>/usr/include/GL/osmesa.h - the Mesa off-screen rendering header
193 </li><li>/usr/lib/libGL.so - a symlink to libGL.so.1
194 </li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
195 </li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
196 Mesa version number.
197 </li><li>/usr/lib/libGLU.so - a symlink to libGLU.so.1
198 </li><li>/usr/lib/libGLU.so.1 - a symlink to libGLU.so.1.3.xyz
199 </li><li>/usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa
200 version number.
201 </li></ul>
202 <p>
203 After installing XFree86 and the DRI drivers, some of these files
204 may be symlinks into the /usr/X11R6/ tree.
205 </p>
206 <p>
207 The old-style Makefile system doesn't install the Mesa libraries; it's
208 up to you to copy them (and the headers) to the right place.
209 </p>
210 <p>
211 The GLUT header and library should go in the same directories.
212 </p>
213 <br>
214 <br>
215
216
217 <a name="part3">
218 </a><h1><a name="part3">3. Runtime / Rendering Problems</a></h1>
219
220 <h2><a name="part3">3.1 Rendering is slow / why isn't my graphics hardware being used?</a></h2>
221 <p>
222 <a name="part3">Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
223 support for hardware acceleration (with the exception of the 3DFX Voodoo
224 driver).
225 </a></p>
226 <p>
227 <a name="part3">What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
228 for your particular hardware.
229 </a></p>
230 <p>
231 <a name="part3">You can run the <code>glxinfo</code> program to learn about your OpenGL
232 library.
233 Look for the GL_VENDOR and GL_RENDERER values.
234 That will identify who's OpenGL library you're using and what sort of
235 hardware it has detected.
236 </a></p>
237 <p>
238 <a name="part3">If your DRI-based driver isn't working, go to the
239 </a><a href="http://dri.sf.net/">DRI website</a> for trouble-shooting information.
240 </p>
241
242
243 <h2>3.2 I'm seeing errors in depth (Z) buffering. Why?</h2>
244 <p>
245 Make sure the ratio of the far to near clipping planes isn't too great.
246 Look
247 <a href="http://www.sgi.com/software/opengl/advanced97/notes/node18.html">
248 here</a> for details.
249 </p>
250 <p>
251 Mesa uses a 16-bit depth buffer by default which is smaller and faster
252 to clear than a 32-bit buffer but not as accurate.
253 If you need a deeper you can modify the parameters to
254 <code> glXChooseVisual</code> in your code.
255 </p>
256
257
258 <h2>3.3 Why Isn't depth buffering working at all?</h2>
259 <p>
260 Be sure you're requesting a depth buffered-visual. If you set the MESA_DEBUG
261 environment variable it will warn you about trying to enable depth testing
262 when you don't have a depth buffer.
263 </p>
264 <p>Specifically, make sure <code>glutInitDisplayMode</code> is being called
265 with <code>GLUT_DEPTH</code> or <code>glXChooseVisual</code> is being
266 called with a non-zero value for GLX_DEPTH_SIZE.
267 </p>
268 <p>This discussion applies to stencil buffers, accumulation buffers and
269 alpha channels too.
270 </p>
271
272
273 <h2>3.4 Why does glGetString() always return NULL?</h2>
274 <p>
275 Be sure you have an active/current OpenGL rendering context before
276 calling glGetString.
277 </p>
278
279
280 <h2>3.5 GL_POINTS and GL_LINES don't touch the right pixels</h2>
281 <p>
282 If you're trying to draw a filled region by using GL_POINTS or GL_LINES
283 and seeing holes or gaps it's because of a float-to-int rounding problem.
284 But this is not a bug.
285 See Appendix H of the OpenGL Programming Guide - "OpenGL Correctness Tips".
286 Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
287 will fix the problem.
288 </p>
289
290 <br>
291 <br>
292
293
294 <a name="part4">
295 </a><h1><a name="part4">4. Developer Questions</a></h1>
296
297 <h2><a name="part4">4.1 How can I contribute?</a></h2>
298 <p>
299 <a name="part4">First, join the Mesa3d-dev mailing list. That's where Mesa development
300 is discussed.
301 </a></p>
302 <p>
303 <a name="part4">The </a><a href="http://www.opengl.org/developers/documentation/specs.html">
304 OpenGL Specification</a> is the bible for OpenGL implemention work.
305 You should read it.
306 </p>
307 <p>Most of the Mesa development work involves implementing new OpenGL
308 extensions, writing hardware drivers (for the DRI), and code optimization.
309 </p>
310
311 <h2>4.2 How do I write a new device driver?</h2>
312 <p>
313 Unfortunately, writing a device driver isn't easy.
314 It requires detailed understanding of OpenGL, the Mesa code, and your
315 target hardware/operating system.
316 3D graphics are not simple.
317 </p>
318 <p>
319 The best way to get started is to use an existing driver as your starting
320 point.
321 For a software driver, the X11 and OSMesa drivers are good examples.
322 For a hardware driver, the Radeon and R200 DRI drivers are good examples.
323 </p>
324 <p>The DRI website has more information about writing hardware drivers.
325 The process isn't well document because the Mesa driver interface changes
326 over time, and we seldome have spare time for writing documentation.
327 That being said, many people have managed to figure out the process.
328 </p>
329 <p>
330 Joining the appropriate mailing lists and asking questions (and searching
331 the archives) is a good way to get information.
332 </p>
333
334
335 </body>
336 </html>