Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4358 Serge 1
2
3
4
  
5
  Performance Tips
6
  
7
8
9
 
10
11
  

The Mesa 3D Graphics Library

12
13
 
14
15
16
 
17

Performance Tips

18
 
19

20
Performance tips for software rendering:
21

22
    23
     
    24
  1. Turn off smooth shading when you don't need it (glShadeModel)
  2. 25
  3. Turn off depth buffering when you don't need it.
  4. 26
  5. Turn off dithering when not needed.
  6. 27
  7. Use double buffering as it's often faster than single buffering
  8. 28
  9. Compile in the X Shared Memory extension option if it's supported
  10. 29
          on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for
    30
          your system in the Make-config file.
    31
  11. Recompile Mesa with more optimization if possible.
  12. 32
  13. Try to maximize the amount of drawing done between glBegin/glEnd pairs.
  14. 33
  15. Use the MESA_BACK_BUFFER variable to find best performance in double
  16. 34
          buffered mode.  (X users only)
    35
  17. Optimized polygon rasterizers are employed when:
  18. 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
  19. Optimized line drawing is employed when:
  20. 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
  21. Textured polygons are fastest when:
  22. 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
  23. Lighting is fastest when:
  24. 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 >= zero
    63
  25. XFree86 users: if you want to use 24-bit color try starting your
  26. 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
  27. Try disabling dithering with the MESA_NO_DITHER environment variable.
  28. 70
          If this env var is defined Mesa will disable dithering and the
    71
          command glEnable(GL_DITHER) will be ignored.
    72
    73
     
    74
    75
    76