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