15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci OES_point_sprite 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_OES_point_sprite 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Aaftab Munshi (amunshi@ati.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNotice 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Copyright (c) 2004-2013 The Khronos Group Inc. Copyright terms at 165bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciSpecification Update Policy 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 215bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL ES Working Group. For 225bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 235bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 245bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 255bd8deadSopenharmony_ci described in more detail at 265bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ciStatus 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci Ratified by the Khronos BOP, Aug 5, 2004. 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciIP Status 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci No known IP issues. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ciVersion 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci Last Modified Date: August 5, 2004 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ciNumber 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci OpenGL ES Extension #15 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ciDependencies 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci OpenGL ES 1.0 is required 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ciOverview 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci Applications such as particle systems have tended to use OpenGL quads 515bd8deadSopenharmony_ci rather than points to render their geometry, since they would like 525bd8deadSopenharmony_ci to use a custom-drawn texture for each particle, rather than the 535bd8deadSopenharmony_ci traditional OpenGL round antialiased points, and each fragment in 545bd8deadSopenharmony_ci a point has the same texture coordinates as every other fragment. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci Unfortunately, specifying the geometry for these quads can be 575bd8deadSopenharmony_ci expensive, since it quadruples the amount of geometry required, and 585bd8deadSopenharmony_ci may also require the application to do extra processing to compute 595bd8deadSopenharmony_ci the location of each vertex. 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci The purpose of this extension is to allow such applications to use 625bd8deadSopenharmony_ci points rather than quads. When GL_POINT_SPRITE_OES is enabled, 635bd8deadSopenharmony_ci the state of point antialiasing is ignored. For each texture unit, 645bd8deadSopenharmony_ci the app can then specify whether to replace the existing texture 655bd8deadSopenharmony_ci coordinates with point sprite texture coordinates, which are 665bd8deadSopenharmony_ci interpolated across the point. 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ciIssues 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci The following are the list of issues as discussed in the 715bd8deadSopenharmony_ci ARB_point_sprite extension. I've deleted issues that are not related 725bd8deadSopenharmony_ci to OpenGL ES such as vertex shader programs etc. 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci Tokens that use _ARB names are modified to use _OES. 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ci * Should this spec say that point sprites get converted into quads? 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci RESOLVED: No, this would make the spec much uglier, because then 795bd8deadSopenharmony_ci we'd have to say that polygon smooth and stipple get turned off, 805bd8deadSopenharmony_ci etc. Better to provide a formula for computing the texture 815bd8deadSopenharmony_ci coordinates and leave them as points. 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci * How are point sprite texture coordinates computed? 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci RESOLVED: They move smoothly as the point moves around on the 865bd8deadSopenharmony_ci screen, even though the pixels touched by the point do not. The 875bd8deadSopenharmony_ci exact formula is given in the spec below. 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci A point sprite can be thought of as a quad whose upper-left corner has 905bd8deadSopenharmony_ci (s,t) texture coordinates of (0,0) and whose lower-right corner has 915bd8deadSopenharmony_ci texture coordinates of (1,1), as illustrated in the following figure. 925bd8deadSopenharmony_ci In the figure "P" is the center of the point sprite, and "O" is the 935bd8deadSopenharmony_ci origin (0,0) of the window coordinate system. Note that the y window 945bd8deadSopenharmony_ci coordinate increases from bottom-to-top but the t texture coordinate 955bd8deadSopenharmony_ci of point sprites increases from top-to-bottom. 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci ^ 985bd8deadSopenharmony_ci +y| (0,0) 995bd8deadSopenharmony_ci | +-----+ 1005bd8deadSopenharmony_ci | | | 1015bd8deadSopenharmony_ci | | P | 1025bd8deadSopenharmony_ci | | | 1035bd8deadSopenharmony_ci | +-----+ 1045bd8deadSopenharmony_ci | (1,1) 1055bd8deadSopenharmony_ci | +x 1065bd8deadSopenharmony_ci O---------------> 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci Applications using a single texture for both point sprites and other 1095bd8deadSopenharmony_ci geometry need to account for the fixed coordinate mapping of point 1105bd8deadSopenharmony_ci sprites. 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci * How do point sizes for point sprites work? 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci RESOLVED: This specification treats point sprite sizes like 1155bd8deadSopenharmony_ci antialiased point sizes, but with more leniency. Implementations 1165bd8deadSopenharmony_ci may choose to not clamp the point size to the antialiased point 1175bd8deadSopenharmony_ci size range. The set of point sprite sizes available must be 1185bd8deadSopenharmony_ci a superset of the antialiased point sizes. However, whereas 1195bd8deadSopenharmony_ci antialiased point sizes are all evenly spaced by the point size 1205bd8deadSopenharmony_ci granularity, point sprites can have an arbitrary set of sizes. 1215bd8deadSopenharmony_ci This lets implementations use, e.g., floating-point sizes. 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci * Should there be a way to query the list of supported point sprite 1245bd8deadSopenharmony_ci sizes? 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci RESOLVED: No. If an implementation were to use, say, a single- 1275bd8deadSopenharmony_ci precision IEEE float to represent point sizes, the list would be 1285bd8deadSopenharmony_ci rather long. 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci * Do mipmaps apply to point sprites? 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci RESOLVED: Yes. They are similar to quads in this respect. 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci * What of this extension's state is per-texture unit and what 1355bd8deadSopenharmony_ci of this extension's state is state is global? 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci RESOLVED: The GL_POINT_SPRITE_OES enable is global. The 1385bd8deadSopenharmony_ci COORD_REPLACE_OES state is per-texture unit (state set by TexEnv is 1395bd8deadSopenharmony_ci per-texture unit). 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci * Should there be a global on/off switch for point sprites, or 1425bd8deadSopenharmony_ci should the per-unit enable imply that switch? 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci RESOLVED: There is a global switch to turn it on and off. This 1455bd8deadSopenharmony_ci is probably more convenient for both driver and app, and it 1465bd8deadSopenharmony_ci simplifies the spec. 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci * What should the TexEnv mode for point sprites be called? 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci RESOLVED: COORD_REPLACE_OES. 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci * What is the interaction with multisample points, which are round? 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci RESOLVED: Point sprites are rasterized as squares, even in 1555bd8deadSopenharmony_ci multisample mode. Leaving them as round points would make the 1565bd8deadSopenharmony_ci feature useless. 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ci * How does this extension interact with the point size attenuation 1595bd8deadSopenharmony_ci functionality in OES_point_parameters and OpenGL 1.4? 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci RESOLVED: Point sprites sizes are attenuated just like the sizes of 1625bd8deadSopenharmony_ci non-sprite points. 1635bd8deadSopenharmony_ci 1645bd8deadSopenharmony_ci * How are point sprites clipped? 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci RESOLVED: Point sprites are transformed as points, and standard point 1675bd8deadSopenharmony_ci clipping operations are performed. This can cause point sprites that 1685bd8deadSopenharmony_ci move off the edge of the screen to disappear abruptly, in the same way 1695bd8deadSopenharmony_ci that regular points do. As with any other primitive, standard 1705bd8deadSopenharmony_ci per-fragment clipping operations (scissoring, window ownership test) 1715bd8deadSopenharmony_ci still apply. 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ciNew Procedures and Functions 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci None 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ciNew Tokens 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and by the 1805bd8deadSopenharmony_ci <target> parameter of TexEnvf, TexEnvfv, TexEnvx, TexEnvxv: 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci POINT_SPRITE_OES 0x8861 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci When the <target> parameter of TexEnvf, TexEnvfv, TexEnvx, TexEnvxv, 1855bd8deadSopenharmony_ci is POINT_SPRITE_OES, then the value of <pname> may be: 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci COORD_REPLACE_OES 0x8862 1885bd8deadSopenharmony_ci 1895bd8deadSopenharmony_ci When the <target> and <pname> parameters of TexEnvf, TexEnvfv, 1905bd8deadSopenharmony_ci TexEnvx, TexEnvxv, are POINT_SPRITE_OES and COORD_REPLACE_OES 1915bd8deadSopenharmony_ci respectively, then the value of <param> or the value pointed 1925bd8deadSopenharmony_ci to by <params> may be: 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci FALSE 1955bd8deadSopenharmony_ci TRUE 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation) 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci None. 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization) 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci Insert the following paragraphs after the second paragraph of section 2055bd8deadSopenharmony_ci 3.3 (page 66): 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci "Point sprites are enabled or disabled by calling Enable or Disable 2085bd8deadSopenharmony_ci with the symbolic constant POINT_SPRITE_OES. The default state is for 2095bd8deadSopenharmony_ci point sprites to be disabled. When point sprites are enabled, the 2105bd8deadSopenharmony_ci state of the point antialiasing enable is ignored. 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci The point sprite texture coordinate replacement mode is set with one 2135bd8deadSopenharmony_ci of the commands 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci void TexEnv{ixf}(enum target, enum pname, T param) 2165bd8deadSopenharmony_ci void TexEnv{ixf}v(enum target, enum pname, const T *params) 2175bd8deadSopenharmony_ci 2185bd8deadSopenharmony_ci where target is POINT_SPRITE_OES and pname is COORD_REPLACE_OES. The 2195bd8deadSopenharmony_ci possible values for param are FALSE and TRUE. The default value for 2205bd8deadSopenharmony_ci each texture unit is for point sprite texture coordinate replacement 2215bd8deadSopenharmony_ci to be disabled." 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci Replace the first two sentences of the second paragraph of section 2245bd8deadSopenharmony_ci 3.3.1 (page 67) with the following: 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci "The effect of a point width other than 1.0 depends on the state of 2275bd8deadSopenharmony_ci point antialiasing and point sprites. If antialiasing and point 2285bd8deadSopenharmony_ci sprites are disabled, ..." 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci Replace the first sentences of the fourth paragraph of section 3.3.1 2315bd8deadSopenharmony_ci (page 68) with the following: 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci "If antialiasing is enabled and point sprites are disabled, ..." 2345bd8deadSopenharmony_ci 2355bd8deadSopenharmony_ci Insert the following paragraphs at the end of section 3.3.1 (page 2365bd8deadSopenharmony_ci 70): 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci "When point sprites are enabled, then point rasterization produces a 2395bd8deadSopenharmony_ci fragment for each framebuffer pixel whose center lies inside a square 2405bd8deadSopenharmony_ci centered at the point's (x_w, y_w), with side length equal to the 2415bd8deadSopenharmony_ci current point size. 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ci All fragments produced in rasterizing a point sprite are assigned the 2445bd8deadSopenharmony_ci same associated data, which are those of the vertex corresponding to 2455bd8deadSopenharmony_ci the point, with texture coordinates s, t, and r replaced with s/q, 2465bd8deadSopenharmony_ci t/q, and r/q, respectively. If q is less than or equal to zero, the 2475bd8deadSopenharmony_ci results are undefined. However, for each texture unit where 2485bd8deadSopenharmony_ci COORD_REPLACE_OES is TRUE, these texture coordinates are replaced 2495bd8deadSopenharmony_ci with point sprite texture coordinates. The s coordinate varies 2505bd8deadSopenharmony_ci from 0 to 1 across the point horizontally left-to-right, while 2515bd8deadSopenharmony_ci the t coordinate varies from 0 to 1 vertically top-to-bottom. 2525bd8deadSopenharmony_ci The r and q coordinates are replaced with the constants 0 and 1, 2535bd8deadSopenharmony_ci respectively. 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ci The following formula is used to evaluate the s and t coordinates: 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci s = 1/2 + (x_f + 1/2 - x_w) / size 2585bd8deadSopenharmony_ci t = 1/2 - (y_f + 1/2 - y_w) / size 2595bd8deadSopenharmony_ci 2605bd8deadSopenharmony_ci where size is the point's size, x_f and y_f are the (integral) window 2615bd8deadSopenharmony_ci coordinates of the fragment, and x_w and y_w are the exact, unrounded 2625bd8deadSopenharmony_ci window coordinates of the vertex for the point. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci The widths supported for point sprites must be a superset of those 2655bd8deadSopenharmony_ci supported for antialiased points. There is no requirement that these 2665bd8deadSopenharmony_ci widths must be equally spaced. If an unsupported width is requested, 2675bd8deadSopenharmony_ci the nearest supported width is used instead." 2685bd8deadSopenharmony_ci 2695bd8deadSopenharmony_ci Replace the text of section 3.3.2 (page 70) with the following: 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci "The state required to control point rasterization consists of the 2725bd8deadSopenharmony_ci floating-point point width, three floating-point values specifying 2735bd8deadSopenharmony_ci the minimum and maximum point size and the point fade threshold size, 2745bd8deadSopenharmony_ci three floating-point values specifying the distance attenuation 2755bd8deadSopenharmony_ci coefficients, a bit indicating whether or not antialiasing is 2765bd8deadSopenharmony_ci enabled, a bit indicating whether or not point sprites are enabled, 2775bd8deadSopenharmony_ci and a bit for the point sprite texture coordinate replacement mode 2785bd8deadSopenharmony_ci for each texture unit." 2795bd8deadSopenharmony_ci 2805bd8deadSopenharmony_ci Replace the text of section 3.3.3 (page 70) with the following: 2815bd8deadSopenharmony_ci 2825bd8deadSopenharmony_ci "If MULTISAMPLE is enabled, and the value of SAMPLE_BUFFERS is one, 2835bd8deadSopenharmony_ci then points are rasterized using the following algorithm, regardless 2845bd8deadSopenharmony_ci of whether point antialiasing (POINT_SMOOTH) is enabled or disabled. 2855bd8deadSopenharmony_ci Point rasterization produces a fragment for each framebuffer pixel 2865bd8deadSopenharmony_ci with one or more sample points that intersect a region centered at 2875bd8deadSopenharmony_ci the point's (x_w, y_w). This region is a circle having diameter 2885bd8deadSopenharmony_ci equal to the current point width if POINT_SPRITE_OES is disabled, or 2895bd8deadSopenharmony_ci a square with side equal to the current point width if 2905bd8deadSopenharmony_ci POINT_SPRITE_OES is enabled. Coverage bits that correspond to sample 2915bd8deadSopenharmony_ci points that intersect the region are 1, other coverage bits are 0. 2925bd8deadSopenharmony_ci All data associated with each sample for the fragment are the data 2935bd8deadSopenharmony_ci associated with the point being rasterized, with the exception of 2945bd8deadSopenharmony_ci texture coordinates when POINT_SPRITE_OES is enabled; these texture 2955bd8deadSopenharmony_ci coordinates are computed as described in section 3.3. 2965bd8deadSopenharmony_ci 2975bd8deadSopenharmony_ci Point size range and number of gradations are equivalent to those 2985bd8deadSopenharmony_ci supported for antialiased points when POINT_SPRITE_OES is disabled. 2995bd8deadSopenharmony_ci The set of point sizes supported is equivalent to those for point 3005bd8deadSopenharmony_ci sprites without multisample when POINT_SPRITE_OES is enabled." 3015bd8deadSopenharmony_ci 3025bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment 3035bd8deadSopenharmony_ciOperations and the Frame Buffer) 3045bd8deadSopenharmony_ci 3055bd8deadSopenharmony_ci None. 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.4 Specification (Special 3085bd8deadSopenharmony_ciFunctions) 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ci None. 3115bd8deadSopenharmony_ci 3125bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.4 Specification (State and 3135bd8deadSopenharmony_ciState Requests) 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci None. 3165bd8deadSopenharmony_ci 3175bd8deadSopenharmony_ciErrors 3185bd8deadSopenharmony_ci 3195bd8deadSopenharmony_ci None. 3205bd8deadSopenharmony_ci 3215bd8deadSopenharmony_ciNew State 3225bd8deadSopenharmony_ci 3235bd8deadSopenharmony_ci(table 6.12, p. 220) 3245bd8deadSopenharmony_ci 3255bd8deadSopenharmony_ciGet Value Type Get Command Initial Value Description 3265bd8deadSopenharmony_ci--------- ---- ----------- ------------- ----------- 3275bd8deadSopenharmony_ciPOINT_SPRITE_OES B IsEnabled False point sprite enable 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ci(table 6.17, p. 225) 3305bd8deadSopenharmony_ci 3315bd8deadSopenharmony_ciGet Value Type Get Command Initial Value Description 3325bd8deadSopenharmony_ci--------- ---- ----------- ------------- ----------- 3335bd8deadSopenharmony_ciCOORD_REPLACE_OES 2* x B GetTexEnviv False coordinate replacement 3345bd8deadSopenharmony_ci enable 3355bd8deadSopenharmony_ci 3365bd8deadSopenharmony_ciRevision History 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci 339