PageRenderTime 51ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/Labo12/venv/Lib/site-packages/OpenGL/GL/EXT/gpu_shader4.py

https://bitbucket.org/jakubzahradnikath/grafika-komputerowa
Python | 147 lines | 116 code | 0 blank | 31 comment | 0 complexity | 6f5699e04472b7325da4257abe569da4 MD5 | raw file
  1. '''OpenGL extension EXT.gpu_shader4
  2. This module customises the behaviour of the
  3. OpenGL.raw.GL.EXT.gpu_shader4 to provide a more
  4. Python-friendly API
  5. Overview (from the spec)
  6. This extension provides a set of new features to the OpenGL Shading
  7. Language and related APIs to support capabilities of new hardware. In
  8. particular, this extension provides the following functionality:
  9. * New texture lookup functions are provided that allow shaders to
  10. access individual texels using integer coordinates referring to the
  11. texel location and level of detail. No filtering is performed. These
  12. functions allow applications to use textures as one-, two-, and
  13. three-dimensional arrays.
  14. * New texture lookup functions are provided that allow shaders to query
  15. the dimensions of a specific level-of-detail image of a texture
  16. object.
  17. * New texture lookup functions variants are provided that allow shaders
  18. to pass a constant integer vector used to offset the texel locations
  19. used during the lookup to assist in custom texture filtering
  20. operations.
  21. * New texture lookup functions are provided that allow shaders to
  22. access one- and two-dimensional array textures. The second, or third,
  23. coordinate is used to select the layer of the array to access.
  24. * New "Grad" texture lookup functions are provided that allow shaders
  25. to explicitely pass in derivative values which are used by the GL to
  26. compute the level-of-detail when performing a texture lookup.
  27. * A new texture lookup function is provided to access a buffer texture.
  28. * The existing absolute LOD texture lookup functions are no longer
  29. restricted to the vertex shader only.
  30. * The ability to specify and use cubemap textures with a
  31. DEPTH_COMPONENT internal format. This also enables shadow mapping on
  32. cubemaps. The 'q' coordinate is used as the reference value for
  33. comparisons. A set of new texture lookup functions is provided to
  34. lookup into shadow cubemaps.
  35. * The ability to specify if varying variables are interpolated in a
  36. non-perspective correct manner, if they are flat shaded or, if
  37. multi-sampling, if centroid sampling should be performed.
  38. * Full signed integer and unsigned integer support in the OpenGL
  39. Shading Language:
  40. - Integers are defined as 32 bit values using two's complement.
  41. - Unsigned integers and vectors thereof are added.
  42. - New texture lookup functions are provided that return integer
  43. values. These functions are to be used in conjunction with new
  44. texture formats whose components are actual integers, rather
  45. than integers that encode a floating-point value. To support
  46. these lookup functions, new integer and unsigned-integer
  47. sampler types are introduced.
  48. - Integer bitwise operators are now enabled.
  49. - Several built-in functions and operators now operate on
  50. integers or vectors of integers.
  51. - New vertex attribute functions are added that load integer
  52. attribute data and can be referenced in a vertex shader as
  53. integer data.
  54. - New uniform loading commands are added to load unsigned integer
  55. data.
  56. - Varying variables can now be (unsigned) integers. If declared
  57. as such, they have to be flat shaded.
  58. - Fragment shaders can define their own output variables, and
  59. declare them to be of type floating-point, integer or unsigned
  60. integer. These variables are bound to a fragment color index
  61. with the new API command BindFragDataLocationEXT(), and directed
  62. to buffers using the existing DrawBuffer or DrawBuffers API
  63. commands.
  64. * Added new built-in functions truncate() and round() to the shading
  65. language.
  66. * A new built-in variable accessible from within vertex shaders that
  67. holds the index <i> implicitly passed to ArrayElement to specify the
  68. vertex. This is called the vertex ID.
  69. * A new built-in variable accessible from within fragment and geometry
  70. shaders that hold the index of the currently processed
  71. primitive. This is called the primitive ID.
  72. This extension also briefly mentions a new shader type, called a geometry
  73. shader. A geometry shader is run after vertices are transformed, but
  74. before clipping. A geometry shader begins with a single primitive (point,
  75. line, triangle. It can read the attributes of any of the vertices in the
  76. primitive and use them to generate new primitives. A geometry shader has a
  77. fixed output primitive type (point, line strip, or triangle strip) and
  78. emits vertices to define a new primitive. Geometry shaders are discussed
  79. in detail in the GL_EXT_geometry_shader4 specification.
  80. The official definition of this extension is available here:
  81. http://www.opengl.org/registry/specs/EXT/gpu_shader4.txt
  82. '''
  83. from OpenGL import platform, constant, arrays
  84. from OpenGL import extensions, wrapper
  85. import ctypes
  86. from OpenGL.raw.GL import _types, _glgets
  87. from OpenGL.raw.GL.EXT.gpu_shader4 import *
  88. from OpenGL.raw.GL.EXT.gpu_shader4 import _EXTENSION_NAME
  89. def glInitGpuShader4EXT():
  90. '''Return boolean indicating whether this extension is available'''
  91. from OpenGL import extensions
  92. return extensions.hasGLExtension( _EXTENSION_NAME )
  93. # OUTPUT glGetUniformuivEXT.params COMPSIZE(program,location)
  94. # INPUT glBindFragDataLocationEXT.name size not checked against 'name'
  95. glBindFragDataLocationEXT=wrapper.wrapper(glBindFragDataLocationEXT).setInputArraySize(
  96. 'name', None
  97. )
  98. # INPUT glGetFragDataLocationEXT.name size not checked against 'name'
  99. glGetFragDataLocationEXT=wrapper.wrapper(glGetFragDataLocationEXT).setInputArraySize(
  100. 'name', None
  101. )
  102. # INPUT glUniform1uivEXT.value size not checked against count
  103. glUniform1uivEXT=wrapper.wrapper(glUniform1uivEXT).setInputArraySize(
  104. 'value', None
  105. )
  106. # INPUT glUniform2uivEXT.value size not checked against None
  107. glUniform2uivEXT=wrapper.wrapper(glUniform2uivEXT).setInputArraySize(
  108. 'value', None
  109. )
  110. # INPUT glUniform3uivEXT.value size not checked against None
  111. glUniform3uivEXT=wrapper.wrapper(glUniform3uivEXT).setInputArraySize(
  112. 'value', None
  113. )
  114. # INPUT glUniform4uivEXT.value size not checked against None
  115. glUniform4uivEXT=wrapper.wrapper(glUniform4uivEXT).setInputArraySize(
  116. 'value', None
  117. )
  118. ### END AUTOGENERATED SECTION