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 / texgen_emboss.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  1.7 KB  |  41 lines

  1. '''OpenGL extension NV.texgen_emboss
  2.  
  3. Overview (from the spec)
  4.     
  5.     This extension provides a new texture coordinate generation mode
  6.     suitable for multitexture-based embossing (or bump mapping) effects.
  7.     
  8.     Given two texture units, this extension generates the texture
  9.     coordinates of a second texture unit (an odd-numbered texture unit)
  10.     as a perturbation of a first texture unit (an even-numbered texture
  11.     unit one less than the second texture unit).  The perturbation is
  12.     based on the normal, tangent, and light vectors.  The normal vector
  13.     is supplied by glNormal; the light vector is supplied as a direction
  14.     vector to a specified OpenGL light's position; and the tanget
  15.     vector is supplied by the second texture unit's current texture
  16.     coordinate.  The perturbation is also scaled by program-supplied
  17.     scaling constants.
  18.     
  19.     If both texture units are bound to the same texture representing a
  20.     height field, by subtracting the difference between the resulting two
  21.     filtered texels, programs can achieve a per-pixel embossing effect.
  22.  
  23. The official definition of this extension is available here:
  24.     http://oss.sgi.com/projects/ogl-sample/registry/NV/texgen_emboss.txt
  25.  
  26. Automatically generated by the get_gl_extensions script, do not edit!
  27. '''
  28. from OpenGL import platform, constants, constant, arrays
  29. from OpenGL import extensions
  30. from OpenGL.GL import glget
  31. import ctypes
  32. EXTENSION_NAME = 'GL_NV_texgen_emboss'
  33. GL_EMBOSS_LIGHT_NV = constant.Constant( 'GL_EMBOSS_LIGHT_NV', 0x855D )
  34. GL_EMBOSS_CONSTANT_NV = constant.Constant( 'GL_EMBOSS_CONSTANT_NV', 0x855E )
  35. GL_EMBOSS_MAP_NV = constant.Constant( 'GL_EMBOSS_MAP_NV', 0x855F )
  36.  
  37.  
  38. def glInitTexgenEmbossNV():
  39.     '''Return boolean indicating whether this extension is available'''
  40.     return extensions.hasGLExtension( EXTENSION_NAME )
  41.