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 / MESAX / texture_stack.py < prev   
Encoding:
Python Source  |  2008-12-07  |  3.2 KB  |  67 lines

  1. '''OpenGL extension MESAX.texture_stack
  2.  
  3. Overview (from the spec)
  4.     
  5.     There are a number of circumstances where an application may wish to
  6.     blend two textures out of a larger set of textures.  Moreover, in some
  7.     cases the selected textures may vary on a per-fragment basis within
  8.     a polygon.  Several examples include:
  9.     
  10.        1. High dynamic range textures.  The application stores several
  11.        different "exposures" of an image as different textures.  On a
  12.        per-fragment basis, the application selects which exposures are
  13.        used.
  14.     
  15.        2. A terrain engine where the altitude of a point determines the
  16.        texture applied to it.  If the transition is from beach sand to
  17.        grass to rocks to snow, the application will store each texture
  18.        in a different texture map, and dynamically select which two
  19.        textures to blend at run-time.
  20.     
  21.        3. Storing short video clips in textures.  Each depth slice is a
  22.        single frame of video.
  23.     
  24.     Several solutions to this problem have been proposed, but they either
  25.     involve using a separate texture unit for each texture map or using 3D
  26.     textures without mipmaps.  Both of these options have major drawbacks.
  27.     
  28.     This extension provides a third alternative that eliminates the major
  29.     drawbacks of both previous methods.  A new texture target,
  30.     TEXTURE_2D_STACK, is added that functions identically to TEXTURE_3D in
  31.     all aspects except the sizes of the non-base level images.  In
  32.     traditional 3D texturing, the size of the N+1 LOD is half the size
  33.     of the N LOD in all three dimensions.  For the TEXTURE_2D_STACK target,
  34.     the height and width of the N+1 LOD is halved, but the depth is the
  35.     same for all levels of detail. The texture then becomes a "stack" of
  36.     2D textures.  The per-fragment texel is selected by the R texture
  37.     coordinate.
  38.     
  39.     References:
  40.     
  41.         http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011557
  42.         http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=000516
  43.         http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=011903
  44.         http://www.delphi3d.net/articles/viewarticle.php?article=terraintex.htm
  45.  
  46. The official definition of this extension is available here:
  47.     http://oss.sgi.com/projects/ogl-sample/registry/MESAX/texture_stack.txt
  48.  
  49. Automatically generated by the get_gl_extensions script, do not edit!
  50. '''
  51. from OpenGL import platform, constants, constant, arrays
  52. from OpenGL import extensions
  53. from OpenGL.GL import glget
  54. import ctypes
  55. EXTENSION_NAME = 'GL_MESAX_texture_stack'
  56. GL_TEXTURE_1D_STACK_MESAX = constant.Constant( 'GL_TEXTURE_1D_STACK_MESAX', 0x8759 )
  57. GL_TEXTURE_2D_STACK_MESAX = constant.Constant( 'GL_TEXTURE_2D_STACK_MESAX', 0x875A )
  58. GL_PROXY_TEXTURE_1D_STACK_MESAX = constant.Constant( 'GL_PROXY_TEXTURE_1D_STACK_MESAX', 0x875B )
  59. GL_PROXY_TEXTURE_2D_STACK_MESAX = constant.Constant( 'GL_PROXY_TEXTURE_2D_STACK_MESAX', 0x875C )
  60. GL_TEXTURE_1D_STACK_BINDING_MESAX = constant.Constant( 'GL_TEXTURE_1D_STACK_BINDING_MESAX', 0x875D )
  61. GL_TEXTURE_2D_STACK_BINDING_MESAX = constant.Constant( 'GL_TEXTURE_2D_STACK_BINDING_MESAX', 0x875E )
  62.  
  63.  
  64. def glInitTextureStackMESAX():
  65.     '''Return boolean indicating whether this extension is available'''
  66.     return extensions.hasGLExtension( EXTENSION_NAME )
  67.