File: texture_shader3.py

package info (click to toggle)
pyopengl 3.0.0~b6-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,696 kB
  • ctags: 26,182
  • sloc: python: 34,233; ansic: 70; sh: 26; makefile: 15
file content (127 lines) | stat: -rw-r--r-- 6,311 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
'''OpenGL extension NV.texture_shader3

Overview (from the spec)
	
	NV_texture_shader3 extends the NV_texture_shader functionality by
	adding several new texture shader operations, extending several
	existing texture shader operations, adding a new HILO8 internal
	format, and adding new and more flexible re-mapping modes for dot
	product and dependent texture shader operations.
	
	See the NV_texture_shader extension for information about the
	texture shader operational model.
	
	The fourteen new texture shader operations are:
	
	<offset textures>
	
	24.  OFFSET_PROJECTIVE_TEXTURE_2D_NV - Transforms the signed (ds,dt)
	     components of a previous texture unit by a 2x2 floating-point
	     matrix and then uses the result to offset the stage's texture
	     coordinates for a 2D non-projective texture.
	
	25.  OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV - Same as above except
	     the magnitude component of the previous texture unit result
	     scales the red, green, and blue components of the unsigned RGBA
	     texture 2D access.
	
	26.  OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV - Similar to
	     OFFSET_TEXTURE_2D_NV except that the texture access is into a
	     rectangular non-projective texture.
	
	27.  OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV - Similar to
	     OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV except that the texture
	     access is into a rectangular non-projective texture.
	
	28.  OFFSET_HILO_TEXTURE_2D_NV - Similar to OFFSET_TEXTURE_2D_NV
	     but uses a (higher-precision) HILO base format texture rather
	     than a DSDT-type base format.
	
	29.  OFFSET_HILO_TEXTURE_RECTANGLE_NV - Similar to
	     OFFSET_TEXTURE_RECTANGLE_NV but uses a (higher-precision)
	     HILO base format texture rather than a DSDT-type base format.
	
	30.  OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV - Similar to
	     OFFSET_PROJECTIVE_TEXTURE_2D_NV but uses a (higher-precision)
	     HILO base format texture rather than a DSDT-type base format.
	
	31.  OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV - Similar to
	     OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV but uses a
	     (higher-precision) HILO base format texture rather than a
	     DSDT-type base format.
	
	     (There are no "offset HILO texture scale" operations because
	     HILO textures have only two components with no third component
	     for scaling.)
	
	<dependent textures>
	
	32.  DEPENDENT_HILO_TEXTURE_2D_NV - Converts the hi and lo components
	     of a previous shader HILO result into an (s,t) texture coordinate
	     set to access a 2D non-projective texture.
	
	33.  DEPENDENT_RGB_TEXTURE_3D_NV - Converts the red, green, and
	     blue components of a previous shader RGBA result into an (s,t,r)
	     texture coordinate set to access a 3D non-projective texture.
	
	34.  DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV - Converts the red, green,
	     and blue components of a previous shader RGBA result into an
	     (s,t,r) texture coordinate set to access a cube map texture.
	
	<dot product textures>
	
	35.  DOT_PRODUCT_TEXTURE_1D_NV - Computes a dot product in the manner
	     of the DOT_PRODUCT_NV operation and uses the result as the s
	     texture coordinate to access a 2D non-projective texture.
	
	36.  DOT_PRODUCT_PASS_THROUGH_NV - Computes a dot product in the
	     manner of the DOT_PRODUCT_NV operation and the result is [0,1]
	     clamped and smeared to generate the texture unit RGBA result.
	
	<dot product depth replace>
	
	37.  DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV - Computes a dot product
	     in the manner of the DOT_PRODUCT_NV operation and the result
	     is [0,1] clamped and replaces the fragment's window-space
	     depth value.  The texture unit RGBA result is (0,0,0,0).
	
	Two new internal texture formats have been added: HILO8_NV and
	SIGNED_HILO8_NV.  These texture formats allow HILO textures to be
	stored in half the space; still the filtering for these internal
	texture formats is done with 16-bit precision.
	
	One new unsigned RGBA dot product mapping mode (FORCE_BLUE_TO_ONE_NV)
	forces the blue component to be 1.0 before computing a dot product.

The official definition of this extension is available here:
	http://oss.sgi.com/projects/ogl-sample/registry/NV/texture_shader3.txt

Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_NV_texture_shader3'
GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = constant.Constant( 'GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV', 0x8850 )
GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = constant.Constant( 'GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV', 0x8851 )
GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = constant.Constant( 'GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV', 0x8852 )
GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = constant.Constant( 'GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV', 0x8853 )
GL_OFFSET_HILO_TEXTURE_2D_NV = constant.Constant( 'GL_OFFSET_HILO_TEXTURE_2D_NV', 0x8854 )
GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = constant.Constant( 'GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV', 0x8855 )
GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = constant.Constant( 'GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV', 0x8856 )
GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = constant.Constant( 'GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV', 0x8857 )
GL_DEPENDENT_HILO_TEXTURE_2D_NV = constant.Constant( 'GL_DEPENDENT_HILO_TEXTURE_2D_NV', 0x8858 )
GL_DEPENDENT_RGB_TEXTURE_3D_NV = constant.Constant( 'GL_DEPENDENT_RGB_TEXTURE_3D_NV', 0x8859 )
GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = constant.Constant( 'GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV', 0x885A )
GL_DOT_PRODUCT_PASS_THROUGH_NV = constant.Constant( 'GL_DOT_PRODUCT_PASS_THROUGH_NV', 0x885B )
GL_DOT_PRODUCT_TEXTURE_1D_NV = constant.Constant( 'GL_DOT_PRODUCT_TEXTURE_1D_NV', 0x885C )
GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = constant.Constant( 'GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV', 0x885D )
GL_HILO8_NV = constant.Constant( 'GL_HILO8_NV', 0x885E )
GL_SIGNED_HILO8_NV = constant.Constant( 'GL_SIGNED_HILO8_NV', 0x885F )
GL_FORCE_BLUE_TO_ONE_NV = constant.Constant( 'GL_FORCE_BLUE_TO_ONE_NV', 0x8860 )


def glInitTextureShader3NV():
	'''Return boolean indicating whether this extension is available'''
	return extensions.hasGLExtension( EXTENSION_NAME )