Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MESA_sprite_point.spec 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. XXX - Not complete yet!!!
  2. Name
  3. MESA_sprite_point
  4. Name Strings
  5. GL_MESA_sprite_point
  6. Contact
  7. Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
  8. Status
  9. Not yet shipping.
  10. Version
  11. $Id: MESA_sprite_point.spec,v 1.1 2000/12/08 00:21:02 brianp Exp $
  12. Number
  13. ???
  14. Dependencies
  15. GL_EXT_point_parameters effects the definition of this extension
  16. GL_ARB_multitexture effects the definition of this extension
  17. Overview
  18. This extension modifies the way in which points are rendered,
  19. specifically when they're textured. When SPRITE_POINT_MESA is enabled
  20. a point is rendered as if it were a quadrilateral with unique texture
  21. coordinates at each vertex. This extension effectively turns points
  22. into sprites which may be rendered more easily and quickly than using
  23. conventional textured quadrilaterals.
  24. When using point size > 1 or attenuated points this extension is an
  25. effective way to render many small sprite images for particle systems
  26. or other effects.
  27. Issues:
  28. 1. How are the texture coordinates computed?
  29. The lower-left corner has texture coordinate (0,0,r,q).
  30. The lower-right, (1,0,r,q). The upper-right, (1,1,r,q).
  31. The upper-left, (0,1,r,q).
  32. 2. What about texgen and texture matrices?
  33. Texgen and the texture matrix have no effect on the point's s and t
  34. texture coordinates. The r and q coordinates may have been computed
  35. by texgen or the texture matrix. Note that with a 3D texture and/or
  36. texgen that the r coordinate could be used to select a slice in the
  37. 3D texture.
  38. 3. What about point smoothing?
  39. When point smoothing is enabled, a triangle fan could be rendered
  40. to approximate a circular point. This could be problematic to
  41. define and implement so POINT_SMOOTH is ignored when drawing sprite
  42. points.
  43. Smoothed points can be approximated by using an appropriate texture
  44. images, alpha testing and blending.
  45. POLYGON_SMOOTH does effect the rendering of the quadrilateral, however.
  46. 4. What about sprite rotation?
  47. There is none. Sprite points are always rendered as window-aligned
  48. squares. One could define rotated texture images if desired. A 3D
  49. texture and appropriate texture r coordinates could be used to
  50. effectively specify image rotation per point.
  51. 5. What about POLYGON_MODE?
  52. POLYGON_MODE does not effect the rasterization of the quadrilateral.
  53. 6. What about POLYGON_CULL?
  54. TBD. Polygon culling is normally specified and implemented in the
  55. transformation stage of OpenGL. However, some rasterization hardware
  56. implements it later during triangle setup.
  57. Polygon culling wouldn't be useful for sprite points since the
  58. quadrilaterals are always defined in counter-clockwise order in
  59. window space. For that reason, polygon culling should probably be
  60. ignored.
  61. 7. Should sprite points be alpha-attenuated if their size is below the
  62. point parameter's threshold size?
  63. 8. Should there be an advertisized maximum sprite point size?
  64. No. Since we're rendering the point as a quadrilateral there's no
  65. need to limit the size.
  66. New Procedures and Functions
  67. None.
  68. New Tokens
  69. Accepted by the <pname> parameter of Enable, Disable, IsEnabled,
  70. GetIntegerv, GetBooleanv, GetFloatv and GetDoublev:
  71. SPRITE_POINT_MESA 0x????
  72. MAX_SPRITE_POINT_SIZE_MESA 0x???? (need this?)
  73. Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
  74. None
  75. Additions to Chapter 3 of the 1.1 Specification (Rasterization)
  76. Section ???.
  77. When SPRITE_POINT_MESA is enabled points are rasterized as screen-
  78. aligned quadrilaterals. If the four vertices of the quadrilateral
  79. are labeled A, B, C, and D, starting at the lower-left corner and moving
  80. counter-clockwise around the quadrilateral, then the vertex and
  81. texture coordinates are computed as follows:
  82. vertex window coordinate texture coordinate
  83. A (x-r, y-r, z, w) (0, 0, r, q)
  84. B (x+r, y-r, z, w) (1, 0, r, q)
  85. C (x+r, y+r, z, w) (1, 1, r, q)
  86. D (x-r, y+r, z, w) (0, 1, r, q)
  87. where x, y, z, w are the point's window coordinates, r and q are the
  88. point's 3rd and 4th texture coordinates and r is half the point's
  89. size. The other vertex attributes (such as the color and fog coordinate)
  90. are simply duplicated from the original point vertex.
  91. Point size may either be specified with PointSize or computed
  92. according to the EXT_point_parameters extension.
  93. The new texture coordinates are not effected by texgen or the texture
  94. matrix. Note, however, that the texture r and q coordinates are passed
  95. unchanged and may have been computed with texgen and/or the texture
  96. matrix.
  97. If multiple texture units are present the same texture coordinate is
  98. used for all texture units.
  99. The point is then rendered as if it were a quadrilateral using the
  100. normal point sampling rules. POLYGON_MODE does not effect the
  101. rasterization of the quadrilateral but POLYGON_SMOOTH does.
  102. POINT_SMOOTH has no effect when SPRITE_POINT_MESA is enabled.
  103. Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
  104. and the Frame Buffer)
  105. None.
  106. Additions to Chapter 5 of the 1.1 Specification (Special Functions)
  107. None
  108. Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
  109. None
  110. Additions to the GLX Specification
  111. None
  112. GLX Protocol
  113. TBD
  114. Errors
  115. None
  116. New State
  117. Add boolean variable SPRITE_POINT_MESA to the point attribute group.
  118. Revision History
  119. Version 1.0 - 4 Dec 2000
  120. Original draft.