Clone of mesa.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

faq.html 11KB

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