15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_window_pos 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_window_pos 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Brian Paul, brian_e_paul 'at' yahoo.com 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNotice 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Copyright (c) 2002-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 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 Complete. Approved by ARB on February 14, 2002. 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciVersion 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Last Modified Date: June 11, 2002 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ciNumber 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci ARB Extension #25 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ciDependencies 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci OpenGL 1.0 is required. 435bd8deadSopenharmony_ci The extension is written against the OpenGL 1.3 Specification 445bd8deadSopenharmony_ci GL_EXT_fog_coordinate effects the definition of this extension. 455bd8deadSopenharmony_ci GL_EXT_secondary_color effects the definition of this extension. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ciOverview 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci In order to set the current raster position to a specific window 505bd8deadSopenharmony_ci coordinate with the RasterPos command, the modelview matrix, projection 515bd8deadSopenharmony_ci matrix and viewport must be set very carefully. Furthermore, if the 525bd8deadSopenharmony_ci desired window coordinate is outside of the window's bounds one must rely 535bd8deadSopenharmony_ci on a subtle side-effect of the Bitmap command in order to avoid frustum 545bd8deadSopenharmony_ci clipping. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci This extension provides a set of functions to directly set the current 575bd8deadSopenharmony_ci raster position in window coordinates, bypassing the modelview matrix, the 585bd8deadSopenharmony_ci projection matrix and the viewport-to-window mapping. Furthermore, clip 595bd8deadSopenharmony_ci testing is not performed, so that the current raster position is always 605bd8deadSopenharmony_ci valid. 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci This greatly simplifies the process of setting the current raster position 635bd8deadSopenharmony_ci to a specific window coordinate prior to calling DrawPixels, CopyPixels or 645bd8deadSopenharmony_ci Bitmap. Many matrix operations can be avoided when mixing 2D and 3D 655bd8deadSopenharmony_ci rendering. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ciIP Status 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci No IP issues. 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ciIssues 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci (1) Should we offer all 24 entrypoints, just like glRasterPos? 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci RESOLVED. No. Don't implement the 4-coordinate functions as 765bd8deadSopenharmony_ci they're really useless. However, we will implement the short 775bd8deadSopenharmony_ci and double-type functions for completeness. 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci For example, it's conceivable that an application may have 805bd8deadSopenharmony_ci data structures encoding window coordinates as a 2- or 3-vector 815bd8deadSopenharmony_ci of shorts and will want to use WindowPos3svARB(). Chris Hecker 825bd8deadSopenharmony_ci lobbied for this on the grounds of orthogonality. 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci (2) Should we have unique GLX protocol requests for every entrypoint 855bd8deadSopenharmony_ci or just a 3-float version? 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci RESOLVED. Just a 3-float version will suffice since all reasonable 885bd8deadSopenharmony_ci window coordinate values can be perfectly represented with 895bd8deadSopenharmony_ci single-precision floating point. 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci (4) For WindowPos2*ARB(), is zero the correct value for z? Afterall, 925bd8deadSopenharmony_ci z is a window coordinate, not an object coordinate. 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci RESOLVED. Yes, zero is correct. Zero corresponds to the front 955bd8deadSopenharmony_ci of the depth range. That's where one would usually want Bitmap, 965bd8deadSopenharmony_ci DrawPixels and CopyPixels to be positioned in z when rendering 2D 975bd8deadSopenharmony_ci primitives over a 3D scene. 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci (5) What about glDepthRange? 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci RESOLVED. Map the WindowPos z value into the range specified by 1025bd8deadSopenharmony_ci DepthRange. There's a popular optimization used to avoid depth 1035bd8deadSopenharmony_ci buffer clears for scenes that completely fill the window in which 1045bd8deadSopenharmony_ci the depth buffer is effectively halfed and reversed in alternate 1055bd8deadSopenharmony_ci frames by calling DepthRange. The WindowPos z value should be 1065bd8deadSopenharmony_ci subjected to depth range mapping so that it will work with this 1075bd8deadSopenharmony_ci optimization, and in other scenarios. 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci (6) Should we mention EXT_fog_coord and EXT_secondary_color in this 1105bd8deadSopenharmony_ci extension? 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci RESOLVED. Yes, otherwise implementors may not know what to do 1135bd8deadSopenharmony_ci with them. It's been suggested that we instead go back and 1145bd8deadSopenharmony_ci update the EXT_fog_coordinate and EXT_secondary_color specifications 1155bd8deadSopenharmony_ci with respect to ARB_window_pos instead. However, that seems 1165bd8deadSopenharmony_ci unlikely to happen and seems error-prone/obscure for implementors. 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci (7) What about the raster fog coordinate? 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci RESOLVED. If EXT_fog_coord is not supported, CURRENT_RASTER_DISTANCE 1215bd8deadSopenharmony_ci is set to zero. 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci If EXT_fog_coord is supported, the behavior is dependent on 1245bd8deadSopenharmony_ci the current state of FOG_COORDINATE_SOURCE_EXT. If the fog 1255bd8deadSopenharmony_ci coordinate source is FRAGMENT_DEPTH_EXT, CURRENT_RASTER_DISTANCE 1265bd8deadSopenharmony_ci is set to zero. If the fog coordinate source is FOG_COORDINATE_EXT, 1275bd8deadSopenharmony_ci CURRENT_RASTER_DISTANCE is set to the current fog coordinate. 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci The value chosen for CURRENT_RASTER_DISTANCE state matches the value 1305bd8deadSopenharmony_ci that would be chosen for normal vertices, except that WindowPos 1315bd8deadSopenharmony_ci does not allow the GL to compute eye coordinates that would be 1325bd8deadSopenharmony_ci used to generate a fog distance value. Instead, a value of zero is 1335bd8deadSopenharmony_ci always used as a fog distance. 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci With the current EXT_fog_coord specification, there are two pieces 1365bd8deadSopenharmony_ci of RasterPos state that drive fog (CURRENT_RASTER_DISTANCE and 1375bd8deadSopenharmony_ci the current raster fog coordinate). The setting of the fog 1385bd8deadSopenharmony_ci coordinate source selects which piece of state is used at 1395bd8deadSopenharmony_ci rasterization (Bitmap, DrawPixels) time. Instead, this extension 1405bd8deadSopenharmony_ci moves the selection of fog state to RasterPos state computation instead 1415bd8deadSopenharmony_ci of rasterization and combines the two pieces of state into a 1425bd8deadSopenharmony_ci single CURRENT_RASTER_DISTANCE. 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci Current implementations of EXT_fog_coord that support two pieces of 1455bd8deadSopenharmony_ci state can either change the implementations to merge the two pieces 1465bd8deadSopenharmony_ci into a single state or contiue to maintain two pieces of state. 1475bd8deadSopenharmony_ci If the implementations continue to maintain two pieces of state, 1485bd8deadSopenharmony_ci both the CURRENT_RASTER_DISTANCE and current raster fog coordinate 1495bd8deadSopenharmony_ci are set to the same value. 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci (8) What about the secondary raster color? 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci RESOLVED. If EXT_secondary_color is supported, the (unnamed) current 1545bd8deadSopenharmony_ci raster secondary color is set by taking the current secondary color and 1555bd8deadSopenharmony_ci clamping the components to the range [0,1]. 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci If EXT_secondary_color is not supported, the current raster secondary 1585bd8deadSopenharmony_ci color is set to (0,0,0). 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci (9) How is this extension specification different from the 1615bd8deadSopenharmony_ci MESA_window_pos extension? 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci (a) Clarified that lighting and texgen aren't used when updating 1645bd8deadSopenharmony_ci the current raster state. 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci (b) Explicitly state the effect on CURRENT_RASTER_DISTANCE and 1675bd8deadSopenharmony_ci CURRENT_RASTER_POSITION_VALID. 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci (c) Explain how the raster position's secondary color and fog 1705bd8deadSopenharmony_ci coordinate are handled. 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci (d) Z is mapped according to the DEPTH_RANGE values. 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci (e) Removed the functions which take 4 coordinates. 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ciNew Procedures and Functions 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci void WindowPos2dARB(double x, double y) 1795bd8deadSopenharmony_ci void WindowPos2fARB(float x, float y) 1805bd8deadSopenharmony_ci void WindowPos2iARB(int x, int y) 1815bd8deadSopenharmony_ci void WindowPos2sARB(short x, short y) 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ci void WindowPos2dvARB(const double *p) 1845bd8deadSopenharmony_ci void WindowPos2fvARB(const float *p) 1855bd8deadSopenharmony_ci void WindowPos2ivARB(const int *p) 1865bd8deadSopenharmony_ci void WindowPos2svARB(const short *p) 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci void WindowPos3dARB(double x, double y, double z) 1895bd8deadSopenharmony_ci void WindowPos3fARB(float x, float y, float z) 1905bd8deadSopenharmony_ci void WindowPos3iARB(int x, int y, int z) 1915bd8deadSopenharmony_ci void WindowPos3sARB(short x, short y, short z) 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci void WindowPos3dvARB(const double *p) 1945bd8deadSopenharmony_ci void WindowPos3fvARB(const float *p) 1955bd8deadSopenharmony_ci void WindowPos3ivARB(const int *p) 1965bd8deadSopenharmony_ci void WindowPos3svARB(const short *p) 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ciNew Tokens 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci none 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.3 Specification (OpenGL Operation) 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci In section 2.12 (Current Raster Position), p. 42, insert after 2055bd8deadSopenharmony_ci fifth paragraph: 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci Alternately, the current raster position may be set by one of the 2085bd8deadSopenharmony_ci WindowPosARB commands: 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci void WindowPos{23}{ifds}ARB( T coords ); 2115bd8deadSopenharmony_ci void WindowPos{23}{ifds}vARB( const T coords ); 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci WindosPos3ARB takes three values indicating x, y and z while 2145bd8deadSopenharmony_ci WindowPos2ARB takes two values indicating x and y with z implicitly 2155bd8deadSopenharmony_ci set to 0. 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci The CURRENT_RASTER_POSITION, (RPx, RPy, RPz, RPw), is updated as 2185bd8deadSopenharmony_ci follows: 2195bd8deadSopenharmony_ci 2205bd8deadSopenharmony_ci RPx = x 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ci RPy = y 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci { n, if z <= 0 2255bd8deadSopenharmony_ci RPz = { f, if z >= 1 2265bd8deadSopenharmony_ci { n + z * (f - n), otherwise 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci RPw = 1 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci where <n> is the DEPTH_RANGE's near value, and <f> is the 2315bd8deadSopenharmony_ci DEPTH_RANGE's far value. 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci In RGBA mode, CURRENT_RASTER_COLOR is updated from CURRENT_COLOR 2345bd8deadSopenharmony_ci with each color component clamped to the range [0,1]. 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci In color index mode, CURRENT_RASTER_INDEX is updated from 2375bd8deadSopenharmony_ci CURRENT_INDEX. 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ci All sets of CURRENT_RASTER_TEXTURE_COORDS are updated from 2405bd8deadSopenharmony_ci the corresponding CURRENT_TEXTURE_COORDS sets. 2415bd8deadSopenharmony_ci 2425bd8deadSopenharmony_ci CURRENT_RASTER_POSITION_VALID is set to TRUE. 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ci If EXT_fog_coord is not supported. 2455bd8deadSopenharmony_ci 2465bd8deadSopenharmony_ci CURRENT_RASTER_DISTANCE is set to zero. 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci If EXT_fog_coord is supported: 2495bd8deadSopenharmony_ci 2505bd8deadSopenharmony_ci CURRENT_RASTER_DISTANCE is set to 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci { CURRENT_FOG_COORDINATE, if FOG_COORDINATE_SOURCE_EXT is set 2535bd8deadSopenharmony_ci { to FOG_COORDINATE_EXT, or 2545bd8deadSopenharmony_ci { 0, if FOG_COORDINATE_SOURCE_EXT is set 2555bd8deadSopenharmony_ci { to FRAGMENT_DEPTH_EXT. 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci If EXT_secondary_color is supported: 2585bd8deadSopenharmony_ci 2595bd8deadSopenharmony_ci The current raster secondary color is set by clamping the components 2605bd8deadSopenharmony_ci of CURRENT_SECONDARY_COLOR_EXT to [0,1], if in RGBA mode. 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci If EXT_secondary_color is not supported: 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci The current raster secondary color (the secondary color used for all 2655bd8deadSopenharmony_ci pixel and bitmap rasterization) is set to (0,0,0), if in RGBA mode. 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci Note that lighting, texture coordinate generation, and clipping are 2685bd8deadSopenharmony_ci not performed by the WindowPos*ARB functions. 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.3 Specification (Special Functions) 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ci In section 5.2 (Selection), p. 188, modify the fourth paragraph to read: 2735bd8deadSopenharmony_ci 2745bd8deadSopenharmony_ci In selection mode, if a point, line, polygon, or the valid 2755bd8deadSopenharmony_ci coordinates produced by a RasterPos command intersects the clip 2765bd8deadSopenharmony_ci volume (section 2.11) then this primitive (or RasterPos command) 2775bd8deadSopenharmony_ci causes a selection hit. WindowPos commands always generate a 2785bd8deadSopenharmony_ci selection hit since the resulting raster position is always 2795bd8deadSopenharmony_ci valid. In the case of polygons (...) 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci None 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ciGLX Protocol 2865bd8deadSopenharmony_ci 2875bd8deadSopenharmony_ci One new GL rendering command is added. The following command is 2885bd8deadSopenharmony_ci sent to the server as part of a glXRender request: 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci WindowPosARB 2915bd8deadSopenharmony_ci 2 16 rendering command length 2925bd8deadSopenharmony_ci 2 230 rendering command opcode 2935bd8deadSopenharmony_ci 4 FLOAT32 x 2945bd8deadSopenharmony_ci 4 FLOAT32 y 2955bd8deadSopenharmony_ci 4 FLOAT32 z 2965bd8deadSopenharmony_ci 2975bd8deadSopenharmony_ciErrors 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ci INVALID_OPERATION is generated if WindowPosARB is called betweeen 3005bd8deadSopenharmony_ci Begin and End. 3015bd8deadSopenharmony_ci 3025bd8deadSopenharmony_ciNew State 3035bd8deadSopenharmony_ci 3045bd8deadSopenharmony_ci None. 3055bd8deadSopenharmony_ci 3065bd8deadSopenharmony_ciNew Implementation Dependent State 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci None. 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ciRevision History 3115bd8deadSopenharmony_ci 3125bd8deadSopenharmony_ci May 17, 2001 3135bd8deadSopenharmony_ci - Initial version based on GL_MESA_window_pos extension 3145bd8deadSopenharmony_ci May 22, 2001 3155bd8deadSopenharmony_ci - Explicitly state that x, y, z are window coordinates and w is 3165bd8deadSopenharmony_ci a clip space coordinate. (Dan Brokenshire) 3175bd8deadSopenharmony_ci May 23, 2001 3185bd8deadSopenharmony_ci - Resolved issues 1 and 2. 3195bd8deadSopenharmony_ci - Added issues 4 and 5. 3205bd8deadSopenharmony_ci May 24, 2001 3215bd8deadSopenharmony_ci - Rewrote body of specification to more clearly indicate how all 3225bd8deadSopenharmony_ci raster position state is updated by WindowPos. 3235bd8deadSopenharmony_ci - Updated the issues section. 3245bd8deadSopenharmony_ci Jun 13, 2001 3255bd8deadSopenharmony_ci - Added back the double and short versions of WindowPos() 3265bd8deadSopenharmony_ci - Added fog coord issue and discusstion. 3275bd8deadSopenharmony_ci - Reordered/renumbered the issues section. 3285bd8deadSopenharmony_ci Jun 22, 2001 3295bd8deadSopenharmony_ci - Set raster secondary color to current secondary color, not black 3305bd8deadSopenharmony_ci Jun 25, 2001 3315bd8deadSopenharmony_ci - Another change to secondary color, think I got it now! 3325bd8deadSopenharmony_ci Nov 16, 2001 3335bd8deadSopenharmony_ci - updated email address 3345bd8deadSopenharmony_ci - List options "A" and "B" to determine behaviour of current raster 3355bd8deadSopenharmony_ci fog coordinate. 3365bd8deadSopenharmony_ci Nov 17, 2001 3375bd8deadSopenharmony_ci - minor clean-ups 3385bd8deadSopenharmony_ci Dec 12, 2001 3395bd8deadSopenharmony_ci - rewrite against the OpenGL 1.3 spec 3405bd8deadSopenharmony_ci - fixed a few typos 3415bd8deadSopenharmony_ci Jan 10, 2002 3425bd8deadSopenharmony_ci - update the interaction with EXT_fog_coord and EXT_secondary_color 3435bd8deadSopenharmony_ci based on the proposed resolution from the December 2001 ARB 3445bd8deadSopenharmony_ci meeting. (Pat Brown) 3455bd8deadSopenharmony_ci Jan 18, 2002 3465bd8deadSopenharmony_ci - Merges two pieces of fog state into a single state. (Bimal Poddar) 3475bd8deadSopenharmony_ci Mar 12, 2002 3485bd8deadSopenharmony_ci - Added GLX protocol. (Jon Leech) 3495bd8deadSopenharmony_ci June 11, 2002 3505bd8deadSopenharmony_ci - Clarifications: RGBA/index color updates apply only in 3515bd8deadSopenharmony_ci RGBA/index mode respectively. Hits are generated in selection mode. 352