1848b8605Smrg<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2848b8605Smrg<html lang="en">
3848b8605Smrg<head>
4848b8605Smrg  <meta http-equiv="content-type" content="text/html; charset=utf-8">
5848b8605Smrg  <title>Performance Tips</title>
6848b8605Smrg  <link rel="stylesheet" type="text/css" href="mesa.css">
7848b8605Smrg</head>
8848b8605Smrg<body>
9848b8605Smrg
10848b8605Smrg<div class="header">
11848b8605Smrg  <h1>The Mesa 3D Graphics Library</h1>
12848b8605Smrg</div>
13848b8605Smrg
14848b8605Smrg<iframe src="contents.html"></iframe>
15848b8605Smrg<div class="content">
16848b8605Smrg
17848b8605Smrg<h1>Performance Tips</h1>
18848b8605Smrg
19848b8605Smrg<p>
20848b8605SmrgPerformance tips for software rendering:
21848b8605Smrg</p>
22848b8605Smrg<ol>
23848b8605Smrg
24848b8605Smrg<li> Turn off smooth shading when you don't need it (glShadeModel)
25848b8605Smrg<li> Turn off depth buffering when you don't need it.
26848b8605Smrg<li> Turn off dithering when not needed.
27848b8605Smrg<li> Use double buffering as it's often faster than single buffering
28848b8605Smrg<li> Compile in the X Shared Memory extension option if it's supported
29848b8605Smrg      on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for
30848b8605Smrg      your system in the Make-config file.
31848b8605Smrg<li> Recompile Mesa with more optimization if possible.
32848b8605Smrg<li> Try to maximize the amount of drawing done between glBegin/glEnd pairs.
33848b8605Smrg<li> Use the MESA_BACK_BUFFER variable to find best performance in double
34848b8605Smrg      buffered mode.  (X users only)
35848b8605Smrg<li> Optimized polygon rasterizers are employed when:
36848b8605Smrg         rendering into back buffer which is an XImage
37848b8605Smrg         RGB mode, not grayscale, not monochrome
38848b8605Smrg         depth buffering is GL_LESS, or disabled
39848b8605Smrg         flat or smooth shading
40848b8605Smrg         dithered or non-dithered
41848b8605Smrg         no other rasterization operations enabled (blending, stencil, etc)
42848b8605Smrg<li> Optimized line drawing is employed when:
43848b8605Smrg         rendering into back buffer which is an XImage
44848b8605Smrg         RGB mode, not grayscale, not monochrome
45848b8605Smrg         depth buffering is GL_LESS or disabled
46848b8605Smrg         flat shading
47848b8605Smrg         dithered or non-dithered
48848b8605Smrg         no other rasterization operations enabled (blending, stencil, etc)
49848b8605Smrg<li> Textured polygons are fastest when:
50848b8605Smrg         using a 3-component (RGB), 2-D texture
51848b8605Smrg         minification and magnification filters are GL_NEAREST
52848b8605Smrg         texture coordinate wrap modes for S and T are GL_REPEAT
53848b8605Smrg         GL_DECAL environment mode
54848b8605Smrg         glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST )
55848b8605Smrg         depth buffering is GL_LESS or disabled
56848b8605Smrg<li> Lighting is fastest when:
57848b8605Smrg         Two-sided lighting is disabled
58848b8605Smrg         GL_LIGHT_MODEL_LOCAL_VIEWER is false
59848b8605Smrg         GL_COLOR_MATERIAL is disabled
60848b8605Smrg         No spot lights are used (all GL_SPOT_CUTOFFs are 180.0)
61848b8605Smrg         No local lights are used (all position W's are 0.0)
62848b8605Smrg         All material and light coefficients are &gt;= zero
63848b8605Smrg<li> XFree86 users:  if you want to use 24-bit color try starting your
64848b8605Smrg      X server in 32-bit per pixel mode for better performance.  That is,
65848b8605Smrg      start your X server with
66848b8605Smrg         startx -- -bpp 32
67848b8605Smrg      instead of
68848b8605Smrg         startx -- -bpp 24
69848b8605Smrg<li> Try disabling dithering with the MESA_NO_DITHER environment variable.
70848b8605Smrg      If this env var is defined Mesa will disable dithering and the
71848b8605Smrg      command glEnable(GL_DITHER) will be ignored.
72848b8605Smrg</ol>
73848b8605Smrg
74848b8605Smrg</div>
75848b8605Smrg</body>
76848b8605Smrg</html>
77