home *** CD-ROM | disk | FTP | other *** search
- '''OpenGL extension NV.register_combiners
-
- Overview (from the spec)
-
- NVIDIA's next-generation graphics processor and its derivative
- designs support an extremely configurable mechanism know as "register
- combiners" for computing fragment colors.
-
- The register combiner mechanism is a significant redesign of NVIDIA's
- original TNT combiner mechanism as introduced by NVIDIA's RIVA
- TNT graphics processor. Familiarity with the TNT combiners will
- help the reader appreciate the greatly enhanced register combiners
- functionality (see the NV_texture_env_combine4 OpenGL extension
- specification for this background). The register combiner mechanism
- has the following enhanced functionality:
-
- The numeric range of combiner computations is from [-1,1]
- (instead of TNT's [0,1] numeric range),
-
- The set of available combiner inputs is expanded to include the
- secondary color, fog color, fog factor, and a second combiner
- constant color (TNT's available combiner inputs consist of
- only zero, a single combiner constant color, the primary color,
- texture 0, texture 1, and, in the case of combiner 1, the result
- of combiner 0).
-
- Each combiner variable input can be independently scaled and
- biased into several possible numeric ranges (TNT can only
- complement combiner inputs).
-
- Each combiner stage computes three distinct outputs (instead
- TNT's single combiner output).
-
- The output operations include support for computing dot products
- (TNT has no support for computing dot products).
-
- After each output operation, there is a configurable scale and bias
- applied (TNT's combiner operations builds in a scale and/or bias
- into some of its combiner operations).
-
- Each input variable for each combiner stage is fetched from any
- entry in a combiner register set. Moreover, the outputs of each
- combiner stage are written into the register set of the subsequent
- combiner stage (TNT could only use the result from combiner 0 as
- a possible input to combiner 1; TNT lacks the notion of an
- input/output register set).
-
- The register combiner mechanism supports at least two general
- combiner stages and then a special final combiner stage appropriate
- for applying a color sum and fog computation (TNT provides two
- simpler combiner stages, and TNT's color sum and fog stages are
- hard-wired and not subsumed by the combiner mechanism as in register
- combiners).
-
- The register combiners fit into the OpenGL pipeline as a rasterization
- processing stage operating in parallel to the traditional OpenGL
- texture environment, color sum, AND fog application. Enabling this
- extension bypasses OpenGL's existing texture environment, color
- sum, and fog application processing and instead use the register
- combiners. The combiner and texture environment state is orthogonal
- so modifying combiner state does not change the traditional OpenGL
- texture environment state and the texture environment state is
- ignored when combiners are enabled.
-
- OpenGL application developers can use the register combiner mechanism
- for very sophisticated shading techniques. For example, an
- approximation of Blinn's bump mapping technique can be achieved with
- the combiner mechanism. Additionally, multi-pass shading models
- that require several passes with unextended OpenGL 1.2 functionality
- can be implemented in several fewer passes with register combiners.
-
- The official definition of this extension is available here:
- http://oss.sgi.com/projects/ogl-sample/registry/NV/register_combiners.txt
-
- Automatically generated by the get_gl_extensions script, do not edit!
- '''
- from OpenGL import platform, constants, constant, arrays
- from OpenGL import extensions
- from OpenGL.GL import glget
- import ctypes
- EXTENSION_NAME = 'GL_NV_register_combiners'
- GL_REGISTER_COMBINERS_NV = constant.Constant( 'GL_REGISTER_COMBINERS_NV', 0x8522 )
- glget.addGLGetConstant( GL_REGISTER_COMBINERS_NV, (1,) )
- GL_VARIABLE_A_NV = constant.Constant( 'GL_VARIABLE_A_NV', 0x8523 )
- GL_VARIABLE_B_NV = constant.Constant( 'GL_VARIABLE_B_NV', 0x8524 )
- GL_VARIABLE_C_NV = constant.Constant( 'GL_VARIABLE_C_NV', 0x8525 )
- GL_VARIABLE_D_NV = constant.Constant( 'GL_VARIABLE_D_NV', 0x8526 )
- GL_VARIABLE_E_NV = constant.Constant( 'GL_VARIABLE_E_NV', 0x8527 )
- GL_VARIABLE_F_NV = constant.Constant( 'GL_VARIABLE_F_NV', 0x8528 )
- GL_VARIABLE_G_NV = constant.Constant( 'GL_VARIABLE_G_NV', 0x8529 )
- GL_CONSTANT_COLOR0_NV = constant.Constant( 'GL_CONSTANT_COLOR0_NV', 0x852A )
- GL_CONSTANT_COLOR1_NV = constant.Constant( 'GL_CONSTANT_COLOR1_NV', 0x852B )
- GL_PRIMARY_COLOR_NV = constant.Constant( 'GL_PRIMARY_COLOR_NV', 0x852C )
- GL_SECONDARY_COLOR_NV = constant.Constant( 'GL_SECONDARY_COLOR_NV', 0x852D )
- GL_SPARE0_NV = constant.Constant( 'GL_SPARE0_NV', 0x852E )
- GL_SPARE1_NV = constant.Constant( 'GL_SPARE1_NV', 0x852F )
- GL_DISCARD_NV = constant.Constant( 'GL_DISCARD_NV', 0x8530 )
- GL_E_TIMES_F_NV = constant.Constant( 'GL_E_TIMES_F_NV', 0x8531 )
- GL_SPARE0_PLUS_SECONDARY_COLOR_NV = constant.Constant( 'GL_SPARE0_PLUS_SECONDARY_COLOR_NV', 0x8532 )
- GL_UNSIGNED_IDENTITY_NV = constant.Constant( 'GL_UNSIGNED_IDENTITY_NV', 0x8536 )
- GL_UNSIGNED_INVERT_NV = constant.Constant( 'GL_UNSIGNED_INVERT_NV', 0x8537 )
- GL_EXPAND_NORMAL_NV = constant.Constant( 'GL_EXPAND_NORMAL_NV', 0x8538 )
- GL_EXPAND_NEGATE_NV = constant.Constant( 'GL_EXPAND_NEGATE_NV', 0x8539 )
- GL_HALF_BIAS_NORMAL_NV = constant.Constant( 'GL_HALF_BIAS_NORMAL_NV', 0x853A )
- GL_HALF_BIAS_NEGATE_NV = constant.Constant( 'GL_HALF_BIAS_NEGATE_NV', 0x853B )
- GL_SIGNED_IDENTITY_NV = constant.Constant( 'GL_SIGNED_IDENTITY_NV', 0x853C )
- GL_SIGNED_NEGATE_NV = constant.Constant( 'GL_SIGNED_NEGATE_NV', 0x853D )
- GL_SCALE_BY_TWO_NV = constant.Constant( 'GL_SCALE_BY_TWO_NV', 0x853E )
- GL_SCALE_BY_FOUR_NV = constant.Constant( 'GL_SCALE_BY_FOUR_NV', 0x853F )
- GL_SCALE_BY_ONE_HALF_NV = constant.Constant( 'GL_SCALE_BY_ONE_HALF_NV', 0x8540 )
- GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = constant.Constant( 'GL_BIAS_BY_NEGATIVE_ONE_HALF_NV', 0x8541 )
- GL_COMBINER_INPUT_NV = constant.Constant( 'GL_COMBINER_INPUT_NV', 0x8542 )
- GL_COMBINER_MAPPING_NV = constant.Constant( 'GL_COMBINER_MAPPING_NV', 0x8543 )
- GL_COMBINER_COMPONENT_USAGE_NV = constant.Constant( 'GL_COMBINER_COMPONENT_USAGE_NV', 0x8544 )
- GL_COMBINER_AB_DOT_PRODUCT_NV = constant.Constant( 'GL_COMBINER_AB_DOT_PRODUCT_NV', 0x8545 )
- GL_COMBINER_CD_DOT_PRODUCT_NV = constant.Constant( 'GL_COMBINER_CD_DOT_PRODUCT_NV', 0x8546 )
- GL_COMBINER_MUX_SUM_NV = constant.Constant( 'GL_COMBINER_MUX_SUM_NV', 0x8547 )
- GL_COMBINER_SCALE_NV = constant.Constant( 'GL_COMBINER_SCALE_NV', 0x8548 )
- GL_COMBINER_BIAS_NV = constant.Constant( 'GL_COMBINER_BIAS_NV', 0x8549 )
- GL_COMBINER_AB_OUTPUT_NV = constant.Constant( 'GL_COMBINER_AB_OUTPUT_NV', 0x854A )
- GL_COMBINER_CD_OUTPUT_NV = constant.Constant( 'GL_COMBINER_CD_OUTPUT_NV', 0x854B )
- GL_COMBINER_SUM_OUTPUT_NV = constant.Constant( 'GL_COMBINER_SUM_OUTPUT_NV', 0x854C )
- GL_MAX_GENERAL_COMBINERS_NV = constant.Constant( 'GL_MAX_GENERAL_COMBINERS_NV', 0x854D )
- glget.addGLGetConstant( GL_MAX_GENERAL_COMBINERS_NV, (1,) )
- GL_NUM_GENERAL_COMBINERS_NV = constant.Constant( 'GL_NUM_GENERAL_COMBINERS_NV', 0x854E )
- glget.addGLGetConstant( GL_NUM_GENERAL_COMBINERS_NV, (1,) )
- GL_COLOR_SUM_CLAMP_NV = constant.Constant( 'GL_COLOR_SUM_CLAMP_NV', 0x854F )
- glget.addGLGetConstant( GL_COLOR_SUM_CLAMP_NV, (1,) )
- GL_COMBINER0_NV = constant.Constant( 'GL_COMBINER0_NV', 0x8550 )
- GL_COMBINER1_NV = constant.Constant( 'GL_COMBINER1_NV', 0x8551 )
- GL_COMBINER2_NV = constant.Constant( 'GL_COMBINER2_NV', 0x8552 )
- GL_COMBINER3_NV = constant.Constant( 'GL_COMBINER3_NV', 0x8553 )
- GL_COMBINER4_NV = constant.Constant( 'GL_COMBINER4_NV', 0x8554 )
- GL_COMBINER5_NV = constant.Constant( 'GL_COMBINER5_NV', 0x8555 )
- GL_COMBINER6_NV = constant.Constant( 'GL_COMBINER6_NV', 0x8556 )
- GL_COMBINER7_NV = constant.Constant( 'GL_COMBINER7_NV', 0x8557 )
- glCombinerParameterfvNV = platform.createExtensionFunction(
- 'glCombinerParameterfvNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, arrays.GLfloatArray,),
- doc = 'glCombinerParameterfvNV( GLenum(pname), GLfloatArray(params) ) -> None',
- argNames = ('pname', 'params',),
- )
-
- glCombinerParameterfNV = platform.createExtensionFunction(
- 'glCombinerParameterfNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLfloat,),
- doc = 'glCombinerParameterfNV( GLenum(pname), GLfloat(param) ) -> None',
- argNames = ('pname', 'param',),
- )
-
- glCombinerParameterivNV = platform.createExtensionFunction(
- 'glCombinerParameterivNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, arrays.GLintArray,),
- doc = 'glCombinerParameterivNV( GLenum(pname), GLintArray(params) ) -> None',
- argNames = ('pname', 'params',),
- )
-
- glCombinerParameteriNV = platform.createExtensionFunction(
- 'glCombinerParameteriNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLint,),
- doc = 'glCombinerParameteriNV( GLenum(pname), GLint(param) ) -> None',
- argNames = ('pname', 'param',),
- )
-
- glCombinerInputNV = platform.createExtensionFunction(
- 'glCombinerInputNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum,),
- doc = 'glCombinerInputNV( GLenum(stage), GLenum(portion), GLenum(variable), GLenum(input), GLenum(mapping), GLenum(componentUsage) ) -> None',
- argNames = ('stage', 'portion', 'variable', 'input', 'mapping', 'componentUsage',),
- )
-
- glCombinerOutputNV = platform.createExtensionFunction(
- 'glCombinerOutputNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, constants.GLboolean, constants.GLboolean, constants.GLboolean,),
- doc = 'glCombinerOutputNV( GLenum(stage), GLenum(portion), GLenum(abOutput), GLenum(cdOutput), GLenum(sumOutput), GLenum(scale), GLenum(bias), GLboolean(abDotProduct), GLboolean(cdDotProduct), GLboolean(muxSum) ) -> None',
- argNames = ('stage', 'portion', 'abOutput', 'cdOutput', 'sumOutput', 'scale', 'bias', 'abDotProduct', 'cdDotProduct', 'muxSum',),
- )
-
- glFinalCombinerInputNV = platform.createExtensionFunction(
- 'glFinalCombinerInputNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum,),
- doc = 'glFinalCombinerInputNV( GLenum(variable), GLenum(input), GLenum(mapping), GLenum(componentUsage) ) -> None',
- argNames = ('variable', 'input', 'mapping', 'componentUsage',),
- )
-
- glGetCombinerInputParameterfvNV = platform.createExtensionFunction(
- 'glGetCombinerInputParameterfvNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, arrays.GLfloatArray,),
- doc = 'glGetCombinerInputParameterfvNV( GLenum(stage), GLenum(portion), GLenum(variable), GLenum(pname), GLfloatArray(params) ) -> None',
- argNames = ('stage', 'portion', 'variable', 'pname', 'params',),
- )
-
- glGetCombinerInputParameterivNV = platform.createExtensionFunction(
- 'glGetCombinerInputParameterivNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, constants.GLenum, arrays.GLintArray,),
- doc = 'glGetCombinerInputParameterivNV( GLenum(stage), GLenum(portion), GLenum(variable), GLenum(pname), GLintArray(params) ) -> None',
- argNames = ('stage', 'portion', 'variable', 'pname', 'params',),
- )
-
- glGetCombinerOutputParameterfvNV = platform.createExtensionFunction(
- 'glGetCombinerOutputParameterfvNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, arrays.GLfloatArray,),
- doc = 'glGetCombinerOutputParameterfvNV( GLenum(stage), GLenum(portion), GLenum(pname), GLfloatArray(params) ) -> None',
- argNames = ('stage', 'portion', 'pname', 'params',),
- )
-
- glGetCombinerOutputParameterivNV = platform.createExtensionFunction(
- 'glGetCombinerOutputParameterivNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, constants.GLenum, arrays.GLintArray,),
- doc = 'glGetCombinerOutputParameterivNV( GLenum(stage), GLenum(portion), GLenum(pname), GLintArray(params) ) -> None',
- argNames = ('stage', 'portion', 'pname', 'params',),
- )
-
- glGetFinalCombinerInputParameterfvNV = platform.createExtensionFunction(
- 'glGetFinalCombinerInputParameterfvNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, arrays.GLfloatArray,),
- doc = 'glGetFinalCombinerInputParameterfvNV( GLenum(variable), GLenum(pname), GLfloatArray(params) ) -> None',
- argNames = ('variable', 'pname', 'params',),
- )
-
- glGetFinalCombinerInputParameterivNV = platform.createExtensionFunction(
- 'glGetFinalCombinerInputParameterivNV', dll=platform.GL,
- extension=EXTENSION_NAME,
- resultType=None,
- argTypes=(constants.GLenum, constants.GLenum, arrays.GLintArray,),
- doc = 'glGetFinalCombinerInputParameterivNV( GLenum(variable), GLenum(pname), GLintArray(params) ) -> None',
- argNames = ('variable', 'pname', 'params',),
- )
-
-
- def glInitRegisterCombinersNV():
- '''Return boolean indicating whether this extension is available'''
- return extensions.hasGLExtension( EXTENSION_NAME )
-