back  Return to list

homeprevnext Name
homeprevnext Name Strings
homeprevnext Contact
    Michael Gold, NVIDIA (gold 'at'  
homeprevnext Status
    Approved by the ARB, 21 June 2000.  
    GLX ropcode needs to be assigned.  
homeprevnext Version
    Date:  06/20/2000	 Revision:  0.4  
    Based on:  SGIS_point_parameters  
	       $Date: 1997/08/21 21:26:36 $ $Revision: 1.6 $  
homeprevnext Number
    ARB Extension #14  
homeprevnext Dependencies
    OpenGL 1.0 is required.  
    ARB_multisample affects the definition of this extension.  
    The extension is written against the OpenGL 1.2.1 Specification.  
homeprevnext Overview
    This extension supports additional geometric characteristics of  
    points. It can be used to render particles or tiny light sources,  
    commonly referred to as "Light points".  
    The raster brightness of a point is a function of the point area,  
    point color, point transparency, and the response of the display's  
    electron gun and phosphor. The point area and the point transparency  
    are derived from the point size, currently provided with the <size>  
    parameter of glPointSize.  
    The primary motivation is to allow the size of a point to be  
    affected by distance attenuation. When distance attenuation has an  
    effect, the final point size decreases as the distance of the point  
    from the eye increases.  
    The secondary motivation is a mean to control the mapping from the  
    point size to the raster point area and point transparency. This is  
    done in order to increase the dynamic range of the raster brightness  
    of points. In other words, the alpha component of a point may be  
    decreased (and its transparency increased) as its area shrinks below  
    a defined threshold.  
    This extension defines a derived point size to be closely related to  
    point brightness. The brightness of a point is given by:  
	dist_atten(d) = -------------------  
			a + b * d + c * d^2  
	brightness(Pe) = Brightness * dist_atten(|Pe|)  
    where 'Pe' is the point in eye coordinates, and 'Brightness' is some  
    initial value proportional to the square of the size provided with  
    PointSize. Here we simplify the raster brightness to be a function  
    of the rasterized point area and point transparency.  
		    brightness(Pe)	 brightness(Pe) >= Threshold_Area  
	area(Pe) =  
		    Threshold_Area	 Otherwise  
	factor(Pe) = brightness(Pe)/Threshold_Area  
	alpha(Pe) = Alpha * factor(Pe)  
    where 'Alpha' comes with the point color (possibly modified by  
    'Threshold_Area' above is in area units. Thus, it is proportional to  
    the square of the threshold provided by the programmer through this  
    The new point size derivation method applies to all points, while  
    the threshold applies to multisample points only.  
homeprevnext IP Status
homeprevnext Issues
    * Does point alpha modification affect the current color ?  
    * Do we need a special function GetPointParameterfvARB, or get by  
      with GetFloat ?  
      GetFloat is sufficient.  
    * If alpha is 0, then we could toss the point before it reaches the  
      fragment stage.  
      No.  This can be achieved with enabling the alpha test with  
      reference of 0 and function of LEQUAL.  
    * Do we need a disable for applying the threshold ? The default  
      threshold value is 1.0. It is applied even if the point size is  
      If the default threshold is not overridden, the area of  
      multisample points with provided constant size of less than 1.0,  
      is mapped to 1.0, while the alpha component is modulated  
      accordingly, to compensate for the larger area. For multisample  
      points this is not a problem, as there are no relevant  
      applications yet. As mentioned above, the threshold does not apply  
      to alias or antialias points.  
      The alternative is to have a disable of threshold application, and  
      state that threshold (if not disabled) applies to non antialias  
      points only (that is, alias and multisample points).  
      The behavior without an enable/disable looks fine.  
    * Future extensions (to the extension)  
      When the derived point size is larger than the threshold size  
      defined by the POINT_FADE_THRESHOLD_SIZE_ARB parameter, it might  
      be desired to clamp the computed alpha to a minimum value, in  
      order to keep the point visible. In this case the formula below  
      factor = (derived_size/threshold)^2  
		      factor		      clamp <= factor   
      clamped_value =   
		      clamp		      factor < clamp  
	       1.0			      derived_size >= threshold  
      alpha *=  
	       clamped_value		      Otherwise  
      where clamp is defined by the POINT_FADE_ALPHA_CLAMP_ARB new  
homeprevnext New Procedures and Functions
    void PointParameterfARB(enum pname,  
			    float param);  
    void PointParameterfvARB(enum pname,  
			     float *params);  
homeprevnext New Tokens
    Accepted by the <pname> parameter of PointParameterfARB, and the  
    <pname> of Get:  
    Accepted by the <pname> parameter of PointParameterfvARB, and the  
    <pname> of Get:  
homeprevnext Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation)
homeprevnext Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization)
    In section 3.3, the following is inserted after the description of  
    The point size is multiplied with a distance attenuation factor  
    and clamped as follows:  
	derived_size = Clamp(size * sqrt(dist_atten(dist)))  
    where dist_atten is specified as  
	dist_atten(d) = -------------------  
			a + b * d + c * d^2  
    and 'd' is the eye-coordinate distance from the eye, (0, 0, 0, 1) in  
    eye coordinates, to the vertex.  
    The derived point size is clamped to a given range, and then  
    clamped to the implementation-dependent point size range.  
    If multisampling is enabled, an implementation may optionally fade  
    the point alpha (section 3.12) instead of allowing the size to go  
    below a given threshold.  In this case, the diameter of the  
    rasterized point is  
		   derived_size			derived_size >= threshold  
	diameter =   
		   threshold			Otherwise  
    and the fade factor is computed as follows:  
		 1				derived_size >= threshold  
	fade =  
		 (derived_size/threshold)^2	Otherwise  
    The distance attenuation function coefficients, 'a', 'b', and 'c',  
    the bounds of the clamp, and the point fade 'threshold', are  
    specified with  
        void PointParameterfARB( enum pname, float param );  
        void PointParameterfvARB( enum pname, const float *params );  
    If <pname> is POINT_SIZE_MIN_ARB or POINT_SIZE_MAX_ARB, then  
    <param> specifies, or <params> points to the lower or upper bound  
    respectively on the derived point size.  If the lower bound is  
    greater than the upper bound, the resulting point size is  
    undefined.  If <pname> is POINT_DISTANCE_ATTENUATION_ARB, then  
    <params> points to the coefficients 'a', 'b', and 'c'.  If <pname>  
    is POINT_FADE_THRESHOLD_SIZE_ARB, <param> specifies, or <params>  
    points to the point fade threshold.  
    This extension doesn't change the feedback or selection behavior of  
    In section 3.11, the word "Finally" is removed from the first  
    Add the following after section 3.11.  
    Section 3.12  Multisample Point Fade  
    If multisampling is enabled and the rasterized fragment results  
    from a point primitive, then the computed fade factor is applied  
    to the fragment.  In RGBA mode, the fade factor is multiplied by  
    the fragment's alpha (A) value to yield a final alpha value.  In  
    color index mode, the fade factor has no effect.  
