<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"><!-- saved from url=(0013)about:internet -->
<?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.78.1" /></head><body><div class="refentry"><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" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glPointSize</strong>(</code></td><td>GLfloat <var class="pdparam">size</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
                    Specifies the diameter of rasterized points.
                    The initial value is 1.
                </p></dd></dl></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glPointSize</code> specifies the rasterized diameter of both aliased and antialiased
            points.  Using a point size other than 1 has different effects, depending
            on whether point antialiasing is enabled.  To enable and disable point
            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
            <code class="constant">GL_POINT_SMOOTH</code>. Point antialiasing is initially disabled.
        </p><p>
            The specified point size is multiplied with a distance attenuation factor
            and clamped to the specified point size range, and further clamped to the
            implementation-dependent point size range to produce the derived point size
            using
        </p><p>
            </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mrow>
                    <mml:mi mathvariant="italic">pointSize</mml:mi>
                    <mml:mo>=</mml:mo>
                    <mml:mrow>
                        <mml:mi mathvariant="italic">clamp</mml:mi>
                        <mml:mo>⁢</mml:mo>
                        <mml:mfenced open="(" close=")">
                            <mml:mrow>
                                <mml:mi mathvariant="italic">size</mml:mi>
                                <mml:mo>×</mml:mo>
                                <mml:msqrt>
                                    <mml:mfenced open="" close="">
                                        <mml:mfenced open="(" close=")">
                                            <mml:mfrac>
                                                <mml:mn>1</mml:mn>
                                                <mml:mfenced open="" close="">
                                                    <mml:mrow>
                                                        <mml:mi mathvariant="italic">a</mml:mi>
                                                        <mml:mo>+</mml:mo>
                                                        <mml:mrow>
                                                            <mml:mi mathvariant="italic">b</mml:mi>
                                                            <mml:mo>×</mml:mo>
                                                            <mml:mi mathvariant="italic">d</mml:mi>
                                                        </mml:mrow>
                                                        <mml:mo>+</mml:mo>
                                                        <mml:mrow>
                                                            <mml:mi mathvariant="italic">c</mml:mi>
                                                            <mml:mo>×</mml:mo>
                                                            <mml:mfenced open="" close="">
                                                                <mml:msup><mml:mi mathvariant="italic">d</mml:mi>
                                                                <mml:mn>2</mml:mn>
                                                                </mml:msup>
                                                            </mml:mfenced>
                                                        </mml:mrow>
                                                    </mml:mrow>
                                                </mml:mfenced>
                                            </mml:mfrac>
                                        </mml:mfenced>
                                    </mml:mfenced>
                                </mml:msqrt>
                            </mml:mrow>
                        </mml:mfenced>
                    </mml:mrow>
                </mml:mrow>
            </mml:math></div><p>
        </p><p>
            where 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">d</mml:mi></mml:math>
            is the eye-coordinate distance from the eye to the vertex, and
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">a</mml:mi></mml:math>, 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">b</mml:mi></mml:math>,
            and 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">c</mml:mi></mml:math>
            are the distance attenuation coefficients (see
            <a class="citerefentry" href="glPointParameter.xml"><span class="citerefentry"><span class="refentrytitle">glPointParameter</span></span></a>).
        </p><p>
            If multisampling is disabled, the computed point size is used as the
            point's width.
        </p><p>
            If multisampling is enabled, the point may be faded by modifying the point
            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
            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,
            the width is further modified in the following manner:
        </p><p>
            </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mrow>
                    <mml:mi mathvariant="italic">pointWidth</mml:mi>
                    <mml:mo>=</mml:mo>
                    <mml:mfenced open="{" close="">
                        <mml:mrow>
                            <mml:mtable>
                                <mml:mtr><mml:mtd>
                                    <mml:mi mathvariant="italic">pointSize</mml:mi>
                                </mml:mtd></mml:mtr>
                                <mml:mtr><mml:mtd>
                                    <mml:mi mathvariant="italic">threshold</mml:mi>
                                </mml:mtd></mml:mtr>
                            </mml:mtable>
                            <mml:mo>⁢</mml:mo>
                            <mml:mtable>
                                <mml:mtr><mml:mtd>
                                    <mml:mrow>
                                        <mml:mi mathvariant="italic">pointSize</mml:mi>
                                        <mml:mo>&gt;=</mml:mo>
                                        <mml:mi mathvariant="italic">threshold</mml:mi>
                                    </mml:mrow>
                                </mml:mtd></mml:mtr>
                                <mml:mtr><mml:mtd>
                                    <mml:mi mathvariant="italic">otherwise</mml:mi>
                                </mml:mtd></mml:mtr>
                            </mml:mtable>
                        </mml:mrow>
                    </mml:mfenced>
                </mml:mrow>
            </mml:math></div><p>
        </p><p>
            The point alpha value is modified by computing:
        </p><p>
            </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mrow>
                    <mml:mi mathvariant="italic">pointAlpha</mml:mi>
                    <mml:mo>=</mml:mo>
                    <mml:mfenced open="{" close="">
                        <mml:mrow>
                            <mml:mtable>
                                <mml:mtr><mml:mtd>
                                    <mml:mn>1</mml:mn>
                                </mml:mtd></mml:mtr>
                                <mml:mtr><mml:mtd>
                                    <mml:msup><mml:mfenced open="(" close=")">
                                        <mml:mfrac>
                                            <mml:mi mathvariant="italic">pointSize</mml:mi>
                                            <mml:mi mathvariant="italic">threshold</mml:mi>
                                        </mml:mfrac>
                                    </mml:mfenced>
                                    <mml:mn>2</mml:mn>
                                    </mml:msup>
                                </mml:mtd></mml:mtr>
                            </mml:mtable>
                            <mml:mo>⁢</mml:mo>
                            <mml:mtable>
                                <mml:mtr><mml:mtd>
                                    <mml:mrow>
                                        <mml:mi mathvariant="italic">pointSize</mml:mi>
                                        <mml:mo>&gt;=</mml:mo>
                                        <mml:mi mathvariant="italic">threshold</mml:mi>
                                    </mml:mrow>
                                </mml:mtd></mml:mtr>
                                <mml:mtr><mml:mtd>
                                    <mml:mi mathvariant="italic">otherwise</mml:mi>
                                </mml:mtd></mml:mtr>
                            </mml:mtable>
                        </mml:mrow>
                    </mml:mfenced>
                </mml:mrow>
            </mml:math></div><p>
        </p><p>
            If point antialiasing is disabled, the actual size is determined by
            rounding the supplied size to the nearest integer.  (If the rounding
            results in the value 0, it is as if the point size were 1.)  If the rounded
            size is odd, then the center point 
            (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mi mathvariant="italic">x</mml:mi>
            </mml:math>, 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mi mathvariant="italic">y</mml:mi>
            </mml:math>)
            of the pixel fragment
            that represents the point is computed as
        </p><p>
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mfenced open="(" close=")">
                    <mml:mrow>
                        <mml:mfenced open="⌊" close="⌋">
                            <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
                            <mml:mi mathvariant="italic">w</mml:mi>
                            </mml:msub>
                        </mml:mfenced>
                        <mml:mo>+</mml:mo>
                        <mml:mn>.5</mml:mn>
                    </mml:mrow>
                    <mml:mrow>
                        <mml:mfenced open="⌊" close="⌋">
                            <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
                            <mml:mi mathvariant="italic">w</mml:mi>
                            </mml:msub>
                        </mml:mfenced>
                        <mml:mo>+</mml:mo>
                        <mml:mn>.5</mml:mn>
                    </mml:mrow>
                </mml:mfenced>
            </mml:math>
        </p><p>
            where 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math>
            subscripts indicate window coordinates.  All pixels that lie
            within the square grid of the rounded size centered at 
            (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mi mathvariant="italic">x</mml:mi>
            </mml:math>, 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mi mathvariant="italic">y</mml:mi>
            </mml:math>)
            make
            up the fragment.  If the size is even, the center point is
        </p><p>
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mfenced open="(" close=")">
                    <mml:mfenced open="⌊" close="⌋">
                        <mml:mrow>
                            <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
                            <mml:mi mathvariant="italic">w</mml:mi>
                            </mml:msub>
                            <mml:mo>+</mml:mo>
                            <mml:mn>.5</mml:mn>
                        </mml:mrow>
                    </mml:mfenced>
                    <mml:mfenced open="⌊" close="⌋">
                        <mml:mrow>
                            <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
                            <mml:mi mathvariant="italic">w</mml:mi>
                            </mml:msub>
                            <mml:mo>+</mml:mo>
                            <mml:mn>.5</mml:mn>
                        </mml:mrow>
                    </mml:mfenced>
                </mml:mfenced>
            </mml:math>
        </p><p>
            and the rasterized fragment's centers are the half-integer window
            coordinates within the square of the rounded size centered at 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mfenced open="(" close=")">
                    <mml:mi mathvariant="italic">x</mml:mi>
                    <mml:mi mathvariant="italic">y</mml:mi>
                </mml:mfenced>
            </mml:math>.
            All pixel fragments produced in rasterizing a nonantialiased point are
            assigned the same associated data, that of the vertex corresponding to the
            point.
        </p><p>
            If antialiasing is enabled, then point rasterization produces a fragment
            for each pixel square that intersects the region lying within the circle
            having diameter equal to the current point size and centered at the point's
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mfenced open="(" close=")">
                    <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
                    <mml:mi mathvariant="italic">w</mml:mi>
                    </mml:msub>
                    <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
                    <mml:mi mathvariant="italic">w</mml:mi>
                    </mml:msub>
                </mml:mfenced>
            </mml:math>.
            The coverage value for each fragment is the
            window coordinate area of the intersection of the circular region with the
            corresponding pixel square.  This value is saved and used in the final
            rasterization step.  The data associated with each fragment is the data
            associated with the point being rasterized.
        </p><p>
            Not all sizes are supported when point antialiasing is enabled.  If an
            unsupported size is requested, the nearest supported size is used.  Only
            size 1 is guaranteed to be supported; others depend on the implementation.
            To query the range of supported sizes and the size difference between
            supported sizes within the range, call <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with arguments
            <code class="constant">GL_SMOOTH_POINT_SIZE_RANGE</code> and <code class="constant">GL_SMOOTH_POINT_SIZE_GRANULARITY</code>.
            For aliased points, query the supported ranges and granularity with
            <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>.
        </p></div><div class="refsect1"><a id="notes"></a><h2>Notes</h2><p>
            The point size specified by <code class="function">glPointSize</code> is always returned when
            <code class="constant">GL_POINT_SIZE</code> is queried.  Clamping and rounding for aliased and
            antialiased points have no effect on the specified value.
        </p><p>
            A non-antialiased point size may be clamped to an implementation-dependent
            maximum.  Although this maximum cannot be queried, it must be no less than
            the maximum value for antialiased points, rounded to the nearest integer
            value.
        </p><p>
            <code class="constant">GL_POINT_SIZE_RANGE</code> and <code class="constant">GL_POINT_SIZE_GRANULARITY</code> are
            deprecated in GL versions 1.2 and greater.  Their functionality has been
            replaced by <code class="constant">GL_SMOOTH_POINT_SIZE_RANGE</code> and
            <code class="constant">GL_SMOOTH_POINT_SIZE_GRANULARITY</code>.
        </p></div><div class="refsect1"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>size</code></em> is less than or equal to 0.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glPointSize</code>
            is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
            and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
        </p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <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>
        </p><p>
            <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>
        </p><p>
            <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>
        </p><p>
            <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>
        </p><p>
            <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>
        </p><p>
            <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>
        </p><p>
            <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>
        </p><p>
            <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>
        </p><p>
            <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>
        </p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>,
            <a class="citerefentry" href="glPointParameter.xml"><span class="citerefentry"><span class="refentrytitle">glPointParameter</span></span></a>
        </p></div><div class="refsect1"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></body></html>