Add glXAllocateMemoryMESA demo app using ycbcr...
[mesa-demos.git] / docs / MESA_sprite_point.spec
blob9422ff57295c89b50d7d2614adb54102c3e19373
1 Name
3 MESA_sprite_point
5 Name Strings
7 GL_MESA_sprite_point
9 Contact
11 Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
13 Status
15 Obsolete - see GL_ARB_point_sprite.
17 Version
19 $Id: MESA_sprite_point.spec,v 1.2 2003/09/19 14:58:21 brianp Exp $
21 Number
23 ???
25 Dependencies
27 GL_EXT_point_parameters effects the definition of this extension
28 GL_ARB_multitexture effects the definition of this extension
30 Overview
32 This extension modifies the way in which points are rendered,
33 specifically when they're textured. When SPRITE_POINT_MESA is enabled
34 a point is rendered as if it were a quadrilateral with unique texture
35 coordinates at each vertex. This extension effectively turns points
36 into sprites which may be rendered more easily and quickly than using
37 conventional textured quadrilaterals.
39 When using point size > 1 or attenuated points this extension is an
40 effective way to render many small sprite images for particle systems
41 or other effects.
43 Issues:
45 1. How are the texture coordinates computed?
47 The lower-left corner has texture coordinate (0,0,r,q).
48 The lower-right, (1,0,r,q). The upper-right, (1,1,r,q).
49 The upper-left, (0,1,r,q).
51 2. What about texgen and texture matrices?
53 Texgen and the texture matrix have no effect on the point's s and t
54 texture coordinates. The r and q coordinates may have been computed
55 by texgen or the texture matrix. Note that with a 3D texture and/or
56 texgen that the r coordinate could be used to select a slice in the
57 3D texture.
59 3. What about point smoothing?
61 When point smoothing is enabled, a triangle fan could be rendered
62 to approximate a circular point. This could be problematic to
63 define and implement so POINT_SMOOTH is ignored when drawing sprite
64 points.
66 Smoothed points can be approximated by using an appropriate texture
67 images, alpha testing and blending.
69 POLYGON_SMOOTH does effect the rendering of the quadrilateral, however.
71 4. What about sprite rotation?
73 There is none. Sprite points are always rendered as window-aligned
74 squares. One could define rotated texture images if desired. A 3D
75 texture and appropriate texture r coordinates could be used to
76 effectively specify image rotation per point.
78 5. What about POLYGON_MODE?
80 POLYGON_MODE does not effect the rasterization of the quadrilateral.
82 6. What about POLYGON_CULL?
84 TBD. Polygon culling is normally specified and implemented in the
85 transformation stage of OpenGL. However, some rasterization hardware
86 implements it later during triangle setup.
88 Polygon culling wouldn't be useful for sprite points since the
89 quadrilaterals are always defined in counter-clockwise order in
90 window space. For that reason, polygon culling should probably be
91 ignored.
93 7. Should sprite points be alpha-attenuated if their size is below the
94 point parameter's threshold size?
96 8. Should there be an advertisized maximum sprite point size?
98 No. Since we're rendering the point as a quadrilateral there's no
99 need to limit the size.
102 New Procedures and Functions
104 None.
106 New Tokens
108 Accepted by the <pname> parameter of Enable, Disable, IsEnabled,
109 GetIntegerv, GetBooleanv, GetFloatv and GetDoublev:
111 SPRITE_POINT_MESA 0x????
112 MAX_SPRITE_POINT_SIZE_MESA 0x???? (need this?)
114 Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
116 None
118 Additions to Chapter 3 of the 1.1 Specification (Rasterization)
120 Section ???.
122 When SPRITE_POINT_MESA is enabled points are rasterized as screen-
123 aligned quadrilaterals. If the four vertices of the quadrilateral
124 are labeled A, B, C, and D, starting at the lower-left corner and moving
125 counter-clockwise around the quadrilateral, then the vertex and
126 texture coordinates are computed as follows:
128 vertex window coordinate texture coordinate
129 A (x-r, y-r, z, w) (0, 0, r, q)
130 B (x+r, y-r, z, w) (1, 0, r, q)
131 C (x+r, y+r, z, w) (1, 1, r, q)
132 D (x-r, y+r, z, w) (0, 1, r, q)
134 where x, y, z, w are the point's window coordinates, r and q are the
135 point's 3rd and 4th texture coordinates and r is half the point's
136 size. The other vertex attributes (such as the color and fog coordinate)
137 are simply duplicated from the original point vertex.
139 Point size may either be specified with PointSize or computed
140 according to the EXT_point_parameters extension.
142 The new texture coordinates are not effected by texgen or the texture
143 matrix. Note, however, that the texture r and q coordinates are passed
144 unchanged and may have been computed with texgen and/or the texture
145 matrix.
147 If multiple texture units are present the same texture coordinate is
148 used for all texture units.
150 The point is then rendered as if it were a quadrilateral using the
151 normal point sampling rules. POLYGON_MODE does not effect the
152 rasterization of the quadrilateral but POLYGON_SMOOTH does.
154 POINT_SMOOTH has no effect when SPRITE_POINT_MESA is enabled.
156 Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
157 and the Frame Buffer)
159 None.
161 Additions to Chapter 5 of the 1.1 Specification (Special Functions)
163 None
165 Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
167 None
169 Additions to the GLX Specification
171 None
173 GLX Protocol
177 Errors
179 None
181 New State
183 Add boolean variable SPRITE_POINT_MESA to the point attribute group.
185 Revision History
187 Version 1.0 - 4 Dec 2000
188 Original draft.