home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / lib / site-packages / OpenGL / raw / GL / DFX / multisample.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  3.1 KB  |  67 lines

  1. '''OpenGL extension DFX.multisample
  2.  
  3. Overview (from the spec)
  4.     
  5.         This extension provides a mechanism to antialias all GL primitives:
  6.         points, lines, polygons, bitmaps, and images. The technique is to
  7.         sample all primitives multiple times at each pixel. The color sample
  8.         values are resolved to a single, displayable color each time a pixel
  9.         is updated, so the antialiasing appears to be automatic at the
  10.         application level. Because each sample includes depth and stencil
  11.         information, the depth and stencil functions perform equivalently to
  12.         the single-sample mode.
  13.     
  14.         An additional buffer, called the multisample buffer, is added to the
  15.         framebuffer. Pixel sample values, including color, depth, and
  16.         stencil values, are stored in this buffer. When the framebuffer
  17.         includes a multisample buffer, it does not also include separate
  18.         depth or stencil buffers, even if the multisample buffer does not
  19.         store depth or stencil values. Color buffers (left/right,
  20.         front/back, and aux) do coexist with the multisample buffer,
  21.         however.
  22.     
  23.         Multisample antialiasing is most valuable for rendering polygons,
  24.         because it requires no sorting for hidden surface elimination, and
  25.         it correctly handles adjacent polygons, object silhouettes, and even
  26.         intersecting polygons. If only points or lines are being rendered,
  27.         the "smooth" antialiasing mechanism provided by the base GL may
  28.         result in a higher quality image.
  29.     
  30.         This extension is a subset of SGIS_multisample. It differs in these
  31.         key ways:
  32.     
  33.            * Fragment alpha values are not affected by the fragment sample mask
  34.            * The sample locations may or may not be fixed. Thus, there is no
  35.          support for rendering the scene multiple times with different
  36.          sample points.
  37.            * Fragment masks are not computed for images or for bitmasks.
  38.     
  39.         Because of these differences a new extension was created. However,
  40.         it is not expected that this extension will co-exist with
  41.         SGIS_multisample. Because of this and the fact that there are only
  42.         32 push/pop bits the MULTISAMPLE_BIT_SGIS state value is the same as
  43.         MUTLISAMPLE_BIT_3DFX.
  44.  
  45. The official definition of this extension is available here:
  46.     http://oss.sgi.com/projects/ogl-sample/registry/DFX/multisample.txt
  47.  
  48. Automatically generated by the get_gl_extensions script, do not edit!
  49. '''
  50. from OpenGL import platform, constants, constant, arrays
  51. from OpenGL import extensions
  52. from OpenGL.GL import glget
  53. import ctypes
  54. EXTENSION_NAME = 'GL_DFX_multisample'
  55. GL_MULTISAMPLE_3DFX = constant.Constant( 'GL_MULTISAMPLE_3DFX', 0x86B2 )
  56. glget.addGLGetConstant( GL_MULTISAMPLE_3DFX, (1,) )
  57. GL_SAMPLE_BUFFERS_3DFX = constant.Constant( 'GL_SAMPLE_BUFFERS_3DFX', 0x86B3 )
  58. glget.addGLGetConstant( GL_SAMPLE_BUFFERS_3DFX, (1,) )
  59. GL_SAMPLES_3DFX = constant.Constant( 'GL_SAMPLES_3DFX', 0x86B4 )
  60. glget.addGLGetConstant( GL_SAMPLES_3DFX, (1,) )
  61. GL_MULTISAMPLE_BIT_3DFX = constant.Constant( 'GL_MULTISAMPLE_BIT_3DFX', 0x20000000 )
  62.  
  63.  
  64. def glInitMultisampleDFX():
  65.     '''Return boolean indicating whether this extension is available'''
  66.     return extensions.hasGLExtension( EXTENSION_NAME )
  67.