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