homeprevnext Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment Operations and the Frame Buffer)
homeprevnext Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions)
homeprevnext Additions to Chapter 6 of the OpenGL 1.2.1 Specification (State and State Requests)
homeprevnext Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
homeprevnext Additions to the GLX / WGL / AGL Specifications
homeprevnext GLX Protocol
    One new GL rendering command is added. The following command is sent  
    to the server as part of a glXRender request:  
	    2		8+4*n		rendering command length  
	    2		????		rendering command opcode  
	    4		ENUM		pname  
			0x8126	  n=1	POINT_SIZE_MIN_ARB  
			0x8127	  n=1	POINT_SIZE_MAX_ARB  
	    4*n		LISTofFLOAT32	params  
homeprevnext Dependencies on ARB_multisample
    If ARB_multisample is not implemented, then the references to  
    multisample points are invalid, and should be ignored.  
homeprevnext Errors
    INVALID_ENUM is generated if PointParameterfARB parameter <pname> is  
    INVALID_ENUM is generated if PointParameterfvARB parameter <pname>  
    INVALID_VALUE is generated when values are out of range according  
    <pname>				    valid range  
    --------				    -----------  
    POINT_SIZE_MIN_ARB			    >= 0  
    POINT_SIZE_MAX_ARB			    >= 0  
homeprevnext New State
(table 6.11, p. 201)  
    Get Value				Type	Get Command	Value	Description Sec.    Attribute  
    ---------				----	-----------	------- ----------- ----    ---------  
    POINT_SIZE_MIN_ARB			R+	GetFloatv	0.0	Attenuated  3.3	    point  
									Min point  
    POINT_SIZE_MAX_ARB			R+	GetFloatv	M	Attenuated  3.3	    point  
									Max point  
    POINT_FADE_THRESHOLD_SIZE_ARB	R+	GetFloatv	1.0	Threshold   3.3	    point  
									for alpha  
    POINT_DISTANCE_ATTENUATION_ARB	3xR	GetFloatv	(1.0,0.0,0.0)	    3.3	    point  
    M is the larger of the max antialiased and non antialiased point  
homeprevnext New Implementation Dependent State
homeprevnext Revision History
    11/09/1999	0.1  
	- First ARB draft based on the original SGI and EXT drafts.  
    12/07/1999	0.2  
	- clarified behavior when POINT_SIZE_MIN exceeds POINT_SIZE_MAX  
	- clarified when the point size is clamped to the supported range  
	- removed issues from "Errors" section  
	- fixed various typos  
	- Updated to new extension template  
	- added GLX protocol  
    04/20/2000  0.3  
        - rewritten to fit within the context of the 1.2 specification  
        - added language describing where the fade alpha is applied.  
        - added language which indicates that some implementations may not  
          implement POINT_FADE_THRESHOLD_SIZE_ARB  
    06/20/2000  0.4  
        - removed alternate behavior for fade alpha, since it is optional  
        - added new section describing fade alpha application  
Valid XHTML 1.1! Valid CSS! Last update: November 14, 2006.
Cette page doit être lue avec un navigateur récent respectant le standard XHTML 1.1.