home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mesa5.zip / mesa5src.zip / Doc / Mesa / README < prev    next >
Text File  |  2002-11-13  |  21KB  |  568 lines

  1.  
  2.                                  Mesa 5.0
  3.                              (stable version)
  4.  
  5.                      Copyright (C) 1995-2001  Brian Paul
  6.  
  7.                               www.mesa3d.org
  8.  
  9.  
  10. Disclaimer
  11. ==========
  12.  
  13. Mesa is a 3-D graphics library with an API which is very similar to that
  14. of OpenGL*.  To the extent that Mesa utilizes the OpenGL command syntax
  15. or state machine, it is being used with authorization from Silicon Graphics,
  16. Inc.  However, the author makes no claim that Mesa is in any way a
  17. compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
  18. Those who want a licensed implementation of OpenGL should contact a licensed
  19. vendor.
  20.  
  21. While Mesa is not a licensed OpenGL implementation, it is currently
  22. being tested with the OpenGL conformance tests.  For the current
  23. conformance status see the CONFORM file included in the Mesa distribution.
  24.  
  25. * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
  26.  
  27.  
  28.  
  29. Original Author
  30. ===============
  31.  
  32. Brian Paul
  33. See www.mesa3d.org for current email address.
  34.  
  35. Many people have contributed to Mesa.  A partial list is below.
  36.  
  37.  
  38.  
  39. Copyright Information
  40. =====================
  41.  
  42. See the docs/COPYRIGHT file.
  43.  
  44.  
  45.  
  46. Introduction
  47. ============
  48.  
  49. While Mesa uses the OpenGL API and mimics its semantics, it is
  50. important to understand that Mesa is not a real implementation of OpenGL
  51. since it is not licensed.  That said, Mesa is still a viable alternative
  52. to OpenGL.  Most OpenGL applications should run with Mesa without code
  53. changes.
  54.  
  55. The first six years of Mesa development were done during my spare time
  56. from August 1993 to August 1999.  Now, much of the Mesa development
  57. work is done during my working hours with Precision Insight, Inc.
  58.  
  59. The core library was originally written on an Amiga using the DCC compiler.
  60. Later, development was moved to an SGI workstation.  Current development
  61. is done on PC/Linux systems.
  62.  
  63. Mesa works on most Unix workstations with ANSI C and X11.  There are also
  64. drivers for Amiga, Microsoft Windows, Macintosh, MS DOS, NeXT, BeOS and
  65. other systems.  Unix/X11 is still the best-supported platform.
  66.  
  67. Since the OpenGL API is used, OpenGL documentation can serve as the
  68. documentation for Mesa's core functions.  Visit http://www.opengl.org/
  69. for extensive OpenGL information.
  70.  
  71. The primary design goal of this library has been correctness.  Performance
  72. has been a secondary (but still very important!) priority.  At this point,
  73. most common rendering operations have been optimized a great deal.
  74. However, if you find an obscure code path that isn't as fast as you
  75. think it could be (like glDrawPixels with lookup tables and a crazy
  76. blend mode) send a note to the author; it might not be hard to improve
  77. the path.  Better yet, try optimizing that path yourself and send a patch.
  78.  
  79.  
  80.  
  81. Getting the software
  82. ====================
  83.  
  84. Mesa can be downloaded from
  85. http://sourceforge.net/project/filelist.php?group_id=3 or from
  86. http://www.mesa3d.org/
  87.  
  88. Since version 2.3, Mesa is distributed in two pieces:  main library code
  89. and demos.  If you're upgrading from a previous version of Mesa or you're not
  90. interested in the demos you can just download the core Mesa archive file.
  91.  
  92. Mesa is available in at least three archive formats:
  93.  
  94. 1. GNU zip/tar
  95.  
  96.     Download MesaLib-5.0.tar.gz and optionally MesaDemos-5.0.tar.gz
  97.     Unpack with:
  98.         gzcat MesaLib-5.0.tar.gz | tar xf -
  99.         gzcat MesaDemos-5.0.tar.gz | tar xf -
  100.     or
  101.         gunzip MesaLib-5.0.tar.gz ; tar xf MesaLib-5.0.tar
  102.         gunzip MesaDemos-5.0.tar.gz ; tar xf MesaLib-5.0.tar
  103.     or
  104.         tar zxf MesaLib-5.0.tar.gz
  105.         tar zxf MesaDemos-5.0.tar.gz
  106.  
  107.     If you don't have gzcat try zcat instead.
  108.  
  109. 2. Unix compressed/tar
  110.  
  111.     Download MesaLib-5.0.tar.Z and optionally MesaDemos-5.0.tar.Z
  112.     Unpack with:
  113.         zcat MesaLib-5.0.tar.Z | tar xf -
  114.         zcat MesaDemos-5.0.tar.Z | tar xf -
  115.  
  116. 3. ZIP format
  117.  
  118.     Download MesaLib-5.0.zip and optionally MesaDemos-5.0.zip
  119.     Unpack with:
  120.         unzip MesaLib-5.0.zip
  121.         unzip MesaDemos-5.0.zip
  122.  
  123.  
  124. Note, there may be other package formats on the Mesa ftp/web site.
  125.  
  126.  
  127. After unpacking you'll have these files (and more):
  128.  
  129. docs/README    - this file
  130. docs/README.*    - detailed information for specific OS/hardware systems
  131. docs/COPYRIGHT    - copyright info
  132. docs/VERSIONS    - version history
  133. docs/RELNOTES    - release notes for the new version
  134. docs/CONFORM    - results of conformance testing
  135. Makefile.X11    - "old" top-level Makefile for X11-based systems
  136. Make-config    - "old" system configurations used by the Makefiles
  137. bin/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. si-glu/        - SGI Sample Implementation of GLU
  143. util/        - handly utility functions
  144. widgets-mesa/    - Mesa widgets for Xt/Motif (obsolete)
  145. widgets-sgi/    - SGI OpenGL widgets for Xt/Motif
  146.  
  147. and if you downloaded and unpacked the demos:
  148.  
  149. src-glut/    - source code for GLUT toolkit
  150. demos/        - GLUT demos
  151. xdemos/        - X11 and SVGA demo programs
  152. samples/    - sample OpenGL programs from SGI
  153. book/        - example programs from the OpenGL Programming Guide,
  154.           converted to GLUT by Mark Kilgard, from GLUT distribution.
  155. images/        - image files
  156. 3Dfx/        - 3Dfx demos and tests
  157. mtdemos/    - multi-threading demos
  158.  
  159.  
  160.  
  161. GLUT
  162. ====
  163.  
  164. Mesa 2.5 and later includes Mark Kilgard's GLUT library (GL Utility Toolkit).
  165. GLUT is built automatically on systems which support it.
  166.  
  167. The GLUT tests, demos, examples, etc are not included, just the main library.
  168. To obtain the latest complete release of GLUT please visit
  169. http://www.opengl.org/developers/documentation/glut/index.html
  170.  
  171.  
  172.  
  173. Compiling and Installation
  174. ==========================
  175.  
  176. See the INSTALL file for instructions.
  177.  
  178.  
  179.  
  180. Using the Library
  181. =================
  182.  
  183. Performance tips for software rendering:
  184.    1. Turn off smooth shading when you don't need it (glShadeModel)
  185.    2. Turn off depth buffering when you don't need it.
  186.    3. Turn off dithering when not needed.
  187.    4. Use double buffering as it's often faster than single buffering
  188.    5. Compile in the X Shared Memory extension option if it's supported
  189.       on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for
  190.       your system in the Make-config file.
  191.    6. Recompile Mesa with more optimization if possible.
  192.    7. Try to maximize the amount of drawing done between glBegin/glEnd pairs.
  193.    8. Use the MESA_BACK_BUFFER variable to find best performance in double
  194.       buffered mode.  (X users only)
  195.    9. Optimized polygon rasterizers are employed when:
  196.          rendering into back buffer which is an XImage
  197.          RGB mode, not grayscale, not monochrome
  198.          depth buffering is GL_LESS, or disabled
  199.          flat or smooth shading
  200.          dithered or non-dithered
  201.          no other rasterization operations enabled (blending, stencil, etc)
  202.   10. Optimized line drawing is employed when:
  203.          rendering into back buffer which is an XImage
  204.          RGB mode, not grayscale, not monochrome
  205.          depth buffering is GL_LESS or disabled
  206.          flat shading
  207.          dithered or non-dithered
  208.          no other rasterization operations enabled (blending, stencil, etc)
  209.   11. Textured polygons are fastest when:
  210.          using a 3-component (RGB), 2-D texture
  211.          minification and magnification filters are GL_NEAREST
  212.          texture coordinate wrap modes for S and T are GL_REPEAT
  213.          GL_DECAL environment mode
  214.          glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST )
  215.          depth buffering is GL_LESS or disabled
  216.   12. Lighting is fastest when:
  217.          Two-sided lighting is disabled
  218.          GL_LIGHT_MODEL_LOCAL_VIEWER is false
  219.          GL_COLOR_MATERIAL is disabled
  220.          No spot lights are used (all GL_SPOT_CUTOFFs are 180.0)
  221.          No local lights are used (all position W's are 0.0)
  222.          All material and light coefficients are >= zero
  223.   13. XFree86 users:  if you want to use 24-bit color try starting your
  224.       X server in 32-bit per pixel mode for better performance.  That is,
  225.       start your X server with
  226.          startx -- -bpp 32
  227.       instead of
  228.          startx -- -bpp 24
  229.   14. Try disabling dithering with the MESA_NO_DITHER environment variable.
  230.       If this env var is defined Mesa will disable dithering and the
  231.       command glEnable(GL_DITHER) will be ignored.
  232.  
  233.  
  234. Debugging:
  235.    Normally Mesa records but does not notify the user of errors.  It is up
  236.    to the application to call glGetError to check for errors.  Mesa supports
  237.    an environment variable, MESA_DEBUG, to help with debugging.  If MESA_DEBUG
  238.    is defined, a message will be printed to stdout whenever an error occurs.
  239.  
  240.    More extensive error checking is done when Mesa is compiled with the
  241.    DEBUG symbol defined.  You'll have to edit the Make-config file and
  242.    add -DDEBUG to the CFLAGS line for your system configuration.  You may
  243.    also want to replace any optimization flags with the -g flag so you can
  244.    use your debugger.  After you've edited Make-config type 'make clean'
  245.    before recompiling.
  246.  
  247.    In your debugger you can set a breakpoint in gl_error() to trap Mesa
  248.    errors.
  249.  
  250.    There is a display list printing/debugging facility.  See the end of
  251.    src/dlist.c for details.
  252.  
  253.  
  254. Fortran bindings:
  255.    Fortan bindings are no longer included with Mesa.  William F. Mitchell
  256.    (william.mitchell@nist.gov) has developed a new set of Mesa/OpenGL and
  257.    GLUT bindings for Fortran.  See http://math.nist.gov/f90gl for more
  258.    information.
  259.  
  260.  
  261. Off-screen rendering:
  262.    Mesa 1.2.4 introduced off-screen rendering, a facility for generating
  263.    3-D imagery without having to open a window on your display.  Mesa's
  264.    simple off-screen rendering interface is completely operating system
  265.    and window system independent so programs which use off-screen rendering
  266.    should be very portable.  This new feature effectively enables you to
  267.    use Mesa as an off-line, batch-oriented renderer.
  268.  
  269.    The "OSMesa" API provides 3 functions for making off-screen renderings:
  270.    OSMesaCreateContext(), OSMesaMakeCurrent(), and OSMesaDestroyContext().
  271.    See the Mesa/include/GL/osmesa.h header for more information.  See the
  272.    demos/osdemo.c file for an example program.   There is no facility for
  273.    writing images to files.
  274.  
  275.    If you want to generate large images (larger than 1280x1024) you'll
  276.    have to edit the src/config.h file to change MAX_WIDTH and MAX_HEIGHT
  277.    then recompile Mesa.  Image size should only be limited by available
  278.    memory.
  279.  
  280.  
  281. Deep color channels:
  282.    For some applications 8-bit color channels don't have sufficient
  283.    accuracy (film and IBR, for example).  If you're in this situation
  284.    you'll be happy to know that Mesa supports 16-bit and 32-bit color
  285.    channels through the OSMesa interface.  When using 16-bit channels,
  286.    channels are GLushorts and pixels occupy 8 bytes.  When using 32-bit
  287.    channels, channels are GLfloats and pixels occupy 16 bytes.
  288.  
  289.    To build Mesa/OSMesa with 16-bit color channels:
  290.  
  291.       cd Mesa-4.x/src
  292.       make -f Makefile.X11 clean
  293.       make -f Makefile.OSMesa16 linux-osmesa16
  294.  
  295.    For 32-bit channels:
  296.       cd Mesa-4.x/src
  297.       make -f Makefile.X11 clean
  298.       make -f Makefile.OSMesa16 linux-osmesa32
  299.  
  300.    If you're not using Linux, you can easily edit Make-config and add
  301.    an appropriate configuration.
  302.  
  303.    The Mesa/tests/osdemo16.c file (available via CVS) demonstrates how
  304.    to use this feature.
  305.  
  306.    BE WARNED: 16 and 32-bit channel support has not been exhaustively
  307.    tested and there may be some bugs.  However, a number of people have
  308.    been using this feature successfully so it can't be too broken.
  309.  
  310.  
  311. Name Mangling
  312.    If you want to use Mesa and native OpenGL in the same application at
  313.    the same time you may find it useful to compile Mesa with "name
  314.    mangling".  This results in all the Mesa functions being prefixed with
  315.    "mgl" instead of "gl".
  316.  
  317.    To do this, recompile Mesa with the compiler flag -DUSE_MGL_NAMESPACE.
  318.    Add the flag to the other compiler flags in Make-config (if using the
  319.    old-style build system) or in src/Makefile if using GNU autoconf/
  320.    automake to build Mesa.
  321.  
  322.  
  323. Profiling (may no longer work in Mesa 3.1 or later, sorry):
  324.    Mesa 1.2.6 introduced a simple profiling facility.  It counts and
  325.    measures the time spent in a number of important rendering operations
  326.    and prints the information in a report before your program exits.
  327.  
  328.    By default, profiling is disabled.  To enable it, add -DPROFILE to
  329.    the appropriate CFLAGS entry in the Make-config file, then recompile
  330.    Mesa.  In general, you should only enable profiling during program
  331.    development to gain insight into Mesa's performance.  Mesa runs a bit
  332.    slower when profiling is enabled because it requires frequent polling
  333.    of the system clock.
  334.  
  335.    The profiling report will be printed when glXDestroyContext is called
  336.    _if_ the MESA_PROFILE environment variable is set.  You must be sure
  337.    glXDestroyContext is called before exiting to get the profile report.
  338.    The report will be printed to stdout and includes:
  339.  
  340.       glBegin/glEnd - number of glBegin/glEnd pairs called, total time,
  341.          and rate in pairs/second.
  342.       vertexes transformed - number of vertices transformed, lit, clip-
  343.          tested, fogged, and mapped to window coordinates, total time,
  344.          and rate in vertexes/second.
  345.       points rasterized - number of points drawn, time, and rate.
  346.       lines rasterized - number of lines drawn, time, and rate.
  347.       polygons rasterized - number of polygons drawn, time and rate.
  348.       overhead - time between glBegin/glEnd not accounted for by vertexes,
  349.          points, lines, and polygons.  This is time spent executing
  350.          glVertex, glNormal, glColor, etc, clipping, primitive assembly,
  351.          and user code between glBegin/glEnd.
  352.       glClear - number of glClears executed, total time and clears/second.
  353.       SwapBuffers - number of swaps executed, total time and swaps/second.
  354.  
  355.    Note that the real point, line, and polygon rates should be computed by
  356.       adding in the vertex transformation and overhead time factors.
  357.  
  358.  
  359. Extensions:
  360.    Mesa supports quite a few OpenGL extensions.  The set of available
  361.    extensions depends on the device driver you're using.  Run the glinfo
  362.    program to learn which extensions are available on your computer.
  363.  
  364.    There are a few Mesa-specific extensions:
  365.  
  366.    GL_MESA_window_pos
  367.  
  368.       This extension adds the glWindowPos*MESA() functions.  These functions
  369.       are convenient alternatives to glRasterPos*() because they set the
  370.       current raster position to a specific window coordinate, bypassing the
  371.       usual modelview, projection and viewport transformations.  This is
  372.       especially useful for setting the position for glDrawPixels() or
  373.       glBitmap() to a specific window coordinate.
  374.  
  375.       See the docs/MESA_window_pos.spec file for details.
  376.  
  377.    GL_MESA_resize_buffers
  378.  
  379.       This extension adds the glResizeBuffersMESA() function.  When this
  380.       function is called, Mesa checks if the color buffer (window) has
  381.       been resized.  If it has, Mesa reallocates the ancillary (depth,
  382.       stencil, accum) buffers.
  383.  
  384.       Normally, Mesa checks for window size changes whenever glViewport()
  385.       is called.  In some applications it may not be appropriate to call
  386.       glViewport() when the window is resized.  Such applications should
  387.       call glResizeBuffersMESA() instead so the ancillary buffers are
  388.       correctly updated.
  389.  
  390.       See the docs/MESA_resize_buffers.spec file for more details.
  391.       This extension is new in version 2.2.
  392.  
  393.  
  394. Runtime Configuration File:
  395.    See the CONFIG file for information on how to setup a Mesa runtime
  396.    config file.
  397.  
  398.  
  399. Version 2.x features:
  400.    Version 2.x of Mesa implements the OpenGL 1.1 API with the following
  401.    new features.
  402.  
  403.    Texture mapping:
  404.     glAreTexturesResident
  405.     glBindTexture
  406.     glCopyTexImage1D
  407.     glCopyTexImage2D
  408.     glCopyTexSubImage1D
  409.     glCopyTexSubImage2D
  410.     glDeleteTextures
  411.     glGenTextures
  412.     glIsTexture
  413.     glPrioritizeTextures
  414.     glTexSubImage1D
  415.     glTexSubImage2D
  416.  
  417.    Vertex Arrays:
  418.     glArrayElement
  419.     glColorPointer
  420.     glDrawElements
  421.     glEdgeFlagPointer
  422.     glIndexPointer
  423.     glInterleavedArrays
  424.     glNormalPointer
  425.     glTexCoordPointer
  426.     glVertexPointer
  427.  
  428.    Client state management:
  429.     glDisableClientState
  430.     glEnableClientState
  431.     glPopClientAttrib
  432.     glPushClientAttrib
  433.  
  434.    Misc:
  435.     glGetPointer
  436.     glIndexub
  437.     glIndexubv
  438.     glPolygonOffset
  439.  
  440.  
  441. Version 3.x features:
  442.    Version 3.x of Mesa implements the OpenGL 1.2 API with the following
  443.    new features:
  444.  
  445.    BGR, BGRA and packed pixel formats
  446.    New texture border clamp mode
  447.    glDrawRangeElements()
  448.    standard 3-D texturing
  449.    advanced MIPMAP control
  450.    separate specular color interpolation
  451.  
  452.  
  453. Version 4.x features:
  454.    Version 4.x of Mesa implements the OpenGL 1.3 API with the following
  455.    extensions incorporated as standard features:
  456.  
  457.    GL_ARB_multisample
  458.    GL_ARB_multitexture
  459.    GL_ARB_texture_border_clamp
  460.    GL_ARB_texture_compression
  461.    GL_ARB_texture_cube_map
  462.    GL_ARB_texture_env_add
  463.    GL_ARB_texture_env_combine
  464.    GL_ARB_texture_env_dot3
  465.    GL_ARB_transpose_matrix
  466.  
  467.    The functions defined by these extensions are now available without
  468.    the "ARB" suffix.  For example, glLoadTransposeMatrixf() is now a
  469.    standard API function.
  470.  
  471.  
  472. Version 5.x features:
  473.    Version 5.x of Mesa implements the OpenGL 1.4 API with the following
  474.    extensions incorporated as standard features:
  475.  
  476.    GL_ARB_depth_texture
  477.    GL_ARB_shadow
  478.    GL_ARB_texture_env_crossbar
  479.    GL_ARB_texture_mirror_repeat
  480.    GL_ARB_window_pos
  481.    GL_EXT_blend_color
  482.    GL_EXT_blend_func_separate
  483.    GL_EXT_blend_logic_op
  484.    GL_EXT_blend_minmax
  485.    GL_EXT_blend_subtract
  486.    GL_EXT_fog_coord
  487.    GL_EXT_multi_draw_arrays
  488.    GL_EXT_point_parameters
  489.    GL_EXT_secondary_color
  490.    GL_EXT_stencil_wrap
  491.    GL_SGIS_generate_mipmap
  492.  
  493.  
  494.  
  495. Summary of environment variables:
  496.    MESA_DEBUG - if defined, error messages are printed to stderr
  497.    MESA_NO_DITHER - disable dithering, overriding glEnable(GL_DITHER)
  498.    MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
  499.    MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
  500.    MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
  501.    MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only)
  502.    MESA_GAMMA - gamma correction coefficients (X only)
  503.    MESA_PROFILE - enable reporting of performance measurements
  504.    MESA_XSYNC - enable synchronous X behavior (for X debugging only)
  505.  
  506.  
  507.  
  508. Mailing Lists
  509. =============
  510.  
  511. Visit the Mesa web site at http://www.mesa3d.org to join the mailing
  512. lists.  There is a user's list, developer's list and announcement list.
  513.  
  514.  
  515.  
  516. Reporting Bugs
  517. ==============
  518.  
  519. If you think you've found a bug in Mesa:
  520.  
  521.    1. Check if there's a new version of Mesa to download.
  522.  
  523.    2. Check if the bug has already been reported in the Mesa bug
  524.       database at http://www.mesa3d.org
  525.  
  526.    3. If you've found a new bug, submit it to the bug database.
  527.       Provide as much information as possible!  Check back on the
  528.       bug report from time to time to monitor its status.
  529.  
  530.    4. Please provide small test programs when possible.
  531.  
  532.  
  533.  
  534. Making Contributions
  535. ====================
  536.  
  537. Many people have contributed to Mesa.  I really appreciate the help!
  538. See the Mesa web site for a list of past and current contributors.
  539.  
  540. If you want to help with Mesa, first join the Mesa developer's
  541. mailing list.  Then post a message explaining what you might like
  542. to help with.  The Mesa web page has a list of a few work items
  543. which you may consider.
  544.  
  545. Anyone is welcome to contribute code to the Mesa project, provided you
  546. agree to the copyright terms of the relevant code.  See the COPYRIGHT
  547. file.
  548.  
  549. If you're contribution code to the Mesa library itself:
  550.    1. Try to write clean code (uniform indentation, comments, meaningful
  551.       identifiers, etc).  It must be readable and maintainable!
  552.    2. Test your code.  On several occations I've incorporated code from
  553.       users which later turned out to have bugs.  Now, I'm pretty hesitant
  554.       to use code which doesn't look good.
  555.  
  556.  
  557.  
  558. Why is it the library called Mesa?
  559. ==================================
  560.  
  561. Why not?  More obvious names were considered but had to be rejected:
  562. FreeGL (too similar to the trademarked name OpenGL), Free3D (too similar
  563. to DEC's Open3D).  Also, I'm tired of acronyms.
  564.  
  565.  
  566. --------------------------------------------------------------------------
  567. $Id: README,v 3.38 2002/11/13 15:33:51 brianp Exp $
  568.