Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

faq.html 11KB

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