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