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<h1>Performance Tips</h1> 11 12<p> 13Performance tips for software rendering: 14</p> 15<ol> 16 17<li> Turn off smooth shading when you don't need it (glShadeModel) 18<li> Turn off depth buffering when you don't need it. 19<li> Turn off dithering when not needed. 20<li> Use double buffering as it's often faster than single buffering 21<li> Compile in the X Shared Memory extension option if it's supported 22 on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for 23 your system in the Make-config file. 24<li> Recompile Mesa with more optimization if possible. 25<li> Try to maximize the amount of drawing done between glBegin/glEnd pairs. 26<li> Use the MESA_BACK_BUFFER variable to find best performance in double 27 buffered mode. (X users only) 28<li> Optimized polygon rasterizers are employed when: 29 rendering into back buffer which is an XImage 30 RGB mode, not grayscale, not monochrome 31 depth buffering is GL_LESS, or disabled 32 flat or smooth shading 33 dithered or non-dithered 34 no other rasterization operations enabled (blending, stencil, etc) 35<li> Optimized line drawing is 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 shading 40 dithered or non-dithered 41 no other rasterization operations enabled (blending, stencil, etc) 42<li> Textured polygons are fastest when: 43 using a 3-component (RGB), 2-D texture 44 minification and magnification filters are GL_NEAREST 45 texture coordinate wrap modes for S and T are GL_REPEAT 46 GL_DECAL environment mode 47 glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ) 48 depth buffering is GL_LESS or disabled 49<li> Lighting is fastest when: 50 Two-sided lighting is disabled 51 GL_LIGHT_MODEL_LOCAL_VIEWER is false 52 GL_COLOR_MATERIAL is disabled 53 No spot lights are used (all GL_SPOT_CUTOFFs are 180.0) 54 No local lights are used (all position W's are 0.0) 55 All material and light coefficients are >= zero 56<li> XFree86 users: if you want to use 24-bit color try starting your 57 X server in 32-bit per pixel mode for better performance. That is, 58 start your X server with 59 startx -- -bpp 32 60 instead of 61 startx -- -bpp 24 62<li> Try disabling dithering with the MESA_NO_DITHER environment variable. 63 If this env var is defined Mesa will disable dithering and the 64 command glEnable(GL_DITHER) will be ignored. 65</ol> 66 67 68</body> 69</html> 70