float_buffer.py :  » Game-2D-3D » PyOpenGL » PyOpenGL-3.0.1 » OpenGL » GL » NV » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Game 2D 3D » PyOpenGL 
PyOpenGL » PyOpenGL 3.0.1 » OpenGL » GL » NV » float_buffer.py
'''OpenGL extension NV.float_buffer

This module customises the behaviour of the 
OpenGL.raw.GL.NV.float_buffer to provide a more 
Python-friendly API

Overview (from thespec import 
  
  This extension builds upon NV_fragment_program to provide a framebuffer
  and texture format that allows fragment programs to read and write
  unconstrained floating point data.
  
  In unextended OpenGL, most computations dealing with color or depth
  buffers are typically constrained to operate on values in the range [0,1].
  Computational results are also typically clamped to the range [0,1].
  Color, texture, and depth buffers themselves also hold values mapped to
  the range [0,1].
  
  The NV_fragment_program extension provides a general computational model
  that supports floating-point numbers constrained only by the precision of
  the underlying data types.  The quantites computed by fragment programs do
  not necessarily correspond in number or in range to conventional
  attributes such as RGBA colors or depth values.  Because of the range and
  precision constraints imposed by conventional fixed-point color buffers,
  it may be difficult (if not impossible) to use them to implement certain
  multi-pass algorithms.
  
  To enhance the extended range and precision available through fragment
  programs, this extension provides floating-point RGBA color buffers that
  can be used instead of conventional fixed-point RGBA color buffers.  A
  floating-point RGBA color buffer consists of one to four floating-point
  components stored in the 16- or 32-bit floating-point formats (fp16 or
  fp32) defined in the NV_half_float and NV_fragment_program extensions.
  
  When a floating-point color buffer is used, the results of fragment
  programs, as written to the "x", "y", "z", and "w" components of the
  o[COLR] or o[COLH] output registers, are written directly to the color
  buffer without any clamping or modification.  Certain per-fragment
  operations are bypassed when rendering to floating-point color buffers.
  
  A floating-point color buffer can also be used as a texture map, either by
  reading back the contents and then using conventional TexImage calls, or
  by using the buffer directly via the ARB_render_texture extension or
  the EXT_framebuffer_object extension.
  
  This extension has many uses.  Some possible uses include:
  
      (1) Multi-pass algorithms with arbitrary intermediate results that
          don't have to be artifically forced into the range [0,1].  In
          addition, intermediate results can be written without having to
          worry about out-of-range values.
  
      (2) Deferred shading algorithms where an expensive fragment program is
          executed only after depth testing is fully complete.  Instead, a
          simple program is executed, which stores the parameters necessary
          to produce a final result.  After the entire scene is rendered, a
          second pass is executed over the entire frame buffer to execute
          the complex fragment program using the results written to the
          floating-point color buffer in the first pass.  This will save the
          cost of applying complex fragment programs to fragments that will
          not appear in the final image.
  
      (3) Use floating-point texture maps to evaluate functions with
          arbitrary ranges.  Arbitrary functions with a finite domain can be
          approximated using a texture map holding sample results and
          piecewise linear approximation.
  
  There are several significant limitations on the use of floating-point
  color buffers.  First, floating-point color buffers do not support frame
  buffer blending.  Second, floating-point texture maps do not support
  mipmapping or any texture filtering other than NEAREST.  Third,
  floating-point texture maps must be 2D, and must use the
  NV_texture_rectangle extension.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/NV/float_buffer.txt
'''
from OpenGL import platform,constants,constant,arrays
from OpenGL import extensions,wrapper
from OpenGL.GL import glget
import ctypes
from OpenGL.raw.GL.NV.float_buffer import *
### END AUTOGENERATED SECTION
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.