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 / vertex_program2.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  4.4 KB  |  113 lines

  1. '''OpenGL extension NV.vertex_program2
  2.  
  3. Overview (from the spec)
  4.     
  5.     This extension further enhances the concept of vertex programmability
  6.     introduced by the NV_vertex_program extension, and extended by
  7.     NV_vertex_program1_1.  These extensions create a separate vertex program
  8.     mode where the configurable vertex transformation operations in unextended
  9.     OpenGL are replaced by a user-defined program.
  10.     
  11.     This extension introduces the VP2 execution environment, which extends the
  12.     VP1 execution environment introduced in NV_vertex_program.  The VP2
  13.     environment provides several language features not present in previous
  14.     vertex programming execution environments:
  15.     
  16.       * Branch instructions allow a program to jump to another instruction
  17.         specified in the program.
  18.     
  19.       * Branching support allows for up to four levels of subroutine
  20.         calls/returns.
  21.     
  22.       * A four-component condition code register allows an application to
  23.         compute a component-wise write mask at run time and apply that mask to
  24.         register writes.  
  25.     
  26.       * Conditional branches are supported, where the condition code register
  27.         is used to determine if a branch should be taken.
  28.     
  29.       * Programmable user clipping is supported support (via the CLP0-CLP5
  30.         clip distance registers).  Primitives are clipped to the area where
  31.         the interpolated clip distances are greater than or equal to zero.
  32.     
  33.       * Instructions can perform a component-wise absolute value operation on
  34.         any operand load.
  35.     
  36.     The VP2 execution environment provides a number of new instructions, and
  37.     extends the semantics of several instructions already defined in
  38.     NV_vertex_program.
  39.     
  40.       * ARR:  Operates like ARL, except that float-to-int conversion is done
  41.         by rounding.  Equivalent results could be achieved (less efficiently)
  42.         in NV_vertex program using an ADD/ARL sequence and a program parameter
  43.         holding the value 0.5.
  44.     
  45.       * BRA, CAL, RET:  Branch, subroutine call, and subroutine return
  46.         instructions.
  47.     
  48.       * COS, SIN:  Adds support for high-precision sine and cosine
  49.         computations.
  50.     
  51.       * FLR, FRC:  Adds support for computing the floor and fractional portion
  52.         of floating-point vector components.  Equivalent results could be
  53.         achieved (less efficiently) in NV_vertex_program using the EXP
  54.         instruction to compute the fractional portion of one component at a
  55.         time.
  56.     
  57.       * EX2, LG2:  Adds support for high-precision exponentiation and
  58.         logarithm computations.
  59.     
  60.       * ARA:  Adds pairs of components of an address register; useful for
  61.         looping and other operations.
  62.     
  63.       * SEQ, SFL, SGT, SLE, SNE, STR:  Add six new "set on" instructions,
  64.         similar to the SLT and SGE instructions defined in NV_vertex_program.
  65.         Equivalent results could be achieved (less efficiently) in
  66.         NV_vertex_program with multiple SLT, SGE, and arithmetic instructions.
  67.     
  68.       * SSG:  Adds a new "set sign" operation, which produces a vector holding
  69.         negative one for negative components, zero for components with a value
  70.         of zero, and positive one for positive components.  Equivalent results
  71.         could be achieved (less efficiently) in NV_vertex_program with
  72.         multiple SLT, SGE, and arithmetic instructions.
  73.     
  74.       * The ARL instruction is extended to operate on four components instead
  75.         of a single component.
  76.     
  77.       * All instructions that produce integer or floating-point result vectors
  78.         have variants that update the condition code register based on the
  79.         result vector.
  80.     
  81.     This extension also raises some of the resource limitations in the
  82.     NV_vertex_program extension.
  83.     
  84.       * 256 program parameter registers (versus 96 in NV_vertex_program).
  85.     
  86.       * 16 temporary registers (versus 12 in NV_vertex_program).
  87.     
  88.       * Two four-component integer address registers (versus one
  89.         single-component register in NV_vertex_program).
  90.     
  91.       * 256 total vertex program instructions (versus 128 in
  92.         NV_vertex_program).
  93.     
  94.       * Including loops, programs can execute up to 64K instructions.
  95.     
  96.  
  97. The official definition of this extension is available here:
  98.     http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_program2.txt
  99.  
  100. Automatically generated by the get_gl_extensions script, do not edit!
  101. '''
  102. from OpenGL import platform, constants, constant, arrays
  103. from OpenGL import extensions
  104. from OpenGL.GL import glget
  105. import ctypes
  106. EXTENSION_NAME = 'GL_NV_vertex_program2'
  107.  
  108.  
  109.  
  110. def glInitVertexProgram2NV():
  111.     '''Return boolean indicating whether this extension is available'''
  112.     return extensions.hasGLExtension( EXTENSION_NAME )
  113.