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 / NV / texture_shader3.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  6.2 KB  |  128 lines

  1. '''OpenGL extension NV.texture_shader3
  2.  
  3. Overview (from the spec)
  4.     
  5.     NV_texture_shader3 extends the NV_texture_shader functionality by
  6.     adding several new texture shader operations, extending several
  7.     existing texture shader operations, adding a new HILO8 internal
  8.     format, and adding new and more flexible re-mapping modes for dot
  9.     product and dependent texture shader operations.
  10.     
  11.     See the NV_texture_shader extension for information about the
  12.     texture shader operational model.
  13.     
  14.     The fourteen new texture shader operations are:
  15.     
  16.     <offset textures>
  17.     
  18.     24.  OFFSET_PROJECTIVE_TEXTURE_2D_NV - Transforms the signed (ds,dt)
  19.          components of a previous texture unit by a 2x2 floating-point
  20.          matrix and then uses the result to offset the stage's texture
  21.          coordinates for a 2D non-projective texture.
  22.     
  23.     25.  OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV - Same as above except
  24.          the magnitude component of the previous texture unit result
  25.          scales the red, green, and blue components of the unsigned RGBA
  26.          texture 2D access.
  27.     
  28.     26.  OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV - Similar to
  29.          OFFSET_TEXTURE_2D_NV except that the texture access is into a
  30.          rectangular non-projective texture.
  31.     
  32.     27.  OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV - Similar to
  33.          OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV except that the texture
  34.          access is into a rectangular non-projective texture.
  35.     
  36.     28.  OFFSET_HILO_TEXTURE_2D_NV - Similar to OFFSET_TEXTURE_2D_NV
  37.          but uses a (higher-precision) HILO base format texture rather
  38.          than a DSDT-type base format.
  39.     
  40.     29.  OFFSET_HILO_TEXTURE_RECTANGLE_NV - Similar to
  41.          OFFSET_TEXTURE_RECTANGLE_NV but uses a (higher-precision)
  42.          HILO base format texture rather than a DSDT-type base format.
  43.     
  44.     30.  OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV - Similar to
  45.          OFFSET_PROJECTIVE_TEXTURE_2D_NV but uses a (higher-precision)
  46.          HILO base format texture rather than a DSDT-type base format.
  47.     
  48.     31.  OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV - Similar to
  49.          OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV but uses a
  50.          (higher-precision) HILO base format texture rather than a
  51.          DSDT-type base format.
  52.     
  53.          (There are no "offset HILO texture scale" operations because
  54.          HILO textures have only two components with no third component
  55.          for scaling.)
  56.     
  57.     <dependent textures>
  58.     
  59.     32.  DEPENDENT_HILO_TEXTURE_2D_NV - Converts the hi and lo components
  60.          of a previous shader HILO result into an (s,t) texture coordinate
  61.          set to access a 2D non-projective texture.
  62.     
  63.     33.  DEPENDENT_RGB_TEXTURE_3D_NV - Converts the red, green, and
  64.          blue components of a previous shader RGBA result into an (s,t,r)
  65.          texture coordinate set to access a 3D non-projective texture.
  66.     
  67.     34.  DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV - Converts the red, green,
  68.          and blue components of a previous shader RGBA result into an
  69.          (s,t,r) texture coordinate set to access a cube map texture.
  70.     
  71.     <dot product textures>
  72.     
  73.     35.  DOT_PRODUCT_TEXTURE_1D_NV - Computes a dot product in the manner
  74.          of the DOT_PRODUCT_NV operation and uses the result as the s
  75.          texture coordinate to access a 2D non-projective texture.
  76.     
  77.     36.  DOT_PRODUCT_PASS_THROUGH_NV - Computes a dot product in the
  78.          manner of the DOT_PRODUCT_NV operation and the result is [0,1]
  79.          clamped and smeared to generate the texture unit RGBA result.
  80.     
  81.     <dot product depth replace>
  82.     
  83.     37.  DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV - Computes a dot product
  84.          in the manner of the DOT_PRODUCT_NV operation and the result
  85.          is [0,1] clamped and replaces the fragment's window-space
  86.          depth value.  The texture unit RGBA result is (0,0,0,0).
  87.     
  88.     Two new internal texture formats have been added: HILO8_NV and
  89.     SIGNED_HILO8_NV.  These texture formats allow HILO textures to be
  90.     stored in half the space; still the filtering for these internal
  91.     texture formats is done with 16-bit precision.
  92.     
  93.     One new unsigned RGBA dot product mapping mode (FORCE_BLUE_TO_ONE_NV)
  94.     forces the blue component to be 1.0 before computing a dot product.
  95.  
  96. The official definition of this extension is available here:
  97.     http://oss.sgi.com/projects/ogl-sample/registry/NV/texture_shader3.txt
  98.  
  99. Automatically generated by the get_gl_extensions script, do not edit!
  100. '''
  101. from OpenGL import platform, constants, constant, arrays
  102. from OpenGL import extensions
  103. from OpenGL.GL import glget
  104. import ctypes
  105. EXTENSION_NAME = 'GL_NV_texture_shader3'
  106. GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = constant.Constant( 'GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV', 0x8850 )
  107. GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = constant.Constant( 'GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV', 0x8851 )
  108. GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = constant.Constant( 'GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV', 0x8852 )
  109. GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = constant.Constant( 'GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV', 0x8853 )
  110. GL_OFFSET_HILO_TEXTURE_2D_NV = constant.Constant( 'GL_OFFSET_HILO_TEXTURE_2D_NV', 0x8854 )
  111. GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = constant.Constant( 'GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV', 0x8855 )
  112. GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = constant.Constant( 'GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV', 0x8856 )
  113. GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = constant.Constant( 'GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV', 0x8857 )
  114. GL_DEPENDENT_HILO_TEXTURE_2D_NV = constant.Constant( 'GL_DEPENDENT_HILO_TEXTURE_2D_NV', 0x8858 )
  115. GL_DEPENDENT_RGB_TEXTURE_3D_NV = constant.Constant( 'GL_DEPENDENT_RGB_TEXTURE_3D_NV', 0x8859 )
  116. GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = constant.Constant( 'GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV', 0x885A )
  117. GL_DOT_PRODUCT_PASS_THROUGH_NV = constant.Constant( 'GL_DOT_PRODUCT_PASS_THROUGH_NV', 0x885B )
  118. GL_DOT_PRODUCT_TEXTURE_1D_NV = constant.Constant( 'GL_DOT_PRODUCT_TEXTURE_1D_NV', 0x885C )
  119. GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = constant.Constant( 'GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV', 0x885D )
  120. GL_HILO8_NV = constant.Constant( 'GL_HILO8_NV', 0x885E )
  121. GL_SIGNED_HILO8_NV = constant.Constant( 'GL_SIGNED_HILO8_NV', 0x885F )
  122. GL_FORCE_BLUE_TO_ONE_NV = constant.Constant( 'GL_FORCE_BLUE_TO_ONE_NV', 0x8860 )
  123.  
  124.  
  125. def glInitTextureShader3NV():
  126.     '''Return boolean indicating whether this extension is available'''
  127.     return extensions.hasGLExtension( EXTENSION_NAME )
  128.