• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html lang="en">
3<head>
4  <meta http-equiv="content-type" content="text/html; charset=utf-8">
5  <title>Performance Tips</title>
6  <link rel="stylesheet" type="text/css" href="mesa.css">
7</head>
8<body>
9
10<div class="header">
11  <h1>The Mesa 3D Graphics Library</h1>
12</div>
13
14<iframe src="contents.html"></iframe>
15<div class="content">
16
17<h1>Performance Tips</h1>
18
19<p>
20Performance tips for software rendering:
21</p>
22<ol>
23
24<li> Turn off smooth shading when you don't need it (glShadeModel)
25<li> Turn off depth buffering when you don't need it.
26<li> Turn off dithering when not needed.
27<li> Use double buffering as it's often faster than single buffering
28<li> Compile in the X Shared Memory extension option if it's supported
29      on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for
30      your system in the Make-config file.
31<li> Recompile Mesa with more optimization if possible.
32<li> Try to maximize the amount of drawing done between glBegin/glEnd pairs.
33<li> Use the MESA_BACK_BUFFER variable to find best performance in double
34      buffered mode.  (X users only)
35<li> Optimized polygon rasterizers are employed when:
36         rendering into back buffer which is an XImage
37         RGB mode, not grayscale, not monochrome
38         depth buffering is GL_LESS, or disabled
39         flat or smooth shading
40         dithered or non-dithered
41         no other rasterization operations enabled (blending, stencil, etc)
42<li> Optimized line drawing is employed when:
43         rendering into back buffer which is an XImage
44         RGB mode, not grayscale, not monochrome
45         depth buffering is GL_LESS or disabled
46         flat shading
47         dithered or non-dithered
48         no other rasterization operations enabled (blending, stencil, etc)
49<li> Textured polygons are fastest when:
50         using a 3-component (RGB), 2-D texture
51         minification and magnification filters are GL_NEAREST
52         texture coordinate wrap modes for S and T are GL_REPEAT
53         GL_DECAL environment mode
54         glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST )
55         depth buffering is GL_LESS or disabled
56<li> Lighting is fastest when:
57         Two-sided lighting is disabled
58         GL_LIGHT_MODEL_LOCAL_VIEWER is false
59         GL_COLOR_MATERIAL is disabled
60         No spot lights are used (all GL_SPOT_CUTOFFs are 180.0)
61         No local lights are used (all position W's are 0.0)
62         All material and light coefficients are &gt;= zero
63<li> XFree86 users:  if you want to use 24-bit color try starting your
64      X server in 32-bit per pixel mode for better performance.  That is,
65      start your X server with
66         startx -- -bpp 32
67      instead of
68         startx -- -bpp 24
69<li> Try disabling dithering with the MESA_NO_DITHER environment variable.
70      If this env var is defined Mesa will disable dithering and the
71      command glEnable(GL_DITHER) will be ignored.
72</ol>
73
74</div>
75</body>
76</html>
77