Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glPointSize</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glPointSize"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glPointSize — specify the diameter of rasterized points</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glPointSize</b>(</code></td><td>GLfloat </td><td><var class="pdparam">size</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p> | |
4 | Specifies the diameter of rasterized points. | |
5 | The initial value is 1. | |
6 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
7 | <code class="function">glPointSize</code> specifies the rasterized diameter of both aliased and antialiased | |
8 | points. Using a point size other than 1 has different effects, depending | |
9 | on whether point antialiasing is enabled. To enable and disable point | |
10 | antialiasing, call <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and <a class="citerefentry" href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a> with argument | |
11 | <code class="constant">GL_POINT_SMOOTH</code>. Point antialiasing is initially disabled. | |
12 | </p><p> | |
13 | The specified point size is multiplied with a distance attenuation factor | |
14 | and clamped to the specified point size range, and further clamped to the | |
15 | implementation-dependent point size range to produce the derived point size | |
16 | using | |
17 | </p><p> | |
18 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
19 | ||
20 | <mml:mrow> | |
21 | <mml:mi mathvariant="italic">pointSize</mml:mi> | |
22 | <mml:mo>=</mml:mo> | |
23 | <mml:mrow> | |
24 | <mml:mi mathvariant="italic">clamp</mml:mi> | |
25 | <mml:mo></mml:mo> | |
26 | <mml:mfenced open="(" close=")"> | |
27 | <mml:mrow> | |
28 | <mml:mi mathvariant="italic">size</mml:mi> | |
29 | <mml:mo>×</mml:mo> | |
30 | <mml:msqrt> | |
31 | <mml:mfenced open="" close=""> | |
32 | <mml:mfenced open="(" close=")"> | |
33 | <mml:mfrac> | |
34 | <mml:mn>1</mml:mn> | |
35 | <mml:mfenced open="" close=""> | |
36 | <mml:mrow> | |
37 | <mml:mi mathvariant="italic">a</mml:mi> | |
38 | <mml:mo>+</mml:mo> | |
39 | <mml:mrow> | |
40 | <mml:mi mathvariant="italic">b</mml:mi> | |
41 | <mml:mo>×</mml:mo> | |
42 | <mml:mi mathvariant="italic">d</mml:mi> | |
43 | </mml:mrow> | |
44 | <mml:mo>+</mml:mo> | |
45 | <mml:mrow> | |
46 | <mml:mi mathvariant="italic">c</mml:mi> | |
47 | <mml:mo>×</mml:mo> | |
48 | <mml:mfenced open="" close=""> | |
49 | <mml:msup><mml:mi mathvariant="italic">d</mml:mi> | |
50 | <mml:mn>2</mml:mn> | |
51 | </mml:msup> | |
52 | </mml:mfenced> | |
53 | </mml:mrow> | |
54 | </mml:mrow> | |
55 | </mml:mfenced> | |
56 | </mml:mfrac> | |
57 | </mml:mfenced> | |
58 | </mml:mfenced> | |
59 | </mml:msqrt> | |
60 | </mml:mrow> | |
61 | </mml:mfenced> | |
62 | </mml:mrow> | |
63 | </mml:mrow> | |
64 | </mml:math></div><p> | |
65 | </p><p> | |
66 | where | |
67 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">d</mml:mi></mml:math> | |
68 | is the eye-coordinate distance from the eye to the vertex, and | |
69 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">a</mml:mi></mml:math>, | |
70 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">b</mml:mi></mml:math>, | |
71 | and | |
72 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">c</mml:mi></mml:math> | |
73 | are the distance attenuation coefficients (see | |
74 | <a class="citerefentry" href="glPointParameter.xml"><span class="citerefentry"><span class="refentrytitle">glPointParameter</span></span></a>). | |
75 | </p><p> | |
76 | If multisampling is disabled, the computed point size is used as the | |
77 | point's width. | |
78 | </p><p> | |
79 | If multisampling is enabled, the point may be faded by modifying the point | |
80 | alpha value (see <a class="citerefentry" href="glSampleCoverage.xml"><span class="citerefentry"><span class="refentrytitle">glSampleCoverage</span></span></a>) instead of allowing the point width | |
81 | to go below a given threshold (see <a class="citerefentry" href="glPointParameter.xml"><span class="citerefentry"><span class="refentrytitle">glPointParameter</span></span></a>). In this case, | |
82 | the width is further modified in the following manner: | |
83 | </p><p> | |
84 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
85 | ||
86 | <mml:mrow> | |
87 | <mml:mi mathvariant="italic">pointWidth</mml:mi> | |
88 | <mml:mo>=</mml:mo> | |
89 | <mml:mfenced open="{" close=""> | |
90 | <mml:mrow> | |
91 | <mml:mtable> | |
92 | <mml:mtr><mml:mtd> | |
93 | <mml:mi mathvariant="italic">pointSize</mml:mi> | |
94 | </mml:mtd></mml:mtr> | |
95 | <mml:mtr><mml:mtd> | |
96 | <mml:mi mathvariant="italic">threshold</mml:mi> | |
97 | </mml:mtd></mml:mtr> | |
98 | </mml:mtable> | |
99 | <mml:mo></mml:mo> | |
100 | <mml:mtable> | |
101 | <mml:mtr><mml:mtd> | |
102 | <mml:mrow> | |
103 | <mml:mi mathvariant="italic">pointSize</mml:mi> | |
104 | <mml:mo>>=</mml:mo> | |
105 | <mml:mi mathvariant="italic">threshold</mml:mi> | |
106 | </mml:mrow> | |
107 | </mml:mtd></mml:mtr> | |
108 | <mml:mtr><mml:mtd> | |
109 | <mml:mi mathvariant="italic">otherwise</mml:mi> | |
110 | </mml:mtd></mml:mtr> | |
111 | </mml:mtable> | |
112 | </mml:mrow> | |
113 | </mml:mfenced> | |
114 | </mml:mrow> | |
115 | </mml:math></div><p> | |
116 | </p><p> | |
117 | The point alpha value is modified by computing: | |
118 | </p><p> | |
119 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
120 | ||
121 | <mml:mrow> | |
122 | <mml:mi mathvariant="italic">pointAlpha</mml:mi> | |
123 | <mml:mo>=</mml:mo> | |
124 | <mml:mfenced open="{" close=""> | |
125 | <mml:mrow> | |
126 | <mml:mtable> | |
127 | <mml:mtr><mml:mtd> | |
128 | <mml:mn>1</mml:mn> | |
129 | </mml:mtd></mml:mtr> | |
130 | <mml:mtr><mml:mtd> | |
131 | <mml:msup><mml:mfenced open="(" close=")"> | |
132 | <mml:mfrac> | |
133 | <mml:mi mathvariant="italic">pointSize</mml:mi> | |
134 | <mml:mi mathvariant="italic">threshold</mml:mi> | |
135 | </mml:mfrac> | |
136 | </mml:mfenced> | |
137 | <mml:mn>2</mml:mn> | |
138 | </mml:msup> | |
139 | </mml:mtd></mml:mtr> | |
140 | </mml:mtable> | |
141 | <mml:mo></mml:mo> | |
142 | <mml:mtable> | |
143 | <mml:mtr><mml:mtd> | |
144 | <mml:mrow> | |
145 | <mml:mi mathvariant="italic">pointSize</mml:mi> | |
146 | <mml:mo>>=</mml:mo> | |
147 | <mml:mi mathvariant="italic">threshold</mml:mi> | |
148 | </mml:mrow> | |
149 | </mml:mtd></mml:mtr> | |
150 | <mml:mtr><mml:mtd> | |
151 | <mml:mi mathvariant="italic">otherwise</mml:mi> | |
152 | </mml:mtd></mml:mtr> | |
153 | </mml:mtable> | |
154 | </mml:mrow> | |
155 | </mml:mfenced> | |
156 | </mml:mrow> | |
157 | </mml:math></div><p> | |
158 | </p><p> | |
159 | If point antialiasing is disabled, the actual size is determined by | |
160 | rounding the supplied size to the nearest integer. (If the rounding | |
161 | results in the value 0, it is as if the point size were 1.) If the rounded | |
162 | size is odd, then the center point | |
163 | (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
164 | ||
165 | <mml:mi mathvariant="italic">x</mml:mi> | |
166 | </mml:math>, | |
167 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
168 | ||
169 | <mml:mi mathvariant="italic">y</mml:mi> | |
170 | </mml:math>) | |
171 | of the pixel fragment | |
172 | that represents the point is computed as | |
173 | </p><p> | |
174 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
175 | ||
176 | <mml:mfenced open="(" close=")"> | |
177 | <mml:mrow> | |
178 | <mml:mfenced open="⌊" close="⌋"> | |
179 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
180 | <mml:mi mathvariant="italic">w</mml:mi> | |
181 | </mml:msub> | |
182 | </mml:mfenced> | |
183 | <mml:mo>+</mml:mo> | |
184 | <mml:mn>.5</mml:mn> | |
185 | </mml:mrow> | |
186 | <mml:mrow> | |
187 | <mml:mfenced open="⌊" close="⌋"> | |
188 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
189 | <mml:mi mathvariant="italic">w</mml:mi> | |
190 | </mml:msub> | |
191 | </mml:mfenced> | |
192 | <mml:mo>+</mml:mo> | |
193 | <mml:mn>.5</mml:mn> | |
194 | </mml:mrow> | |
195 | </mml:mfenced> | |
196 | </mml:math> | |
197 | </p><p> | |
198 | where | |
199 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math> | |
200 | subscripts indicate window coordinates. All pixels that lie | |
201 | within the square grid of the rounded size centered at | |
202 | (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
203 | ||
204 | <mml:mi mathvariant="italic">x</mml:mi> | |
205 | </mml:math>, | |
206 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
207 | ||
208 | <mml:mi mathvariant="italic">y</mml:mi> | |
209 | </mml:math>) | |
210 | make | |
211 | up the fragment. If the size is even, the center point is | |
212 | </p><p> | |
213 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
214 | ||
215 | <mml:mfenced open="(" close=")"> | |
216 | <mml:mfenced open="⌊" close="⌋"> | |
217 | <mml:mrow> | |
218 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
219 | <mml:mi mathvariant="italic">w</mml:mi> | |
220 | </mml:msub> | |
221 | <mml:mo>+</mml:mo> | |
222 | <mml:mn>.5</mml:mn> | |
223 | </mml:mrow> | |
224 | </mml:mfenced> | |
225 | <mml:mfenced open="⌊" close="⌋"> | |
226 | <mml:mrow> | |
227 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
228 | <mml:mi mathvariant="italic">w</mml:mi> | |
229 | </mml:msub> | |
230 | <mml:mo>+</mml:mo> | |
231 | <mml:mn>.5</mml:mn> | |
232 | </mml:mrow> | |
233 | </mml:mfenced> | |
234 | </mml:mfenced> | |
235 | </mml:math> | |
236 | </p><p> | |
237 | and the rasterized fragment's centers are the half-integer window | |
238 | coordinates within the square of the rounded size centered at | |
239 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
240 | ||
241 | <mml:mfenced open="(" close=")"> | |
242 | <mml:mi mathvariant="italic">x</mml:mi> | |
243 | <mml:mi mathvariant="italic">y</mml:mi> | |
244 | </mml:mfenced> | |
245 | </mml:math>. | |
246 | All pixel fragments produced in rasterizing a nonantialiased point are | |
247 | assigned the same associated data, that of the vertex corresponding to the | |
248 | point. | |
249 | </p><p> | |
250 | If antialiasing is enabled, then point rasterization produces a fragment | |
251 | for each pixel square that intersects the region lying within the circle | |
252 | having diameter equal to the current point size and centered at the point's | |
253 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
254 | ||
255 | <mml:mfenced open="(" close=")"> | |
256 | <mml:msub><mml:mi mathvariant="italic">x</mml:mi> | |
257 | <mml:mi mathvariant="italic">w</mml:mi> | |
258 | </mml:msub> | |
259 | <mml:msub><mml:mi mathvariant="italic">y</mml:mi> | |
260 | <mml:mi mathvariant="italic">w</mml:mi> | |
261 | </mml:msub> | |
262 | </mml:mfenced> | |
263 | </mml:math>. | |
264 | The coverage value for each fragment is the | |
265 | window coordinate area of the intersection of the circular region with the | |
266 | corresponding pixel square. This value is saved and used in the final | |
267 | rasterization step. The data associated with each fragment is the data | |
268 | associated with the point being rasterized. | |
269 | </p><p> | |
270 | Not all sizes are supported when point antialiasing is enabled. If an | |
271 | unsupported size is requested, the nearest supported size is used. Only | |
272 | size 1 is guaranteed to be supported; others depend on the implementation. | |
273 | To query the range of supported sizes and the size difference between | |
274 | supported sizes within the range, call <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with arguments | |
275 | <code class="constant">GL_SMOOTH_POINT_SIZE_RANGE</code> and <code class="constant">GL_SMOOTH_POINT_SIZE_GRANULARITY</code>. | |
276 | For aliased points, query the supported ranges and granularity with | |
277 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with arguments <code class="constant">GL_ALIASED_POINT_SIZE_RANGE</code>. | |
278 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
279 | The point size specified by <code class="function">glPointSize</code> is always returned when | |
280 | <code class="constant">GL_POINT_SIZE</code> is queried. Clamping and rounding for aliased and | |
281 | antialiased points have no effect on the specified value. | |
282 | </p><p> | |
283 | A non-antialiased point size may be clamped to an implementation-dependent | |
284 | maximum. Although this maximum cannot be queried, it must be no less than | |
285 | the maximum value for antialiased points, rounded to the nearest integer | |
286 | value. | |
287 | </p><p> | |
288 | <code class="constant">GL_POINT_SIZE_RANGE</code> and <code class="constant">GL_POINT_SIZE_GRANULARITY</code> are | |
289 | deprecated in GL versions 1.2 and greater. Their functionality has been | |
290 | replaced by <code class="constant">GL_SMOOTH_POINT_SIZE_RANGE</code> and | |
291 | <code class="constant">GL_SMOOTH_POINT_SIZE_GRANULARITY</code>. | |
292 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
293 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>size</code></em> is less than or equal to 0. | |
294 | </p><p> | |
295 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glPointSize</code> | |
296 | is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> | |
297 | and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
298 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
299 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_ALIASED_POINT_SIZE_RANGE</code> | |
300 | </p><p> | |
301 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_SIZE</code> | |
302 | </p><p> | |
303 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_SIZE_MIN</code> | |
304 | </p><p> | |
305 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_SIZE_MAX</code> | |
306 | </p><p> | |
307 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_FADE_THRESHOLD_SIZE</code> | |
308 | </p><p> | |
309 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POINT_DISTANCE_ATTENUATION</code> | |
310 | </p><p> | |
311 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_SMOOTH_POINT_SIZE_RANGE</code> | |
312 | </p><p> | |
313 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_SMOOTH_POINT_SIZE_GRANULARITY</code> | |
314 | </p><p> | |
315 | <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_POINT_SMOOTH</code> | |
316 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
317 | <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>, | |
318 | <a class="citerefentry" href="glPointParameter.xml"><span class="citerefentry"><span class="refentrytitle">glPointParameter</span></span></a> | |
319 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
320 | Copyright <span class="trademark"></span>© 1991-2006 | |
321 | Silicon Graphics, Inc. This document is licensed under the SGI | |
322 | Free Software B License. For details, see | |
323 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
324 | </p></div></div></body></html> |