home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 5 / MA_Cover_5.iso / ppc / mesa / readme < prev    next >
Encoding:
Text File  |  1998-01-31  |  38.1 KB  |  1,009 lines

  1.  
  2.                                  Mesa 2.5
  3.  
  4.                      Copyright (C) 1995-1997  Brian Paul
  5.  
  6.  
  7.  
  8. Disclaimer
  9. ==========
  10.  
  11. Mesa is a 3-D graphics library with an API which is very similar to that
  12. of OpenGL*.  To the extent that Mesa utilizes the OpenGL command syntax
  13. or state machine, it is being used with authorization from Silicon Graphics,
  14. Inc.  However, the author makes no claim that Mesa is in any way a
  15. compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
  16. Those who want a licensed implementation of OpenGL should contact a licensed
  17. vendor.  This software is distributed under the terms of the GNU Library
  18. General Public License, see the LICENSE file for details.
  19.  
  20. * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
  21.  
  22.  
  23.  
  24. Author
  25. ======
  26.  
  27. Brian Paul
  28. Avid Technology
  29. 6400 EnterPrise Lane, Suite 201
  30. Madison, WI  53719
  31.  
  32. brianp@elastic.avid.com
  33.  
  34. Formerly employed at the Space Science and Engineering Center at the
  35. University of Wisconsin - Madison.
  36.  
  37.  
  38.  
  39. Introduction
  40. ============
  41.  
  42. While Mesa uses the OpenGL API and mimics its semantics, it is
  43. important to understand that Mesa is not a real implementation of OpenGL
  44. since it is not licensed and has not been tested by the OpenGL conformance
  45. tests.  That said, Mesa is still a viable alternative to OpenGL.
  46.  
  47. Since version 2.0 Mesa implements the OpenGL 1.1 API specification.
  48. Only a few features are not yet implemented:
  49.  
  50.     trimmed NURBS
  51.     line and polygon antialiasing
  52.     glGetPolygonStipple function
  53.     glGetTexImage
  54.  
  55.  
  56. The primary design goal of this library has been correctness.  Common
  57. code paths are optimized for speed.  If you find that a particular
  58. rendering operation is slow let me know about it.  It may be a simple
  59. matter to optimize the operation in question.
  60.  
  61. I've been working on this library in my spare time since August, 1993.
  62. The core library was originally written on an Amiga using the DCC compiler.
  63. Later, development was moved to an SGI workstation.  Current development
  64. is done on SGI and PC/Linux systems.
  65.  
  66. Mesa works on most Unix workstations with ANSI C and X11.  There are also
  67. drivers for Amiga, Microsoft Windows, Macintosh, MS DOS, NeXT, and BeOS
  68. systems.  Look below for more information.
  69.  
  70. Since the OpenGL API is used, OpenGL documentation can serve as the
  71. documentation for Mesa's core functions.  Here are a few sources:
  72.  
  73.   WWW Center:   http://www.sgi.com/Technology/openGL/
  74.   Man pages:    http://www.digital.com:80/pub/doc/opengl/
  75.   Spec doc:     http://www.sgi.com/Technology/openGL/glspec/glspec.html
  76.  
  77.  
  78.  
  79. Getting the software
  80. ====================
  81.  
  82. The primary Mesa ftp site is iris.ssec.wisc.edu in the pub/Mesa directory.
  83. Mesa is also mirrored on sunsite in the directory pub/packages/development
  84. /graphics/mesa.
  85.  
  86. As of version 2.3, Mesa is distributed in two pieces:  main library code
  87. and demos.  If you're upgrading from a previous version of Mesa or you're not
  88. interested in the demos you can just download the core Mesa archive file.
  89.  
  90. Mesa is available in three archive formats:
  91.  
  92. 1. GNU zip/tar
  93.  
  94.     Download MesaLib-2.5.tar.gz and optionally MesaDemos-2.5.tar.gz
  95.     Unpack with:
  96.         gzcat MesaLib-2.5.tar.gz | tar xf -
  97.         gzcat MesaDemos-2.5.tar.gz | tar xf -
  98.  
  99. 2. Unix compressed/tar
  100.  
  101.     Download MesaLib-2.5.tar.Z and optionally MesaDemos-2.5.tar.Z
  102.     Unpack with:
  103.         zcat MesaLib-2.5.tar.Z | tar xf -
  104.         zcat MesaDemos-2.5.tar.Z | tar xf -
  105.  
  106. 3. ZIP format
  107.  
  108.     Download MesaLib-2.5.zip and optionally MesaDemos-2.5.zip
  109.     Unpack with:
  110.         unzip MesaLib-2.5.zip
  111.         unzip MesaDemos-2.5.zip
  112.  
  113.  
  114. After unpacking you should have the following files in the new Mesa-2.5
  115. directory:
  116.  
  117. README        - this file
  118. README.3DFX    - instructions for using Mesa with 3Dfx Glide library
  119. README.AMIWIN    - instructions for using Mesa on Amigas with AmiWin (X11)
  120. README.BEOS    - instructions for using Mesa with BeOS
  121. README.DOS    - instructions for using Mesa with MS-DOS
  122. README.LYNXOS    - instructions for using Mesa with LynxOS
  123. README.MGL    - instructions for using Mesa with SciTech's MGL library
  124. README.NEXT    - instructions for using Mesa with NeXT
  125. README.OS2    - instructions for using Mesa with OS/2 and XFree86
  126. README.VIRGE    - instructions for using Mesa with S3/Virge w/ Windows 95
  127. README.VMS    - instructions for using Mesa with VMS
  128. README.WIN    - instructions for using Mesa with Microsoft Windows 95/NT
  129. LICENSE        - the GNU library license
  130. IAFA-PACKAGE    - description file
  131. VERSIONS    - version history
  132. RELNOTES    - version-specific release notes
  133. FUTURE        - future development plans/ideas
  134. Makefile    - top-level Makefile
  135. Make-config    - system configurations used by the Makefiles
  136. Imakefile    - for OS/2
  137. mklib.*        - shell scripts for making shared libraries for some systems
  138. include/    - client include files
  139. lib/        - client libraries, created during installation
  140. src/        - source code for core library
  141. src-glu/    - source code for utility library
  142. src-glut/    - source code for GLUT toolkit
  143. util/        - handly utility functions
  144. widgets-mesa/    - Mesa widgets for Xt/Motif
  145. widgets-sgi/    - SGI OpenGL widgets for Xt/Motif
  146. windows/    - Microsoft Windows driver stuff, from Mesa 1.2.x
  147. gdemos/        - GLUT demos
  148. NeXT/        - NeXT demo programs
  149. BeOS/        - BeOS demo programs
  150. mondello/    - Cirrus Logic Mondello 3-D accelerator code
  151. *mms*        - makefiles for VMS
  152. OpenStep/    - OpenStep files
  153.  
  154. and if you downloaded and unpacked the demos:
  155.  
  156. src-tk/        - source code for tk library
  157. src-aux/    - source code for aux library
  158. demos/        - demo programs
  159. samples/    - sample OpenGL programs from SGI
  160. book/        - example programs from the OpenGL Programming Guide
  161. 3Dfx/        - 3Dfx demos and GLUT
  162.  
  163.  
  164. Other Mesa-related stuff is at  ftp://iris.ssec.wisc.edu/pub/Mesa/contrib/
  165.  
  166.  
  167.  
  168. GLUT
  169. ====
  170.  
  171. Mesa 2.5 and later includes Mark Kilgard's GLUT library (GL Utility Toolkit).
  172. GLUT is built automatically on systems which support it.
  173.  
  174. The GLUT tests, demos, examples, etc are not included, just the main library.
  175. To obtain the latest complete release of GLUT please visit
  176. http://reality.sgi.com/employees/mjk_asd/glut3/glut3.html
  177.  
  178.  
  179.  
  180. Installation for Unix/X11
  181. =========================
  182.  
  183. To compile the library, first type 'make' alone to see the list of system
  184. configurations currently supported.  If you see your configuration on the
  185. list, type 'make <config>'.  Most popular Unix/X workstations are currently
  186. supported.
  187.  
  188. The top-level makefile will execute the makefiles in a number of sub-
  189. directories.  When finished, the Mesa libraries will be in the Mesa-2.5/lib/
  190. directory.  A few GLUT demos in the gdemos/ directory should be ready to run.
  191.  
  192. If you also downloaded and unpacked the demos there should be executables
  193. in the "demos/", "samples/", and "book/" directories for you to try out.
  194. If you only want to compile the contents of one subdirectory you can 'cd'
  195. to that directory and type 'make <config>' there.
  196.  
  197. If your system configuration is not listed by 'make', you'll have to modify
  198. the top-level Makefile and Make-config files.  There are instructions in
  199. each file.
  200.  
  201. If you have compilation problems you should try to fix them and return the
  202. patches to the author.
  203.  
  204.  
  205. Header and library files:
  206.    After you've compiled Mesa and tried the demos I recommend the following
  207.    procedure for "installing" Mesa.
  208.  
  209.    Copy the Mesa include/GL directory to /usr/local/include:
  210.     cp -r include/GL /usr/local/include
  211.  
  212.    Copy the Mesa library files to /usr/local/lib:
  213.     cp lib/* /usr/local/lib
  214.  
  215.     (actually, use "cp -d" on Linux to preserve symbolic links)
  216.  
  217.    Create a few symbolic links so that compiling OpenGL applications is easy:
  218.     cd /usr/local/lib
  219.     IF USING STATIC (lib*.a) FILES THEN
  220.         ln -s libMesaGL.a libGL.a
  221.         ln -s libMesaGLU.a libGLU.a
  222.     ELSE
  223.         ln -s libMesaGL.so libGL.so
  224.         ln -s libMesaGLU.so libGLU.so
  225.     ENDIF
  226.  
  227.  
  228. Xt/Motif widgets:
  229.    If you want to use Mesa or OpenGL in your Xt/Motif program you can build
  230.    the widgets found in either the widgets-mesa or widgets-sgi directories.
  231.    The former were written for Mesa and the later are the original SGI
  232.    widgets.  Look in those directories for more information.
  233.  
  234.  
  235. Notes:
  236.    HP users:  a Mesa user reports that the HP-UX 10.01 C compiler has
  237.    a bug which effects glReadPixels.  A patch for the compiler (PHSS_5743) is
  238.    available.  Otherwise be sure your compiler is version 10.13 or later.
  239.  
  240.    QNX users:  if you have problems running the demos try setting the
  241.    stack size to 200K or larger with -N200K, for example.
  242.  
  243.    SunOS 5.x users:  The X shared memory extension may not work
  244.    correctly.  If Mesa prints an error message to the effect of "Shared memory
  245.    error" then you'll have to append the following three lines to the end of
  246.    your /etc/system file then reboot:
  247.       set shmsys:shminfo_shmmax = 0x2000000
  248.       set shmsys:shminfo_shmmni = 0x1000
  249.       set shmsys:shminfo_shmseg = 0x100
  250.  
  251.  
  252.  
  253. Installation for Amigas
  254. =======================
  255.  
  256. See http://www.efd.lth.se/~d94sz/amesa for the latest version of the Amiga
  257. driver.
  258.  
  259.  
  260.  
  261. Installation for Microsoft Windows
  262. ==================================
  263.  
  264. See the windows/README file for more information.
  265.  
  266.  
  267.  
  268. Installation for Macintosh
  269. ==========================
  270.  
  271. See http://www.elte.hu/~boga/Mesa.html for the latest info.
  272.  
  273.  
  274.  
  275. Installation for NeXT
  276. =====================
  277.  
  278. Simply typing "make next" should compile Mesa and a number of NeXT demo
  279. programs found in the NeXT/ directory.  The NeXT driver is implemented
  280. through Mesa's Off-Screen rendering interface.
  281.  
  282.  
  283.  
  284. Installation for BeOS
  285. =====================
  286.  
  287. Simply typing "make beos" should compile Mesa and a number of BeOS demo
  288. programs found in the BeOS/ directory.  The BeOS driver is implemented
  289. through Mesa's Off-Screen rendering interface.
  290.  
  291.  
  292.  
  293. Installation for OS/2
  294. =====================
  295.  
  296. *** Mesa 2.x does not currently work on OS/2 ***
  297.  
  298. See the README.OS2 file for details.
  299.  
  300.  
  301.  
  302. Installation for VMS
  303. ====================
  304.  
  305. See the README.VMS file for more information.
  306.  
  307.  
  308.  
  309. Installation for MS-DOS (optionally with DJGPP)
  310. ===============================================
  311.  
  312. See the README.DOS file for more information.
  313.  
  314.  
  315.  
  316. Installation for OpenStep
  317. =========================
  318.  
  319. See the OpenStep/README file for more information.
  320.  
  321.  
  322.  
  323. Installation for 3Dfx VooDoo/Rush hardware
  324. ==========================================
  325.  
  326. See the README.3DFX file and look in the 3Dfx/ subdirectory.
  327.  
  328.  
  329. Installation for S3/Virge driver on Windows 95
  330. ==============================================
  331.  
  332. See the README.VIRGE file.
  333.  
  334.  
  335.  
  336. Using the library
  337. =================
  338.  
  339. Configuration options:
  340.    The file src/config.h has many parameters which you can adjust such
  341.    as maximum number of lights, clipping planes, maximum texture size,
  342.    etc.  In particular, you may want to change DEPTH_BITS from 16 to 32
  343.    if a 16-bit depth buffer isn't precise enough for your application.
  344.  
  345.  
  346. Shared libraries:
  347.    If you compile shared libraries you may have to set an environment
  348.    variable to specify where the Mesa libraries are located.  On Linux and
  349.    Sun systems for example, set the LD_LIBRARY_PATH variable to include
  350.    /your-dir/Mesa-2.5/lib.   Otherwise, when you try to run a demo it
  351.    may fail with a message saying that one or more libraries couldn't be
  352.    found.
  353.  
  354.  
  355. Remote display of OpenGL/GLX programs:
  356.    As of version 1.2.3, Mesa's header files use the same GLenum and GLUenum
  357.    values as SGI's (and most/all other vendor's) OpenGL headers.  This means
  358.    you can freely mix object files compiled with OpenGL or Mesa headers.
  359.    In fact, on systems with dynamic runtime linkers it's possible to dynam-
  360.    ically link with Mesa or OpenGL shared libraries at runtime, without
  361.    recompiling or relinking anything!
  362.  
  363.    Using IRIX 5.x as an example, you can run SGI's OpenGL demos with the
  364.    Mesa shared libraries as follows.  Let's assume you're installing Mesa
  365.    in /usr/local/Mesa and using the C-shell:
  366.        % cd /usr/local/Mesa
  367.        % make irix5-dso
  368.        % cd lib
  369.        % ln -s libMesaGL.so libGL.so
  370.        % setenv _RLD_LIST "/usr/local/Mesa/lib/libGL.so:DEFAULT"
  371.        % /usr/demos/bin/ideas_ogl      // this is a test
  372.  
  373.    You can now run OpenGL executables on almost any X display!  There may
  374.    be some problems from the fact that Mesa supports many X visual types
  375.    that an OpenGL client may not expect (grayscale for example).  In this
  376.    case the application may abort, print error messages, or just behave
  377.    strangely.  You may have to experiment with the MESA_RGB_VISUAL envi-
  378.    ronment variable.
  379.  
  380.  
  381. Toolkits (X11 only):
  382.    Mesa includes the glaux and gltk libraries from SGI.  Their only real
  383.    use is for writing simple demo programs.  It is highly recommended that
  384.    you do _not_ use these libraries for your own programs.  There are
  385.    several alternatives:
  386.  
  387.       1. GLUT (OpenGL Utility Toolkit) was written by Mark Kilgard of SGI
  388.       as a replacement for glaux and gltk.  It provides a simple, portable,
  389.       window-system independent interface allowing you to write OpenGL
  390.       applications quickly and easily.  GLUT isn't included with Mesa but
  391.       you'll find instructions on how to get and build GLUT in the file
  392.       README.GLUT.  The second edition of the OpenGL Programming Guide,
  393.       published by Addison Wesley uses GLUT instead of the glaux library.
  394.  
  395.       2. Use an Xt/Motif widget.  Look in the widgets-old/ or widgets-sgi
  396.       directories for more info.
  397.  
  398.       3. If you use Tcl/Tk you should consider Togl.  See
  399.       http://www.ssec.wisc.edu/~brianp/Togl.html for more information.
  400.  
  401.       4. Use the GLX (simulated since Mesa doesn't implement the GLX proto-
  402.       col) functions.  These functions look like, and try to act like, the
  403.       real GLX functions used by OpenGL in conjunction with the X window
  404.       system.
  405.  
  406.  
  407. Performance tips:
  408.    1. Turn off smooth shading when you don't need it (glShadeModel)
  409.    2. Turn off depth buffering when you don't need it.
  410.    3. Turn off dithering when not needed.
  411.    4. Use double buffering as it's often faster than single buffering
  412.    5. Compile in the X Shared Memory extension option if it's supported
  413.       on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for
  414.       your system in the Make-config file.
  415.    6. Recompile Mesa with more optimization if possible.
  416.    7. Try to maximize the amount of drawing done between glBegin/glEnd pairs.
  417.    8. Use the MESA_BACK_BUFFER variable to find best performance in double
  418.       buffered mode.  (X users only)
  419.    9. Optimized polygon rasterizers are employed when:
  420.          rendering into back buffer which is an XImage
  421.          RGB mode, not grayscale, not monochrome
  422.          depth buffering is GL_LESS, or disabled
  423.          flat or smooth shading
  424.          dithered or non-dithered
  425.          no other rasterization operations enabled (blending, stencil, etc)
  426.   10. Optimized line drawing is employed when:
  427.          rendering into back buffer which is an XImage
  428.          RGB mode, not grayscale, not monochrome
  429.          depth buffering is GL_LESS or disabled
  430.          flat shading
  431.          dithered or non-dithered
  432.          no other rasterization operations enabled (blending, stencil, etc)
  433.   11. Textured polygons are fastest when:
  434.          using a 3-component (RGB), 2-D texture
  435.          minification and magnification filters are GL_NEAREST
  436.          texture coordinate wrap modes for S and T are GL_REPEAT
  437.          GL_DECAL environment mode
  438.          glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST )
  439.          depth buffering is GL_LESS or disabled
  440.   12. Lighting is fastest when:
  441.          Two-sided lighting is disabled
  442.          GL_LIGHT_MODEL_LOCAL_VIEWER is false
  443.          GL_COLOR_MATERIAL is disabled
  444.          No spot lights are used (all GL_SPOT_CUTOFFs are 180.0)
  445.          No local lights are used (all position W's are 0.0)
  446.          All material and light coefficients are >= zero
  447.   13. XFree86 users:  if you want to use 24-bit color try starting your
  448.       X server in 32-bit per pixel mode for better performance.  That is,
  449.       start your X server with
  450.          startx -- -bpp 32
  451.       instead of
  452.          startx -- -bpp 24
  453.   14. Try disabling dithering with the MESA_NO_DITHER environment variable.
  454.       If this env var is defined Mesa will disable dithering and the
  455.       command glEnable(GL_DITHER) will be ignored.
  456.  
  457.  
  458. Debugging:
  459.    Normally Mesa records but does not notify the user of errors.  It is up
  460.    to the application to call glGetError to check for errors.  Mesa supports
  461.    an environment variable, MESA_DEBUG, to help with debugging.  If MESA_DEBUG
  462.    is defined, a message will be printed to stdout whenever an error occurs.
  463.  
  464.    More extensive error checking is done when Mesa is compiled with the
  465.    DEBUG symbol defined.  You'll have to edit the Make-config file and
  466.    add -DDEBUG to the CFLAGS line for your system configuration.  You may
  467.    also want to replace any optimization flags with the -g flag so you can
  468.    use your debugger.  After you've edited Make-config type 'make clean'
  469.    before recompiling.
  470.  
  471.    In your debugger you can set a breakpoint in gl_error() to trap Mesa
  472.    errors.
  473.  
  474.    There is a display list printing/debugging facility.  See the end of
  475.    src/dlist.c for details.
  476.  
  477.  
  478. X Display Modes:
  479.    Mesa supports rendering in most X visual types and depths.  When a
  480.    TrueColor or DirectColor visual isn't available dithering is used in RGB
  481.    mode.
  482.  
  483.    The glXChooseVisual function tries its best to pick an appropriate visual
  484.    for the given attribute list.  However, if this doesn't suit your needs
  485.    you can force Mesa to use any X visual you want (any supported by your
  486.    X server that is) by setting the MESA_RGB_VISUAL and MESA_CI_VISUAL
  487.    environment variables.  When an RGB visual is requested, glXChooseVisual
  488.    will first look if the MESA_RGB_VISUAL variable is defined.  If so, it
  489.    will try to use the specified visual.  Similarly, when a color index
  490.    visual is requested, glXChooseVisual will look for the MESA_CI_VISUAL
  491.    variable.
  492.  
  493.    The format of accepted values is:  <visual-class> <depth>
  494.    Here are some examples:
  495.  
  496.    using the C-shell:
  497.     % setenv MESA_RGB_VISUAL "TrueColor 8"        // 8-bit TrueColor
  498.     % setenv MESA_CI_VISUAL "PseudoColor 12"    // 12-bit PseudoColor
  499.     % setenv MESA_RGB_VISUAL "PseudoColor 8"    // 8-bit PseudoColor
  500.  
  501.    using the KornShell:
  502.     $ export MESA_RGB_VISUAL="TrueColor 8"
  503.     $ export MESA_CI_VISUAL="PseudoColor 12"
  504.     $ export MESA_RGB_VISUAL="PseudoColor 8"
  505.  
  506.  
  507. Double buffering (X11 only):
  508.    Mesa can use either an X Pixmap or XImage as the backbuffer when in
  509.    double buffer mode.  Using GLX, the default is to use an XImage.  The
  510.    MESA_BACK_BUFFER environment variable can override this.  The valid
  511.    values for MESA_BACK_BUFFER are:  Pixmap and XImage (only the first
  512.    letter is checked, case doesn't matter).
  513.  
  514.    A pixmap is faster when drawing simple lines and polygons while an
  515.    XImage is faster when Mesa has to do pixel-by-pixel rendering.  If you
  516.    need depth buffering the XImage will almost surely be faster.  Exper-
  517.    iment with the MESA_BACK_BUFFER variable to see which is faster for
  518.    your application.  
  519.  
  520.  
  521. Colormaps (X11 only):
  522.    When using Mesa directly or with GLX, it's up to the application writer
  523.    to create a window with an appropriate colormap.  The aux, tk, and GLUT
  524.    toolkits try to minimize colormap "flashing" by sharing colormaps when
  525.    possible.  Specifically, if the visual and depth of the window matches
  526.    that of the root window, the root window's colormap will be shared by
  527.    the Mesa window.  Otherwise, a new, private colormap will be allocated.
  528.  
  529.    When sharing the root colormap, Mesa may be unable to allocate the colors
  530.    it needs, resulting in poor color quality.  This can happen when a
  531.    large number of colorcells in the root colormap are already allocated.
  532.    To prevent colormap sharing in aux, tk and GLUT, define the environment
  533.    variable MESA_PRIVATE_CMAP.  The value isn't significant.
  534.  
  535.  
  536. Fortran bindings:
  537.    Fortan bindings are no longer included with Mesa.  William F. Mitchell
  538.    (william.mitchell@nist.gov) has developed a new set of Mesa/OpenGL and
  539.    GLUT bindings for Fortran.  See http://math.nist.gov/f90gl for more
  540.    information.
  541.  
  542.  
  543. Gamma correction (X11 only):
  544.    To compensate for the nonlinear relationship between pixel values
  545.    and displayed intensities, there is a gamma correction feature in
  546.    Mesa.  Some systems, such as Silicon Graphics, support gamma
  547.    correction in hardware (man gamma) so you won't need to use Mesa's
  548.    gamma facility.  Other systems, however, may need gamma adjustment
  549.    to produce images which look correct.  If in the past you thought
  550.    Mesa's images were too dim, read on.
  551.  
  552.    Gamma correction is controlled with the MESA_GAMMA environment
  553.    variable.  Its value is of the form "Gr Gg Gb" or just "G" where
  554.    Gr is the red gamma value, Gg is the green gamma value, Gb is the
  555.    blue gamma value and G is one gamma value to use for all three
  556.    channels.  Each value is a positive real number typically in the
  557.    range 1.0 to 2.5.  The defaults are all 1.0, effectively disabling
  558.    gamma correction.  Examples using csh:
  559.  
  560.     % setenv MESA_GAMMA "2.3 2.2 2.4"    // separate R,G,B values
  561.     % setenv MESA_GAMMA "2.0"        // same gamma for R,G,B
  562.  
  563.    The demos/gamma.c program may help you to determine reasonable gamma
  564.    value for your display.  With correct gamma values, the color intensities
  565.    displayed in the top row (drawn by dithering) should nearly match those
  566.    in the bottom row (drawn as grays).
  567.  
  568.    Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well
  569.    on HP displays using the HP-ColorRecovery technology.
  570.  
  571.    Mesa implements gamma correction with a lookup table which translates
  572.    a "linear" pixel value to a gamma-corrected pixel value.  There is a
  573.    small performance penalty.  Gamma correction only works in RGB mode.
  574.    Also be aware that pixel values read back from the frame buffer will
  575.    not be "un-corrected" so glReadPixels may not return the same data
  576.    drawn with glDrawPixels.
  577.  
  578.    For more information about gamma correction see:
  579.    http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html
  580.  
  581.  
  582. Off-screen rendering:
  583.    Mesa 1.2.4 introduced off-screen rendering, a facility for generating
  584.    3-D imagery without having to open a window on your display.  Mesa's
  585.    simple off-screen rendering interface is completely operating system
  586.    and window system independent so programs which use off-screen rendering
  587.    should be very portable.  This new feature effectively enables you to
  588.    use Mesa as an off-line, batch-oriented renderer.
  589.  
  590.    The "OSMesa" API provides 3 functions for making off-screen renderings:
  591.    OSMesaCreateContext(), OSMesaMakeCurrent(), and OSMesaDestroyContext().
  592.    See the Mesa/include/GL/osmesa.h header for more information.  See the
  593.    demos/osdemo.c file for an example program.   There is no facility for
  594.    writing images to files.
  595.  
  596.    If you want to generate large images (larger than 1280x1024) you'll
  597.    have to edit the src/config.h file to change MAX_WIDTH and MAX_HEIGHT
  598.    then recompile Mesa.  Image size should only be limited by available
  599.    memory.
  600.  
  601.  
  602. Profiling:
  603.    Mesa 1.2.6 introduced a simple profiling facility.  It counts and
  604.    measures the time spent in a number of important rendering operations
  605.    and prints the information in a report before your program exits.
  606.  
  607.    By default, profiling is disabled.  To enable it, add -DPROFILE to
  608.    the appropriate CFLAGS entry in the Make-config file, then recompile
  609.    Mesa.  In general, you should only enable profiling during program
  610.    development to gain insight into Mesa's performance.  Mesa runs a bit
  611.    slower when profiling is enabled because it requires frequent polling
  612.    of the system clock.
  613.  
  614.    The profiling report will be printed when glXDestroyContext is called
  615.    _if_ the MESA_PROFILE environment variable is set.  You must be sure
  616.    glXDestroyContext is called before exiting to get the profile report.
  617.    The report will be printed to stdout and includes:
  618.  
  619.       glBegin/glEnd - number of glBegin/glEnd pairs called, total time,
  620.          and rate in pairs/second.
  621.       vertexes transformed - number of vertices transformed, lit, clip-
  622.          tested, fogged, and mapped to window coordinates, total time,
  623.          and rate in vertexes/second.
  624.       points rasterized - number of points drawn, time, and rate.
  625.       lines rasterized - number of lines drawn, time, and rate.
  626.       polygons rasterized - number of polygons drawn, time and rate.
  627.       overhead - time between glBegin/glEnd not accounted for by vertexes,
  628.          points, lines, and polygons.  This is time spent executing
  629.          glVertex, glNormal, glColor, etc, clipping, primitive assembly,
  630.          and user code between glBegin/glEnd.
  631.       glClear - number of glClears executed, total time and clears/second.
  632.       SwapBuffers - number of swaps executed, total time and swaps/second.
  633.  
  634.    Note that the real point, line, and polygon rates should be computed by
  635.       adding in the vertex transformation and overhead time factors.
  636.  
  637.  
  638. Linux SVGA driver:
  639.    Mesa 1.2.6 has a preliminary Linux SVGA driver for Mesa.  It's based
  640.    on the SVGA library included with Linux.  The driver isn't finished
  641.    yet.  I'm not too familiar with SVGA graphics so I could use some help
  642.    finishing it.  Contact Brian if you want to help.
  643.  
  644.    To enable the SVGA driver, edit the Make-config file and add -DSVGA to
  645.    the CFLAGS for Linux and add -lvga to the LIBS variable.  There are
  646.    several test programs (vtest.c, vgears.c, vindex.c) in the demos
  647.    directory.  See the include/GL/svgamesa.h and src/svgamesa.c files for
  648.    more information about the driver.
  649.  
  650.  
  651. Extensions:
  652.    The following OpenGL extensions are currently implemented:
  653.  
  654.       GL_EXT_blend_color - allows blending with a constant color
  655.       GL_EXT_blend_minmax - blend min/max operator
  656.       GL_EXT_blend_logic_op - allows glLogicOp to work in RGBA mode
  657.       GL_EXT_blend_subtract - blend subtraction operator
  658.       GL_EXT_vertex_array - vertex array extension
  659.       GL_EXT_paletted_texture - for color indexed textures
  660.       GL_EXT_shared_texture_palette - shared texture palette
  661.       GLX_EXT_visual_info - GLX visual and transparent pixel extension
  662.  
  663.    For detailed information about the extensions see:
  664.       ftp://sgigate.sgi.com/pub/opengl/extensions/
  665.  
  666.    There are four Mesa-specific GL/GLX extensions at this time.
  667.  
  668.    GLX_MESA_pixmap_colormap 
  669.  
  670.       This extension adds the GLX function:
  671.  
  672.          GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
  673.                                            Pixmap pixmap, Colormap cmap )
  674.  
  675.       It is an alternative to the standard glXCreateGLXPixmap() function.
  676.       Since Mesa supports RGB rendering into any X visual, not just True-
  677.       Color or DirectColor, Mesa needs colormap information to convert RGB
  678.       values into pixel values.  An X window carries this information but a
  679.       pixmap does not.  This function associates a colormap to a GLX pixmap.
  680.       See the demos/glxpixmap.c file for an example of how to use this
  681.       extension.
  682.  
  683.    GLX_MESA_release_buffers
  684.  
  685.       Mesa associates a set of ancillary (depth, accumulation, stencil and
  686.       alpha) buffers with each X window it draws into.  These ancillary
  687.       buffers are allocated for each X window the first time the X window
  688.       is passed to glXMakeCurrent().  Mesa, however, can't detect when an
  689.       X window has been destroyed in order to free the ancillary buffers.
  690.  
  691.       The best it can do is to check for recently destroyed windows whenever
  692.       the client calls the glXCreateContext() or glXDestroyContext()
  693.       functions.  This may not be sufficient in all situations though.
  694.  
  695.       The GLX_MESA_release_buffers extension allows a client to explicitly
  696.       deallocate the ancillary buffers by calling glxReleaseBuffersMESA()
  697.       just before an X window is destroyed.  For example:
  698.  
  699.          #ifdef GLX_MESA_release_buffers
  700.             glXReleaseBuffersMESA( dpy, window );
  701.          #endif
  702.          XDestroyWindow( dpy, window );
  703.  
  704.       This extension is new in Mesa 2.0.
  705.  
  706.    GL_MESA_window_pos
  707.  
  708.       This extension adds the glWindowPos*MESA() functions.  These functions
  709.       are convenient alternatives to glRasterPos*() because they set the
  710.       current raster position to a specific window coordinate, bypassing the
  711.       usual modelview, projection and viewport transformations.  This is
  712.       especially useful for setting the position for glDrawPixels() or
  713.       glBitmap() to a specific window coordinate.
  714.  
  715.       X and Y parameters (positive and negative) are directly mapped to
  716.       window coordinates.  Z is a depth value clamped to the range [0,1].
  717.       W is directly mapped.  The current raster position valid flag is
  718.       always set to true.  The current raster distance is set to zero.
  719.       The current raster color and texture coordinate are updated in the
  720.       same manner as glRasterPos().  In selection mode a hit record is
  721.       always generated.
  722.  
  723.       Programs using OpenGL, not Mesa, may also use the glWindowPos*MESA()
  724.       functions by including winpos.h from the src directory and by
  725.       compiling and linking with the winpos.c file from the src directory.
  726.  
  727.    GL_MESA_resize_buffers
  728.  
  729.       This extension adds the glResizeBuffersMESA() function.  When this
  730.       function is called, Mesa checks if the color buffer (window) has
  731.       been resized.  If it has, Mesa reallocates the ancillary (depth,
  732.       stencil, accum) buffers.
  733.  
  734.       Normally, Mesa checks for window size changes whenever glViewport()
  735.       is called.  In some applications it may not be appropriate to call
  736.       glViewport() when the window is resized.  Such applications should
  737.       call glResizeBuffersMESA() instead so the ancillary buffers are
  738.       correctly updated.
  739.  
  740.       This extension is new in version 2.2.
  741.  
  742.  
  743. Version 2.x features:
  744.    Version 2.x of Mesa implements the OpenGL 1.1 API.  The following
  745.    functions are new in Mesa 2.x:
  746.  
  747.    Texture mapping:
  748.     glAreTexturesResident
  749.     glBindTexture
  750.     glCopyTexImage1D
  751.     glCopyTexImage2D
  752.     glCopyTexSubImage1D
  753.     glCopyTexSubImage2D
  754.     glDeleteTextures
  755.     glGenTextures
  756.     glIsTexture
  757.     glPrioritizeTextures
  758.     glTexSubImage1D
  759.     glTexSubImage2D
  760.  
  761.    Vertex Arrays:
  762.     glArrayElement
  763.     glColorPointer
  764.     glDrawElements
  765.     glEdgeFlagPointer
  766.     glIndexPointer
  767.     glInterleavedArrays
  768.     glNormalPointer
  769.     glTexCoordPointer
  770.     glVertexPointer
  771.  
  772.    Client state management:
  773.     glDisableClientState
  774.     glEnableClientState
  775.     glPopClientAttrib
  776.     glPushClientAttrib
  777.  
  778.    Misc:
  779.     glGetPointer
  780.     glIndexub
  781.     glIndexubv
  782.     glPolygonOffset
  783.  
  784.  
  785. Summary of environment variables:
  786.    MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
  787.    MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
  788.    MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
  789.    MESA_DEBUG - if defined, error messages are printed to stderr
  790.    MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only)
  791.    MESA_GAMMA - gamma correction coefficients (X only)
  792.    MESA_PROFILE - enable reporting of performance measurements
  793.    MESA_XSYNC - enable synchronous X behavior (for debugging only)
  794.    MESA_NO_DITHER - disable dithering, overriding glEnable(GL_DITHER)
  795.  
  796.  
  797.  
  798. Mailing List
  799. ============
  800.  
  801. There is a Mesa mailing list.  Its purpose is to let Mesa users exchange
  802. any ideas, questions, and/or problems they have.  To subscribe, send the
  803. following message to the address mesa-request@iqm.unicamp.br
  804.  
  805.     add yourname@your.internet.address mesa
  806.  
  807. For example:
  808.  
  809.     add brianp@elastic.avid.com mesa
  810.  
  811. You will receive a welcome message from the list server when you have been
  812. added to the list.
  813.  
  814. To unsubscribe from the list send the following message to
  815. mesa-request@iqm.unicamp.br
  816.  
  817.     del yourname@your.internet.address mesa
  818.  
  819. Thanks to Pedro Vazquez (vazquez@iqm.unicamp.br) for setting up and
  820. maintaing the list.
  821.  
  822.  
  823.  
  824. WWW Page
  825. ========
  826.  
  827. There is a Mesa WWW page:  http://www.ssec.wisc.edu/~brianp/Mesa.html
  828.  
  829.  
  830.  
  831. Contributed code
  832. ================
  833.  
  834. There is a contrib/ subdirectory on the Mesa ftp site which contains
  835. contributions from Mesa users.  See the README file in that directory for
  836. more information.
  837.  
  838. Anyone is welcome to contribute code to the Mesa project, provided you
  839. agree to the GNU license.
  840.  
  841. If you're contribution code to the Mesa library itself:
  842.    1. Try to write clean code (uniform indentation, comments, meaningful
  843.       identifiers, etc).  It must be readable and maintainable!
  844.    2. Test your code.  On several occations I've incorporated code from
  845.       users which later turned out to have bugs.  Now, I'm pretty hesitant
  846.       to use code which doesn't look good.
  847.  
  848. If you're contributing changes to Makefile or Make-config be sure your
  849. changes won't cause headaches for other users.  If you're not sure then
  850. maybe a new config target is appropriate.
  851.  
  852.  
  853.  
  854. Reporting Bugs
  855. ==============
  856.  
  857. If you think you've found a bug in Mesa first check if a newer version of
  858. Mesa is available.  Next, check ftp://iris.ssec.wisc.edu/pub/Mesa to see
  859. if a patch for your bug is there.  Otherwise, report the problem.
  860.  
  861. Since many people have contributed code to Mesa it's important that you
  862. report a bug to the right person:
  863.  
  864. Area            Contact
  865. ----------------------    -------------------------------------------
  866. GLU polygon tessellator    Bogdan Sikorski  bogdan@cira.it
  867. GLU NURBS        Bogdan Sikorski  bogdan@cira.it
  868. Evaluators        Bernd Barsuhn  bernd@berlin.muc.de
  869. Xt/Motif widgets    Thorsten Ohl  ohl@crunch.ikp.physik.th-darmstadt.de
  870.               and Jeroen van der Zijp  jvz@cyberia.cfdrc.com
  871. Fortran bindings    William Mitchell  william.mitchell@nist.gov
  872. Amiga driver        Stefan Zivkovic  d94sz@efd.lth.se
  873. Amiwin driver        Victor Ng-Thow-Hing  victorng@dgp.toronto.edu
  874. Macintosh driver    Miklos Fazekas  boga@augusta.elte.hu
  875. NeXT driver        Pascal Thibaudeau pthibaud@frbdx11.cribx1.u-bordeaux.fr
  876. OS/2 driver        Darren Abbott  abbott@hiwaay.net
  877. VMS support        Jouk Jansen  joukj@crys.chem.uva.nl
  878. Windows 95/NT driver    Li Wei  liwei@aiar.xjtu.edu.cn
  879. MS-DOS driver        Charlie Wallace  cwallace@dreamworks.com
  880. BeOS driver        Tinic Uro  5uro@informatik.uni-hamburg.de
  881. GLX encoder/decoder    Steven Parker  sparker@taz.cs.utah.edu
  882. 3Dfx driver        David Bucciarelli  tech.hmw@plus.it
  883. SciTech MGL driver    Kendall Bennett  KendallB@scitechsoft.com
  884. Cygnus Win32 support    Stephane Rehel  rehel@worldnet.fr
  885. S3 Virge driver        rkoduri@s3.com or pcgamedev@s3.com
  886. Mailing list help    Pedro Vazquez  vazquez@iqm.unicamp.br
  887.  
  888. EVERYTHING ELSE-->    Brian Paul  brianp@elastic.avid.com
  889.  
  890. Feel free to cc Brian on messages sent to anyone listed above.  None of
  891. the people on this list are under any obligation to respond to bug reports.
  892. However, they have been pretty helpful so far.
  893.  
  894. When you report a bug please give as much information as possible including
  895. your hardware/software environment, which version of Mesa you're using, how
  896. to reproduce the problem, and if possible, a test program.
  897.  
  898.  
  899.  
  900. Known Bugs
  901. ==========
  902.  
  903. 1. Evaluator automatic normal vectors are miscalculated under certain
  904.    conditions.
  905.  
  906. 2. glCopyPixels gives undefined results when source and destination regions
  907.    overlap and pixel zoom!=1.0.
  908.  
  909. 3. Mesa doesn't work too well on Crays.  The problem is that Crays do not
  910.    have the exact C data type sizes which Mesa's X driver relies on.  Better
  911.    Cray support may or may not be seen in the future.
  912.  
  913. 4. gluCylinder, and probably other GLU quadrics, don't generate texture
  914.    coordinates when drawing in point or line mode.
  915.  
  916. 5. NURBS code does not copy user supplied data as it should; it just
  917.    stores pointers to that data. For the moment all data must be valid and
  918.    available utill the gluEndSurface() or the gluEndCurve() call.
  919.  
  920.  
  921.  
  922. Future Plans
  923. ============
  924.  
  925. 1. Display list optimization:  scan for duplicate vertices and normals in
  926.    order to reduce number of transformations needed.
  927.  
  928. 2. Implement a "generational" depth buffer which only has to be cleared
  929.    once every 'n' frames.
  930.  
  931. 3. Integrate Mesa into the XFree86 X server.
  932.  
  933. 5. Reorganize src/ directory: put drivers in separate directories.
  934.  
  935.  
  936.  
  937. Why is it the library called Mesa?
  938. ==================================
  939.  
  940. Why not?  More obvious names were considered but had to be rejected:
  941. FreeGL (too similar to the trademarked name OpenGL), Free3D (too similar
  942. to DEC's Open3D).  Also, I'm tired of acronyms.
  943.  
  944. [I've recently discovered that at least two other software products use the
  945. name Mesa.  A name change may be necessary in the future.  Suggestions are
  946. welcome!]
  947.  
  948.  
  949.  
  950. Contributors
  951. ============
  952.  
  953. Many people have contributed to Mesa.  I really appreciate the help!
  954. Among the contributors are:
  955.  
  956. Erich Stefan Boleyn - for the glRotate code and testing early Mesa
  957. Joe Kiniry, Kendall Bennett - for opinions and discussion
  958. Marc Buffat - for the gluProject and gluUnproject functions
  959. Bernd Barsuhn, Volker Weiss - for the new implementation of evaluators
  960. Philip Brown - for the initial GLX, GLUT implementation
  961. Thorsten Ohl - for glXUseXFont() and glBitmap bug fixes
  962. Thomas Malik - for new invert_matrix and other xform.c code
  963. Michael Pichler - for X colormap code and numerous bug reports/fixes
  964. Thorsten Ohl, Jeroen van der Zijp - for the Xt/Motif widgets
  965. Bob Mercier - for the new 8-bit RGB dithering code
  966. Pedro Vazquez - for establishing the Mesa mailing list
  967. Bogdan Sikorski - for the GLU polygon tessellation code and NURBS
  968. Linas Vepstas - for his extrusion and swept surface library
  969. Frederic Devernay - for improved X shared memory support
  970. Asif Khan - for bringing _many_ subtle bugs to my attention
  971. Mark Peterson - for the MS Windows driver for Mesa
  972. Gene Lett and Kerris Renkin - for diagnosing several rasterization problems
  973. Alex De Bruyn - for HP Color Recovery display support
  974. Miklos Fazekas - for the Macintosh driver
  975. Frederic Devernay - for many Sun configs and lots of useful feedback
  976. Victor Ng-Thow-Hing - for the Amiga AmiWin port
  977. Bill Triggs - improved texture mapping features
  978. Martin Bernhard - added texture coordinate generation to GLU quadric functions
  979. Pascal Thibaudeau - NeXT support
  980. Jean-Luc Daems, Jacques Leroy - numerous optimization in Mesa 1.2.7
  981. Joerg Hessdoerfer - 16-bit TrueColor optimizations in Mesa 1.2.7
  982. Stefan Zivkovic - for the Amiga driver
  983. Peter McDermott - for the Cirrus Logic Mondello driver
  984. Constantin Filin - for mipmapping/texture mapping code
  985. Darren Abbott - for the OS/2 XFree86 port
  986. Hal Brand - for X line and polygon stippling code
  987. Eric Berdahl - for doing much of the internal overhaul work of Mesa for 2.0
  988. Frank Ortega - for bug fixes and many helpful comments
  989. Mats Lofkvist - for finding a number of bugs in Mesa 2.0
  990. Charlie Wallace - for the MS-DOS driver
  991. Li Wei - for updated Windows 95/NT driver
  992. Pete French - for the OpenStep driver
  993. Tinic Uro - for the BeOS driver
  994. Daniel Barrero - for the 3-D texture mapping extension
  995. Randy Frank - for many bug reports/fixes and code contributions
  996. David Bucciarelli - for the 3Dfx driver
  997. Paul Metzger - for Linux version of 3Dfx driver
  998. Daryll Strauss - for the Linux Glide library
  999. Kendall Bennet - for the SciTech MGL driver
  1000. Matthew Stewart-Smith - for updating the Linux SVGA driver
  1001. Magnus Lundin - for fixing a mipmap bug
  1002. Daniel Barrero - for the GL_EXT_point_parameters extension
  1003. Josh Vanderhoof - for Intel X86 assembly language optimizations
  1004. S3 - for the S3/Virge Windows 95 driver
  1005.  
  1006.  
  1007.  
  1008. This file last revised:  November 13, 1997
  1009.