17ec681f3SmrgPerformance Tips 27ec681f3Smrg================ 37ec681f3Smrg 47ec681f3SmrgPerformance tips for software rendering: 57ec681f3Smrg 67ec681f3Smrg#. Turn off smooth shading when you don't need it (glShadeModel) 77ec681f3Smrg#. Turn off depth buffering when you don't need it. 87ec681f3Smrg#. Turn off dithering when not needed. 97ec681f3Smrg#. Use double buffering as it's often faster than single buffering 107ec681f3Smrg#. Compile in the X Shared Memory extension option if it's supported on 117ec681f3Smrg your system by adding -DSHM to CFLAGS and -lXext to XLIBS for your 127ec681f3Smrg system in the Make-config file. 137ec681f3Smrg#. Recompile Mesa with more optimization if possible. 147ec681f3Smrg#. Try to maximize the amount of drawing done between glBegin/glEnd 157ec681f3Smrg pairs. 167ec681f3Smrg#. Use the MESA_BACK_BUFFER variable to find best performance in double 177ec681f3Smrg buffered mode. (X users only) 187ec681f3Smrg#. Optimized polygon rasterizers are employed when: rendering into back 197ec681f3Smrg buffer which is an XImage RGB mode, not grayscale, not monochrome 207ec681f3Smrg depth buffering is GL_LESS, or disabled flat or smooth shading 217ec681f3Smrg dithered or non-dithered no other rasterization operations enabled 227ec681f3Smrg (blending, stencil, etc) 237ec681f3Smrg#. Optimized line drawing is employed when: rendering into back buffer 247ec681f3Smrg which is an XImage RGB mode, not grayscale, not monochrome depth 257ec681f3Smrg buffering is GL_LESS or disabled flat shading dithered or 267ec681f3Smrg non-dithered no other rasterization operations enabled (blending, 277ec681f3Smrg stencil, etc) 287ec681f3Smrg#. Textured polygons are fastest when: using a 3-component (RGB), 2-D 297ec681f3Smrg texture minification and magnification filters are GL_NEAREST texture 307ec681f3Smrg coordinate wrap modes for S and T are GL_REPEAT GL_DECAL environment 317ec681f3Smrg mode glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ) depth 327ec681f3Smrg buffering is GL_LESS or disabled 337ec681f3Smrg#. Lighting is fastest when: Two-sided lighting is disabled 347ec681f3Smrg GL_LIGHT_MODEL_LOCAL_VIEWER is false GL_COLOR_MATERIAL is disabled No 357ec681f3Smrg spot lights are used (all GL_SPOT_CUTOFFs are 180.0) No local lights 367ec681f3Smrg are used (all position W's are 0.0) All material and light 377ec681f3Smrg coefficients are >= zero 387ec681f3Smrg#. XFree86 users: if you want to use 24-bit color try starting your X 397ec681f3Smrg server in 32-bit per pixel mode for better performance. That is, 407ec681f3Smrg start your X server with startx -- -bpp 32 instead of startx -- -bpp 417ec681f3Smrg 24 427ec681f3Smrg#. Try disabling dithering with the MESA_NO_DITHER environment variable. 437ec681f3Smrg If this env var is defined Mesa will disable dithering and the 447ec681f3Smrg command glEnable(GL_DITHER) will be ignored. 45