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 / register_combiners.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  13.2 KB  |  258 lines

  1. '''OpenGL extension NV.register_combiners
  2.  
  3. Overview (from the spec)
  4.     
  5.     NVIDIA's next-generation graphics processor and its derivative
  6.     designs support an extremely configurable mechanism know as "register
  7.     combiners" for computing fragment colors.
  8.     
  9.     The register combiner mechanism is a significant redesign of NVIDIA's
  10.     original TNT combiner mechanism as introduced by NVIDIA's RIVA
  11.     TNT graphics processor.  Familiarity with the TNT combiners will
  12.     help the reader appreciate the greatly enhanced register combiners
  13.     functionality (see the NV_texture_env_combine4 OpenGL extension
  14.     specification for this background).  The register combiner mechanism
  15.     has the following enhanced functionality: 
  16.     
  17.       The numeric range of combiner computations is from [-1,1]
  18.       (instead of TNT's [0,1] numeric range),
  19.     
  20.       The set of available combiner inputs is expanded to include the
  21.       secondary color, fog color, fog factor, and a second combiner
  22.       constant color (TNT's available combiner inputs consist of
  23.       only zero, a single combiner constant color, the primary color,
  24.       texture 0, texture 1, and, in the case of combiner 1, the result
  25.       of combiner 0).
  26.     
  27.       Each combiner variable input can be independently scaled and
  28.       biased into several possible numeric ranges (TNT can only
  29.       complement combiner inputs).
  30.     
  31.       Each combiner stage computes three distinct outputs (instead
  32.       TNT's single combiner output).
  33.     
  34.       The output operations include support for computing dot products
  35.       (TNT has no support for computing dot products).
  36.     
  37.       After each output operation, there is a configurable scale and bias
  38.       applied (TNT's combiner operations builds in a scale and/or bias
  39.       into some of its combiner operations).
  40.     
  41.       Each input variable for each combiner stage is fetched from any
  42.       entry in a combiner register set.  Moreover, the outputs of each
  43.       combiner stage are written into the register set of the subsequent
  44.       combiner stage (TNT could only use the result from combiner 0 as
  45.       a possible input to combiner 1; TNT lacks the notion of an
  46.       input/output register set).
  47.     
  48.       The register combiner mechanism supports at least two general
  49.       combiner stages and then a special final combiner stage appropriate
  50.       for applying a color sum and fog computation (TNT provides two
  51.       simpler combiner stages, and TNT's color sum and fog stages are
  52.       hard-wired and not subsumed by the combiner mechanism as in register
  53.       combiners).
  54.     
  55.     The register combiners fit into the OpenGL pipeline as a rasterization
  56.     processing stage operating in parallel to the traditional OpenGL
  57.     texture environment, color sum, AND fog application.  Enabling this
  58.     extension bypasses OpenGL's existing texture environment, color
  59.     sum, and fog application processing and instead use the register
  60.     combiners.  The combiner and texture environment state is orthogonal
  61.     so modifying combiner state does not change the traditional OpenGL
  62.     texture environment state and the texture environment state is
  63.     ignored when combiners are enabled.
  64.     
  65.     OpenGL application developers can use the register combiner mechanism
  66.     for very sophisticated shading techniques.  For example, an
  67.     approximation of Blinn's bump mapping technique can be achieved with
  68.     the combiner mechanism.  Additionally, multi-pass shading models
  69.     that require several passes with unextended OpenGL 1.2 functionality
  70.     can be implemented in several fewer passes with register combiners.
  71.  
  72. The official definition of this extension is available here:
  73.     http://oss.sgi.com/projects/ogl-sample/registry/NV/register_combiners.txt
  74.  
  75. Automatically generated by the get_gl_extensions script, do not edit!
  76. '''
  77. from OpenGL import platform, constants, constant, arrays
  78. from OpenGL import extensions
  79. from OpenGL.GL import glget
  80. import ctypes
  81. EXTENSION_NAME = 'GL_NV_register_combiners'
  82. GL_REGISTER_COMBINERS_NV = constant.Constant( 'GL_REGISTER_COMBINERS_NV', 0x8522 )
  83. glget.addGLGetConstant( GL_REGISTER_COMBINERS_NV, (1,) )
  84. GL_VARIABLE_A_NV = constant.Constant( 'GL_VARIABLE_A_NV', 0x8523 )
  85. GL_VARIABLE_B_NV = constant.Constant( 'GL_VARIABLE_B_NV', 0x8524 )
  86. GL_VARIABLE_C_NV = constant.Constant( 'GL_VARIABLE_C_NV', 0x8525 )
  87. GL_VARIABLE_D_NV = constant.Constant( 'GL_VARIABLE_D_NV', 0x8526 )
  88. GL_VARIABLE_E_NV = constant.Constant( 'GL_VARIABLE_E_NV', 0x8527 )
  89. GL_VARIABLE_F_NV = constant.Constant( 'GL_VARIABLE_F_NV', 0x8528 )
  90. GL_VARIABLE_G_NV = constant.Constant( 'GL_VARIABLE_G_NV', 0x8529 )
  91. GL_CONSTANT_COLOR0_NV = constant.Constant( 'GL_CONSTANT_COLOR0_NV', 0x852A )
  92. GL_CONSTANT_COLOR1_NV = constant.Constant( 'GL_CONSTANT_COLOR1_NV', 0x852B )
  93. GL_PRIMARY_COLOR_NV = constant.Constant( 'GL_PRIMARY_COLOR_NV', 0x852C )
  94. GL_SECONDARY_COLOR_NV = constant.Constant( 'GL_SECONDARY_COLOR_NV', 0x852D )
  95. GL_SPARE0_NV = constant.Constant( 'GL_SPARE0_NV', 0x852E )
  96. GL_SPARE1_NV = constant.Constant( 'GL_SPARE1_NV', 0x852F )
  97. GL_DISCARD_NV = constant.Constant( 'GL_DISCARD_NV', 0x8530 )
  98. GL_E_TIMES_F_NV = constant.Constant( 'GL_E_TIMES_F_NV', 0x8531 )
  99. GL_SPARE0_PLUS_SECONDARY_COLOR_NV = constant.Constant( 'GL_SPARE0_PLUS_SECONDARY_COLOR_NV', 0x8532 )
  100. GL_UNSIGNED_IDENTITY_NV = constant.Constant( 'GL_UNSIGNED_IDENTITY_NV', 0x8536 )
  101. GL_UNSIGNED_INVERT_NV = constant.Constant( 'GL_UNSIGNED_INVERT_NV', 0x8537 )
  102. GL_EXPAND_NORMAL_NV = constant.Constant( 'GL_EXPAND_NORMAL_NV', 0x8538 )
  103. GL_EXPAND_NEGATE_NV = constant.Constant( 'GL_EXPAND_NEGATE_NV', 0x8539 )
  104. GL_HALF_BIAS_NORMAL_NV = constant.Constant( 'GL_HALF_BIAS_NORMAL_NV', 0x853A )
  105. GL_HALF_BIAS_NEGATE_NV = constant.Constant( 'GL_HALF_BIAS_NEGATE_NV', 0x853B )
  106. GL_SIGNED_IDENTITY_NV = constant.Constant( 'GL_SIGNED_IDENTITY_NV', 0x853C )
  107. GL_SIGNED_NEGATE_NV = constant.Constant( 'GL_SIGNED_NEGATE_NV', 0x853D )
  108. GL_SCALE_BY_TWO_NV = constant.Constant( 'GL_SCALE_BY_TWO_NV', 0x853E )
  109. GL_SCALE_BY_FOUR_NV = constant.Constant( 'GL_SCALE_BY_FOUR_NV', 0x853F )
  110. GL_SCALE_BY_ONE_HALF_NV = constant.Constant( 'GL_SCALE_BY_ONE_HALF_NV', 0x8540 )
  111. GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = constant.Constant( 'GL_BIAS_BY_NEGATIVE_ONE_HALF_NV', 0x8541 )
  112. GL_COMBINER_INPUT_NV = constant.Constant( 'GL_COMBINER_INPUT_NV', 0x8542 )
  113. GL_COMBINER_MAPPING_NV = constant.Constant( 'GL_COMBINER_MAPPING_NV', 0x8543 )
  114. GL_COMBINER_COMPONENT_USAGE_NV = constant.Constant( 'GL_COMBINER_COMPONENT_USAGE_NV', 0x8544 )
  115. GL_COMBINER_AB_DOT_PRODUCT_NV = constant.Constant( 'GL_COMBINER_AB_DOT_PRODUCT_NV', 0x8545 )
  116. GL_COMBINER_CD_DOT_PRODUCT_NV = constant.Constant( 'GL_COMBINER_CD_DOT_PRODUCT_NV', 0x8546 )
  117. GL_COMBINER_MUX_SUM_NV = constant.Constant( 'GL_COMBINER_MUX_SUM_NV', 0x8547 )
  118. GL_COMBINER_SCALE_NV = constant.Constant( 'GL_COMBINER_SCALE_NV', 0x8548 )
  119. GL_COMBINER_BIAS_NV = constant.Constant( 'GL_COMBINER_BIAS_NV', 0x8549 )
  120. GL_COMBINER_AB_OUTPUT_NV = constant.Constant( 'GL_COMBINER_AB_OUTPUT_NV', 0x854A )
  121. GL_COMBINER_CD_OUTPUT_NV = constant.Constant( 'GL_COMBINER_CD_OUTPUT_NV', 0x854B )
  122. GL_COMBINER_SUM_OUTPUT_NV = constant.Constant( 'GL_COMBINER_SUM_OUTPUT_NV', 0x854C )
  123. GL_MAX_GENERAL_COMBINERS_NV = constant.Constant( 'GL_MAX_GENERAL_COMBINERS_NV', 0x854D )
  124. glget.addGLGetConstant( GL_MAX_GENERAL_COMBINERS_NV, (1,) )
  125. GL_NUM_GENERAL_COMBINERS_NV = constant.Constant( 'GL_NUM_GENERAL_COMBINERS_NV', 0x854E )
  126. glget.addGLGetConstant( GL_NUM_GENERAL_COMBINERS_NV, (1,) )
  127. GL_COLOR_SUM_CLAMP_NV = constant.Constant( 'GL_COLOR_SUM_CLAMP_NV', 0x854F )
  128. glget.addGLGetConstant( GL_COLOR_SUM_CLAMP_NV, (1,) )
  129. GL_COMBINER0_NV = constant.Constant( 'GL_COMBINER0_NV', 0x8550 )
  130. GL_COMBINER1_NV = constant.Constant( 'GL_COMBINER1_NV', 0x8551 )
  131. GL_COMBINER2_NV = constant.Constant( 'GL_COMBINER2_NV', 0x8552 )
  132. GL_COMBINER3_NV = constant.Constant( 'GL_COMBINER3_NV', 0x8553 )
  133. GL_COMBINER4_NV = constant.Constant( 'GL_COMBINER4_NV', 0x8554 )
  134. GL_COMBINER5_NV = constant.Constant( 'GL_COMBINER5_NV', 0x8555 )
  135. GL_COMBINER6_NV = constant.Constant( 'GL_COMBINER6_NV', 0x8556 )
  136. GL_COMBINER7_NV = constant.Constant( 'GL_COMBINER7_NV', 0x8557 )
  137. glCombinerParameterfvNV = platform.createExtensionFunction( 
  138.     'glCombinerParameterfvNV', dll=platform.GL,
  139.     extension=EXTENSION_NAME,
  140.     resultType=None, 
  141.     argTypes=(constants.GLenum, arrays.GLfloatArray,),
  142.     doc = 'glCombinerParameterfvNV( GLenum(pname), GLfloatArray(params) ) -> None',
  143.     argNames = ('pname', 'params',),
  144. )
  145.  
  146. glCombinerParameterfNV = platform.createExtensionFunction( 
  147.     'glCombinerParameterfNV', dll=platform.GL,
  148.     extension=EXTENSION_NAME,
  149.     resultType=None, 
  150.     argTypes=(constants.GLenum, constants.GLfloat,),
  151.     doc = 'glCombinerParameterfNV( GLenum(pname), GLfloat(param) ) -> None',
  152.     argNames = ('pname', 'param',),
  153. )
  154.  
  155. glCombinerParameterivNV = platform.createExtensionFunction( 
  156.     'glCombinerParameterivNV', dll=platform.GL,
  157.     extension=EXTENSION_NAME,
  158.     resultType=None, 
  159.     argTypes=(constants.GLenum, arrays.GLintArray,),
  160.     doc = 'glCombinerParameterivNV( GLenum(pname), GLintArray(params) ) -> None',
  161.     argNames = ('pname', 'params',),
  162. )
  163.  
  164. glCombinerParameteriNV = platform.createExtensionFunction( 
  165.     'glCombinerParameteriNV', dll=platform.GL,
  166.     extension=EXTENSION_NAME,
  167.     resultType=None, 
  168.     argTypes=(constants.GLenum, constants.GLint,),
  169.     doc = 'glCombinerParameteriNV( GLenum(pname), GLint(param) ) -> None',
  170.     argNames = ('pname', 'param',),
  171. )
  172.  
  173. glCombinerInputNV = platform.createExtensionFunction( 
  174.     'glCombinerInputNV', dll=platform.GL,
  175.     extension=EXTENSION_NAME,
  176.     resultType=None, 
  177.     argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum,),
  178.     doc = 'glCombinerInputNV( GLenum(stage), GLenum(portion), GLenum(variable), GLenum(input), GLenum(mapping), GLenum(componentUsage) ) -> None',
  179.     argNames = ('stage', 'portion', 'variable', 'input', 'mapping', 'componentUsage',),
  180. )
  181.  
  182. glCombinerOutputNV = platform.createExtensionFunction( 
  183.     'glCombinerOutputNV', dll=platform.GL,
  184.     extension=EXTENSION_NAME,
  185.     resultType=None, 
  186.     argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLboolean, constants.GLboolean, constants.GLboolean,),
  187.     doc = 'glCombinerOutputNV( GLenum(stage), GLenum(portion), GLenum(abOutput), GLenum(cdOutput), GLenum(sumOutput), GLenum(scale), GLenum(bias), GLboolean(abDotProduct), GLboolean(cdDotProduct), GLboolean(muxSum) ) -> None',
  188.     argNames = ('stage', 'portion', 'abOutput', 'cdOutput', 'sumOutput', 'scale', 'bias', 'abDotProduct', 'cdDotProduct', 'muxSum',),
  189. )
  190.  
  191. glFinalCombinerInputNV = platform.createExtensionFunction( 
  192.     'glFinalCombinerInputNV', dll=platform.GL,
  193.     extension=EXTENSION_NAME,
  194.     resultType=None, 
  195.     argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum,),
  196.     doc = 'glFinalCombinerInputNV( GLenum(variable), GLenum(input), GLenum(mapping), GLenum(componentUsage) ) -> None',
  197.     argNames = ('variable', 'input', 'mapping', 'componentUsage',),
  198. )
  199.  
  200. glGetCombinerInputParameterfvNV = platform.createExtensionFunction( 
  201.     'glGetCombinerInputParameterfvNV', dll=platform.GL,
  202.     extension=EXTENSION_NAME,
  203.     resultType=None, 
  204.     argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, arrays.GLfloatArray,),
  205.     doc = 'glGetCombinerInputParameterfvNV( GLenum(stage), GLenum(portion), GLenum(variable), GLenum(pname), GLfloatArray(params) ) -> None',
  206.     argNames = ('stage', 'portion', 'variable', 'pname', 'params',),
  207. )
  208.  
  209. glGetCombinerInputParameterivNV = platform.createExtensionFunction( 
  210.     'glGetCombinerInputParameterivNV', dll=platform.GL,
  211.     extension=EXTENSION_NAME,
  212.     resultType=None, 
  213.     argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, arrays.GLintArray,),
  214.     doc = 'glGetCombinerInputParameterivNV( GLenum(stage), GLenum(portion), GLenum(variable), GLenum(pname), GLintArray(params) ) -> None',
  215.     argNames = ('stage', 'portion', 'variable', 'pname', 'params',),
  216. )
  217.  
  218. glGetCombinerOutputParameterfvNV = platform.createExtensionFunction( 
  219.     'glGetCombinerOutputParameterfvNV', dll=platform.GL,
  220.     extension=EXTENSION_NAME,
  221.     resultType=None, 
  222.     argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, arrays.GLfloatArray,),
  223.     doc = 'glGetCombinerOutputParameterfvNV( GLenum(stage), GLenum(portion), GLenum(pname), GLfloatArray(params) ) -> None',
  224.     argNames = ('stage', 'portion', 'pname', 'params',),
  225. )
  226.  
  227. glGetCombinerOutputParameterivNV = platform.createExtensionFunction( 
  228.     'glGetCombinerOutputParameterivNV', dll=platform.GL,
  229.     extension=EXTENSION_NAME,
  230.     resultType=None, 
  231.     argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, arrays.GLintArray,),
  232.     doc = 'glGetCombinerOutputParameterivNV( GLenum(stage), GLenum(portion), GLenum(pname), GLintArray(params) ) -> None',
  233.     argNames = ('stage', 'portion', 'pname', 'params',),
  234. )
  235.  
  236. glGetFinalCombinerInputParameterfvNV = platform.createExtensionFunction( 
  237.     'glGetFinalCombinerInputParameterfvNV', dll=platform.GL,
  238.     extension=EXTENSION_NAME,
  239.     resultType=None, 
  240.     argTypes=(constants.GLenum, constants.GLenum, arrays.GLfloatArray,),
  241.     doc = 'glGetFinalCombinerInputParameterfvNV( GLenum(variable), GLenum(pname), GLfloatArray(params) ) -> None',
  242.     argNames = ('variable', 'pname', 'params',),
  243. )
  244.  
  245. glGetFinalCombinerInputParameterivNV = platform.createExtensionFunction( 
  246.     'glGetFinalCombinerInputParameterivNV', dll=platform.GL,
  247.     extension=EXTENSION_NAME,
  248.     resultType=None, 
  249.     argTypes=(constants.GLenum, constants.GLenum, arrays.GLintArray,),
  250.     doc = 'glGetFinalCombinerInputParameterivNV( GLenum(variable), GLenum(pname), GLintArray(params) ) -> None',
  251.     argNames = ('variable', 'pname', 'params',),
  252. )
  253.  
  254.  
  255. def glInitRegisterCombinersNV():
  256.     '''Return boolean indicating whether this extension is available'''
  257.     return extensions.hasGLExtension( EXTENSION_NAME )
  258.