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 / specular_fog.py < prev   
Encoding:
Python Source  |  2008-12-07  |  2.0 KB  |  46 lines

  1. '''OpenGL extension WIN.specular_fog
  2.  
  3. Overview (from the spec)
  4.     
  5.     Specularly lit textures enhance the realism of a scene greatly.
  6.     Using the current OpenGL lighting model, one cannot obtain specularly lit 
  7.     textures. This is because in the current OpenGL lighting model lighting
  8.     is done ahead of texturing and texture-functions such as modulate are 
  9.     inadequate for such a simulation. What needs to be addressed is that, 
  10.     somehow an additional interpolant (specular color of that material) needs 
  11.     to be propagated till that stage of the pipeline where texture-mapping is
  12.     performed. This interpolant is then added on to the fragment's color
  13.     resulting from the texturing process before proceeding with the rest of 
  14.     the pipeline.
  15.     
  16.     This can be addressed very easily in software, but hardware
  17.     is not so malleable. Currently most hardware does not support such a
  18.     
  19.     lighting model. However, some current hardware does support fogging,
  20.     which takes place in the pipeline after texturing. This hardware 
  21.     assumes that the fog blend factor f is computed per-vertex and
  22.     interpolates the value across the primitive. The WIN_specular_fog
  23.     extension enables the use of such existing fog circuitry to obtain 
  24.     specularly lit textures without much performance degradation. 
  25.     
  26.     To use it the programmer simply enables the extension with a call to
  27.     Enable with the appropriate enumerant and sets the fog color to the 
  28.     desired specular color.
  29.  
  30. The official definition of this extension is available here:
  31.     http://oss.sgi.com/projects/ogl-sample/registry/WIN/specular_fog.txt
  32.  
  33. Automatically generated by the get_gl_extensions script, do not edit!
  34. '''
  35. from OpenGL import platform, constants, constant, arrays
  36. from OpenGL import extensions
  37. from OpenGL.GL import glget
  38. import ctypes
  39. EXTENSION_NAME = 'GL_WIN_specular_fog'
  40. GL_FOG_SPECULAR_TEXTURE_WIN = constant.Constant( 'GL_FOG_SPECULAR_TEXTURE_WIN', 0x80EC )
  41.  
  42.  
  43. def glInitSpecularFogWIN():
  44.     '''Return boolean indicating whether this extension is available'''
  45.     return extensions.hasGLExtension( EXTENSION_NAME )
  46.