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 / depth_clamp.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  2.3 KB  |  51 lines

  1. '''OpenGL extension NV.depth_clamp
  2.  
  3. Overview (from the spec)
  4.     
  5.     Conventional OpenGL clips geometric primitives to a clip volume
  6.     with six faces, two of which are the near and far clip planes.
  7.     Clipping to the near and far planes of the clip volume ensures that
  8.     interpolated depth values (after the depth range transform) must be
  9.     in the [0,1] range.
  10.     
  11.     In some rendering applications such as shadow volumes, it is useful
  12.     to allow line and polygon primitives to be rasterized without
  13.     clipping the primitive to the near or far clip volume planes (side
  14.     clip volume planes clip normally).  Without the near and far clip
  15.     planes, rasterization (pixel coverage determination) in X and Y
  16.     can proceed normally if we ignore the near and far clip planes.
  17.     The one major issue is that fragments of a  primitive may extend
  18.     beyond the conventional window space depth range for depth values
  19.     (typically the range [0,1]).  Rather than discarding fragments that
  20.     defy the window space depth range (effectively what near and far
  21.     plane clipping accomplish), the depth values can be clamped to the
  22.     current depth range.
  23.     
  24.     This extension provides exactly such functionality.  This
  25.     functionality is useful to obviate the need for near plane capping
  26.     of stenciled shadow volumes.  The functionality may also be useful
  27.     for rendering geometry "beyond" the far plane if an alternative
  28.     algorithm (rather than depth testing) for hidden surface removal is
  29.     applied to such geometry (specifically, the painter's algorithm).
  30.     Similar situations at the near clip plane can be avoided at the
  31.     near clip plane where apparently solid objects can be "seen through"
  32.     if they intersect the near clip plane.
  33.  
  34. The official definition of this extension is available here:
  35.     http://oss.sgi.com/projects/ogl-sample/registry/NV/depth_clamp.txt
  36.  
  37. Automatically generated by the get_gl_extensions script, do not edit!
  38. '''
  39. from OpenGL import platform, constants, constant, arrays
  40. from OpenGL import extensions
  41. from OpenGL.GL import glget
  42. import ctypes
  43. EXTENSION_NAME = 'GL_NV_depth_clamp'
  44. GL_DEPTH_CLAMP_NV = constant.Constant( 'GL_DEPTH_CLAMP_NV', 0x864F )
  45. glget.addGLGetConstant( GL_DEPTH_CLAMP_NV, (1,) )
  46.  
  47.  
  48. def glInitDepthClampNV():
  49.     '''Return boolean indicating whether this extension is available'''
  50.     return extensions.hasGLExtension( EXTENSION_NAME )
  51.