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 / WIN / phong_shading.py < prev    next >
Encoding:
Python Source  |  2008-12-07  |  1.3 KB  |  36 lines

  1. '''OpenGL extension WIN.phong_shading
  2.  
  3. Overview (from the spec)
  4.     
  5.     WIN_phong_shading enables rendering Phong shaded primitives using OpenGL.
  6.     Phong shading is a well known shading technique documented 
  7.     in most graphics texts. 
  8.     
  9.     As opposed to Gouraud (or smooth) shading, which simply calculates the 
  10.     normals at the vertices and then interpolates the colors of the pixels, 
  11.     Phong shading involves interpolating an individual normal for every pixel,
  12.     and then applying the shading model to each pixel based on its normal 
  13.     component. 
  14.     
  15.     While Phong shading requires substantially more computation than does 
  16.     Gouraud shading, the resulting images are more realistic, especially if the
  17.     primitives are large. 
  18.  
  19. The official definition of this extension is available here:
  20.     http://oss.sgi.com/projects/ogl-sample/registry/WIN/phong_shading.txt
  21.  
  22. Automatically generated by the get_gl_extensions script, do not edit!
  23. '''
  24. from OpenGL import platform, constants, constant, arrays
  25. from OpenGL import extensions
  26. from OpenGL.GL import glget
  27. import ctypes
  28. EXTENSION_NAME = 'GL_WIN_phong_shading'
  29. GL_PHONG_WIN = constant.Constant( 'GL_PHONG_WIN', 0x80EA )
  30. GL_PHONG_HINT_WIN = constant.Constant( 'GL_PHONG_HINT_WIN', 0x80EB )
  31.  
  32.  
  33. def glInitPhongShadingWIN():
  34.     '''Return boolean indicating whether this extension is available'''
  35.     return extensions.hasGLExtension( EXTENSION_NAME )
  36.