15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci 3DFX_multisample 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_3DFX_multisample 85bd8deadSopenharmony_ci GLX_3DFX_multisample 95bd8deadSopenharmony_ci WGL_3DFX_multisample 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ciContact 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ci Paula Womack, 3dfx Interactive (paulaw 'at' 3dfx.com) 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ciStatus 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ci Complete. 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciVersion 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci Date: April 18, 2000; Version 1.1 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciNumber 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci 207 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciDependencies 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL 1.1 is required. 305bd8deadSopenharmony_ci GLX 1.2 is required. 315bd8deadSopenharmony_ci WGL_ARB_extensions_string is required. 325bd8deadSopenharmony_ci WGL_ARB_pixel_format is required. 335bd8deadSopenharmony_ci GLX_EXT_fbconfig and GLX 1.3 affect the definition of this extension. 345bd8deadSopenharmony_ci This spec is written against OpenGL 1.2 and GLX 1.3 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ciOverview 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci This extension provides a mechanism to antialias all GL primitives: 395bd8deadSopenharmony_ci points, lines, polygons, bitmaps, and images. The technique is to 405bd8deadSopenharmony_ci sample all primitives multiple times at each pixel. The color sample 415bd8deadSopenharmony_ci values are resolved to a single, displayable color each time a pixel 425bd8deadSopenharmony_ci is updated, so the antialiasing appears to be automatic at the 435bd8deadSopenharmony_ci application level. Because each sample includes depth and stencil 445bd8deadSopenharmony_ci information, the depth and stencil functions perform equivalently to 455bd8deadSopenharmony_ci the single-sample mode. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci An additional buffer, called the multisample buffer, is added to the 485bd8deadSopenharmony_ci framebuffer. Pixel sample values, including color, depth, and 495bd8deadSopenharmony_ci stencil values, are stored in this buffer. When the framebuffer 505bd8deadSopenharmony_ci includes a multisample buffer, it does not also include separate 515bd8deadSopenharmony_ci depth or stencil buffers, even if the multisample buffer does not 525bd8deadSopenharmony_ci store depth or stencil values. Color buffers (left/right, 535bd8deadSopenharmony_ci front/back, and aux) do coexist with the multisample buffer, 545bd8deadSopenharmony_ci however. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci Multisample antialiasing is most valuable for rendering polygons, 575bd8deadSopenharmony_ci because it requires no sorting for hidden surface elimination, and 585bd8deadSopenharmony_ci it correctly handles adjacent polygons, object silhouettes, and even 595bd8deadSopenharmony_ci intersecting polygons. If only points or lines are being rendered, 605bd8deadSopenharmony_ci the "smooth" antialiasing mechanism provided by the base GL may 615bd8deadSopenharmony_ci result in a higher quality image. 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci This extension is a subset of SGIS_multisample. It differs in these 645bd8deadSopenharmony_ci key ways: 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci * Fragment alpha values are not affected by the fragment sample mask 675bd8deadSopenharmony_ci * The sample locations may or may not be fixed. Thus, there is no 685bd8deadSopenharmony_ci support for rendering the scene multiple times with different 695bd8deadSopenharmony_ci sample points. 705bd8deadSopenharmony_ci * Fragment masks are not computed for images or for bitmasks. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci Because of these differences a new extension was created. However, 735bd8deadSopenharmony_ci it is not expected that this extension will co-exist with 745bd8deadSopenharmony_ci SGIS_multisample. Because of this and the fact that there are only 755bd8deadSopenharmony_ci 32 push/pop bits the MULTISAMPLE_BIT_SGIS state value is the same as 765bd8deadSopenharmony_ci MUTLISAMPLE_BIT_3DFX. 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ciIP Status 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci No issues. 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ciIssues 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci Should tbuffer be kept as a separate extension? 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci Yes. The ability to define a write mask for the fragment mask should 875bd8deadSopenharmony_ci be kept separate. This feature is orthogonal to SGIS_multisample, 885bd8deadSopenharmony_ci while 3DFX_multisample is not. 3DFX_multisample is a strict subset 895bd8deadSopenharmony_ci of SGIS_multisample. 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci Should the multisample buffer be defined as a separate buffer? 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci Yes. It does not need to be implemented this way though. Since GL 945bd8deadSopenharmony_ci rendering is done off screen and then blitted (to handle window 955bd8deadSopenharmony_ci clipping) the multisample buffer can actually be the same as the 965bd8deadSopenharmony_ci offscreen front and back buffers. The blit engine handles reads and 975bd8deadSopenharmony_ci writes to/from AA buffers so ReadPixels will work correctly. 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci Should we allow the depth values for the different samples to differ 1005bd8deadSopenharmony_ci when AA is off? 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci No. This will be a bug on hardware that operates this way. In 1035bd8deadSopenharmony_ci practice it should not be a big issue. 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ciNew Procedures and Functions 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci None 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ciNew Tokens 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci Accepted by the <attrib_list> parameter of glXChooseFBConfig and 1125bd8deadSopenharmony_ci glXChooseVisual and by the <attribute> parameter of 1135bd8deadSopenharmony_ci glXGetFBConfigAttrib and glXGetConfig: 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci GLX_SAMPLE_BUFFERS_3DFX 0x8050 1165bd8deadSopenharmony_ci GLX_SAMPLES_3DFX 0x8051 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci Accepted in the <piAttributes> parameter array of 1195bd8deadSopenharmony_ci wglGetPixelFormatAttribivARB, and wglGetPixelFormatAttribfvARB, and 1205bd8deadSopenharmony_ci in the <piAttribIList> and <pfAttribFList> parameter arrays of 1215bd8deadSopenharmony_ci wglChoosePixelFormatARB: 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci WGL_SAMPLE_BUFFERS_3DFX 0x2060 1245bd8deadSopenharmony_ci WGL_SAMPLES_3DFX 0x2061 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, 1275bd8deadSopenharmony_ci and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, 1285bd8deadSopenharmony_ci and GetDoublev: 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci MULTISAMPLE_3DFX 0x86B2 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetDoublev, 1335bd8deadSopenharmony_ci GetIntegerv, and GetFloatv: 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci SAMPLE_BUFFERS_3DFX 0x86B3 1365bd8deadSopenharmony_ci SAMPLES_3DFX 0x86B4 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci Accepted by the <mask> parameter of PushAttrib: 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci MULTISAMPLE_BIT_3DFX 0x20000000 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.2 Specification (OpenGL Operation) 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci None 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2 Specification (Rasterization) 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci If SAMPLE_BUFFERS_3DFX is one, the rasterization of all GL 1495bd8deadSopenharmony_ci primitives is changed, and is referred to as multisample 1505bd8deadSopenharmony_ci rasterization. Otherwise primitive rasterization operates as it is 1515bd8deadSopenharmony_ci described in the GL specification, and is referred to as 1525bd8deadSopenharmony_ci single-sample rasterization. The value of SAMPLE_BUFFERS_3DFX is an 1535bd8deadSopenharmony_ci implementation dependent constant, and is queried by calling 1545bd8deadSopenharmony_ci GetIntegerv with pname set to SAMPLE_BUFFERS_3DFX. 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci During multisample rasterization the contents of a pixel fragment 1575bd8deadSopenharmony_ci are changed in two ways. First, each fragment includes a coverage 1585bd8deadSopenharmony_ci mask with SAMPLES_3DFX bits. The value of SAMPLES_3DFX is an 1595bd8deadSopenharmony_ci implementation dependent constant, and is queried by calling 1605bd8deadSopenharmony_ci GetIntegerv with pname set to SAMPLES_3DFX. Second, each fragment 1615bd8deadSopenharmony_ci includes SAMPLES_3DFX depth values, instead of the single depth 1625bd8deadSopenharmony_ci value that is maintained in single-sample rasterization mode. Each 1635bd8deadSopenharmony_ci pixel fragment thus consists of integer x and y grid coordinates, a 1645bd8deadSopenharmony_ci color, SAMPLES_3DFX depth values, texture coordinates, a coverage 1655bd8deadSopenharmony_ci value, and the SAMPLES_3DFX-bit mask. 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci The behavior of multisample rasterization is a function of 1685bd8deadSopenharmony_ci MULTISAMPLE_3DFX, which is enabled and disabled by calling Enable or 1695bd8deadSopenharmony_ci Disable, with cap set to MULTISAMPLE_3DFX. Its value is queried 1705bd8deadSopenharmony_ci using IsEnabled, with cap set to MULTISAMPLE_3DFX. 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is disabled, multisample rasterization of all 1735bd8deadSopenharmony_ci primitives is equivalent to single-sample rasterization, except that 1745bd8deadSopenharmony_ci the fragment coverage mask is set to all ones. The depth values may 1755bd8deadSopenharmony_ci all be set to the single value that would have been assigned by 1765bd8deadSopenharmony_ci single-sample rasterization, or they may be assigned as described 1775bd8deadSopenharmony_ci below for MULTISAMPLE_3DFX-enabled multisample rasterization. 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is enabled, multisample rasterization of all 1805bd8deadSopenharmony_ci primitives differs substantially from single-sample rasterization. 1815bd8deadSopenharmony_ci It is understood that each pixel in the framebuffer has SAMPLES_3DFX 1825bd8deadSopenharmony_ci locations associated with it. These locations are exact positions, 1835bd8deadSopenharmony_ci rather than regions or areas, and each is referred to as a sample 1845bd8deadSopenharmony_ci point. The sample points associated with a pixel may be located 1855bd8deadSopenharmony_ci inside or outside of the unit square that is considered to bound the 1865bd8deadSopenharmony_ci pixel. Furthermore, the pattern (relative location) of sample points 1875bd8deadSopenharmony_ci may be identical for each pixel in the framebuffer, or it may 1885bd8deadSopenharmony_ci differ. The locations of the sample points are fixed by the 1895bd8deadSopenharmony_ci implementation and it is not possible to query the actual sample 1905bd8deadSopenharmony_ci locations of a pixel. 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci If the sample patterns differ per pixel, they should be aligned to 1935bd8deadSopenharmony_ci window, not screen, boundaries. Otherwise rendering results will be 1945bd8deadSopenharmony_ci window-position specific. The invariance requirement described in 1955bd8deadSopenharmony_ci section 3.1 is relaxed for all enabled multisample rasterization, 1965bd8deadSopenharmony_ci because the sample patterns may be a function of pixel location. 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ci 3.3.2 Point Multisample Rasterization 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is enabled, and SAMPLE_BUFFERS_3DFX is one, then 2015bd8deadSopenharmony_ci points are rasterized using the following algorithm, regardless of 2025bd8deadSopenharmony_ci whether point antialiasing (POINT_SMOOTH) is enabled or disabled. 2035bd8deadSopenharmony_ci Point rasterization produces a fragment for each framebuffer pixel 2045bd8deadSopenharmony_ci with one or more sample points that intersect the region lying 2055bd8deadSopenharmony_ci within the circle having diameter equal to the current point width 2065bd8deadSopenharmony_ci and centered at the point's (Xw,Yw). The coverage value for each 2075bd8deadSopenharmony_ci fragment is 1. Mask bits that correspond to sample points that 2085bd8deadSopenharmony_ci intersect the circular region are 1, other mask bits are 0. All 2095bd8deadSopenharmony_ci depth values of the fragment are assigned the depth value of the 2105bd8deadSopenharmony_ci point being rasterized. The data associated with each fragment are 2115bd8deadSopenharmony_ci otherwise the data associated with the point being rasterized. 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci Point size range and number of gradations are equivalent to those 2145bd8deadSopenharmony_ci supported for antialiased points. 2155bd8deadSopenharmony_ci 2165bd8deadSopenharmony_ci 3.4.4 Line Multisample Rasterization 2175bd8deadSopenharmony_ci 2185bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is enabled, and SAMPLE_BUFFERS_3DFX is one, then 2195bd8deadSopenharmony_ci lines are rasterized using the following algorithm, regardless of 2205bd8deadSopenharmony_ci whether line antialiasing (LINE_SMOOTH) is enabled or disabled. Line 2215bd8deadSopenharmony_ci rasterization produces a fragment for each framebuffer pixel with 2225bd8deadSopenharmony_ci one or more sample points that intersect the rectangular region that 2235bd8deadSopenharmony_ci is described in the Antialiasing section of 3.4.2 (Other Line 2245bd8deadSopenharmony_ci Segment Features). If line stippling is enabled, the rectangular 2255bd8deadSopenharmony_ci region is subdivided into adjacent unit-length rectangles, with some 2265bd8deadSopenharmony_ci rectangles eliminated according to the procedure given under Line 2275bd8deadSopenharmony_ci Stipple, where "fragment" is replaced by "rectangle". 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci The coverage value for each fragment is 1. Mask bits that correspond 2305bd8deadSopenharmony_ci to sample points that intersect a retained rectangle are 1, other 2315bd8deadSopenharmony_ci mask bits are 0. Each depth value is produced by substituting the 2325bd8deadSopenharmony_ci corresponding sample location into equation 3.1, then using the 2335bd8deadSopenharmony_ci result to evaluate equation 3.3. The data associated with each 2345bd8deadSopenharmony_ci fragment are otherwise computed by evaluating equation 3.1 at the 2355bd8deadSopenharmony_ci fragment center, then substituting into equation 3.2. 2365bd8deadSopenharmony_ci 2375bd8deadSopenharmony_ci Line width range and number of gradations are equivalent to those 2385bd8deadSopenharmony_ci supported for antialiased lines. 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ci 3.5.7 Polygon Multisample Rasterization 2415bd8deadSopenharmony_ci 2425bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is enabled, and SAMPLE_BUFFERS_3DFX is one, then 2435bd8deadSopenharmony_ci polygons are rasterized using the following algorithm, regardless of 2445bd8deadSopenharmony_ci whether polygon antialiasing (POLYGON_SMOOTH) is enabled or 2455bd8deadSopenharmony_ci disabled. Polygon rasterization produces a fragment for each 2465bd8deadSopenharmony_ci framebuffer pixel with one or more sample points that satisfy the 2475bd8deadSopenharmony_ci point sampling criteria described in section 3.5.1, including the 2485bd8deadSopenharmony_ci special treatment for sample points that lie on a polygon boundary 2495bd8deadSopenharmony_ci edge. If a polygon is culled, based on its orientation and the 2505bd8deadSopenharmony_ci CullFace mode, then no fragments are produced during rasterization. 2515bd8deadSopenharmony_ci Fragments are culled by the polygon stipple just as they are for 2525bd8deadSopenharmony_ci aliased and antialiased polygons. 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci The coverage value for each fragment is 1. Mask bits that correspond 2555bd8deadSopenharmony_ci to sample points that satisfy the point sampling criteria are 1, 2565bd8deadSopenharmony_ci other mask bits are 0. Each depth value is produced by substituting 2575bd8deadSopenharmony_ci the corresponding sample location into the barycentric equations 2585bd8deadSopenharmony_ci described in section 3.5.1, using the approximation to equation 3.4 2595bd8deadSopenharmony_ci that omits w components. The data associated with each fragment are 2605bd8deadSopenharmony_ci otherwise computed by barycentric evaluation using the fragment's 2615bd8deadSopenharmony_ci center point. 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ci If POLYGON_OFFSET_FILL is enabled then the offset value computed in 2645bd8deadSopenharmony_ci equation 3.7 is added to all sample depth values. 2655bd8deadSopenharmony_ci 2665bd8deadSopenharmony_ci The rasterization described above applies only to the FILL state of 2675bd8deadSopenharmony_ci PolygonMode. For POINT and LINE, the rasterizations described in 2685bd8deadSopenharmony_ci 3.3.2 (Point Multisample Rasterization) and 3.4.4 (Line Multisample 2695bd8deadSopenharmony_ci Rasterization) apply with the additional requirement that the sample 2705bd8deadSopenharmony_ci depth values must be offset by the value computed in equation 3.7 2715bd8deadSopenharmony_ci when POLYGON_OFFSET_POINT or POLYGON_OFFSET_LINE is enabled. 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci 3.6.5 Multisample Rasterization of Pixel Rectangles 2745bd8deadSopenharmony_ci 2755bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is enabled, and SAMPLE_BUFFERS_3DFX is one, then 2765bd8deadSopenharmony_ci pixel rectangles are rasterized using the following algorithm. Let 2775bd8deadSopenharmony_ci (Xrp,Yrp) be the current raster position. (If the current raster 2785bd8deadSopenharmony_ci position is invalid, then DrawPixels is ignored.) If a particular 2795bd8deadSopenharmony_ci group (index or components) is the nth in a row and belongs to the 2805bd8deadSopenharmony_ci mth row, consider the region in window coordinates bounded by the 2815bd8deadSopenharmony_ci rectangle with corners 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci (Xrp + Zx*n, Yrp + Zy*m) 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci and 2865bd8deadSopenharmony_ci 2875bd8deadSopenharmony_ci (Xrp + Zx*(n+1), Yrp + Zy*(m+1)) 2885bd8deadSopenharmony_ci 2895bd8deadSopenharmony_ci where Zx and Zy are the pixel zoom factors specified by PixelZoom, 2905bd8deadSopenharmony_ci and may each be either positive or negative. A fragment representing 2915bd8deadSopenharmony_ci group n,m is produced for each framebuffer pixel with one or more 2925bd8deadSopenharmony_ci sample points that lie inside, or on the bottom or left boundary, of 2935bd8deadSopenharmony_ci this rectangle. Each fragment so produced takes its associated data 2945bd8deadSopenharmony_ci from the group and from the current raster position, in a manner 2955bd8deadSopenharmony_ci consistent with SGIX_pixel_texture (if it is implemented) or in a 2965bd8deadSopenharmony_ci manner consistent with the discussion in the Conversion to Fragments 2975bd8deadSopenharmony_ci subsection of section 3.6.4 of the GL specification. All depth 2985bd8deadSopenharmony_ci sample values are assigned the same value, taken either from the 2995bd8deadSopenharmony_ci group (if it is a depth component group) or from the current raster 3005bd8deadSopenharmony_ci position (if it is not). 3015bd8deadSopenharmony_ci 3025bd8deadSopenharmony_ci A single pixel rectangle will generate multiple, perhaps very many 3035bd8deadSopenharmony_ci fragments for the same framebuffer pixel, depending on the pixel 3045bd8deadSopenharmony_ci zoom factors. 3055bd8deadSopenharmony_ci 3065bd8deadSopenharmony_ci 3.7.1 Bitmap Multisample Rasterization 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is enabled, and SAMPLE_BUFFERS_3DFX is one, then 3095bd8deadSopenharmony_ci bitmaps are rasterized using the following algorithm. If the current 3105bd8deadSopenharmony_ci raster position is invalid, the bitmap is ignored. Otherwise, a 3115bd8deadSopenharmony_ci screen-aligned array of pixel-size rectangles is constructed, with 3125bd8deadSopenharmony_ci its lower-left corner at (Xrp,Yrp), and its upper right corner a 3135bd8deadSopenharmony_ci (Xrp+w,Yrp+h), where w and h are the width and height of the bitmap. 3145bd8deadSopenharmony_ci Rectangles in this array are eliminated if the corresponding bit in 3155bd8deadSopenharmony_ci the bitmap is zero, and are retained otherwise. Bitmap rasterization 3165bd8deadSopenharmony_ci produces a fragment for each framebuffer pixel with one or more 3175bd8deadSopenharmony_ci sample points either inside or on the bottom or left edge of a 3185bd8deadSopenharmony_ci retained rectangle. 3195bd8deadSopenharmony_ci 3205bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations 3215bd8deadSopenharmony_ciand the Frame Buffer) 3225bd8deadSopenharmony_ci 3235bd8deadSopenharmony_ci 4.1.9 Multisample Fragment Operations 3245bd8deadSopenharmony_ci 3255bd8deadSopenharmony_ci If the DrawBuffers mode is NONE, no change is made to any 3265bd8deadSopenharmony_ci multisample or color buffer. Otherwise, fragment processing is as 3275bd8deadSopenharmony_ci described below. 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is enabled, and SAMPLE_BUFFERS_3DFX is one, the 3305bd8deadSopenharmony_ci stencil test, depth test, blending, and dithering operations 3315bd8deadSopenharmony_ci described in sections 4.1.4, 4.1.5, 4.1.6, and 4.1.7 are performed 3325bd8deadSopenharmony_ci for each pixel sample, rather than just once for each fragment. 3335bd8deadSopenharmony_ci Failure of the stencil or depth test results in termination of the 3345bd8deadSopenharmony_ci processing of that sample, rather than discarding of the fragment. 3355bd8deadSopenharmony_ci All operations are performed on the color, depth, and stencil values 3365bd8deadSopenharmony_ci stored in the multisample buffer (to be described in a following 3375bd8deadSopenharmony_ci section). The contents of the color buffers are not modified at this 3385bd8deadSopenharmony_ci point. 3395bd8deadSopenharmony_ci 3405bd8deadSopenharmony_ci Stencil, depth, blending, and dithering operations are performed for 3415bd8deadSopenharmony_ci a pixel sample only if that sample's fragment mask bit is 1. If the 3425bd8deadSopenharmony_ci corresponding mask bit is 0, no operations are performed for that 3435bd8deadSopenharmony_ci sample. Depth operations use the fragment depth value that is 3445bd8deadSopenharmony_ci specific to each sample. The single fragment color value is used for 3455bd8deadSopenharmony_ci all sample operations, however, as is the current stencil value. 3465bd8deadSopenharmony_ci 3475bd8deadSopenharmony_ci If MULTISAMPLE_3DFX is disabled, and SAMPLE_BUFFERS_3DFX is one, the 3485bd8deadSopenharmony_ci fragment may be treated exactly as described above, with 3495bd8deadSopenharmony_ci optimization possible because the fragment mask must be all 1's. 3505bd8deadSopenharmony_ci Further optimization is allowed, however. An implementation may 3515bd8deadSopenharmony_ci choose to identify a centermost sample, and to perform stencil and 3525bd8deadSopenharmony_ci depth tests on only that sample. Regardless of the outcome of the 3535bd8deadSopenharmony_ci stencil test, all multisample buffer stencil sample values are set 3545bd8deadSopenharmony_ci to the appropriate new stencil value. If the depth test passes, all 3555bd8deadSopenharmony_ci multisample buffer depth sample values are set to the depth of the 3565bd8deadSopenharmony_ci fragment's centermost sample's depth value, and all multisample 3575bd8deadSopenharmony_ci buffer color sample values are set to the color value of the 3585bd8deadSopenharmony_ci incoming fragment. Otherwise, no change is made to any multisample 3595bd8deadSopenharmony_ci buffer color or depth value. 3605bd8deadSopenharmony_ci 3615bd8deadSopenharmony_ci After all operations have been completed on the multisample buffer, 3625bd8deadSopenharmony_ci the color sample values are combined to produce a single color 3635bd8deadSopenharmony_ci value, and that value is written into each color buffer that is 3645bd8deadSopenharmony_ci currently enabled, based on the DrawBuffers mode. The method of 3655bd8deadSopenharmony_ci combination is not specified, though a simple average computed 3665bd8deadSopenharmony_ci independently for each color component is recommended. 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci 4.2.2.5 Fine Control of Multisample Buffer Updates 3695bd8deadSopenharmony_ci 3705bd8deadSopenharmony_ci When SAMPLE_BUFFERS_3DFX is one, ColorMask, DepthMask, and 3715bd8deadSopenharmony_ci StencilMask control the modification of values in the multisample 3725bd8deadSopenharmony_ci buffer. The color mask has no effect on modifications to the color 3735bd8deadSopenharmony_ci buffers. If the color mask is entirely disabled, the color sample 3745bd8deadSopenharmony_ci values must still be combined (as described above) and the result 3755bd8deadSopenharmony_ci used to replace the color values of the buffers enabled by 3765bd8deadSopenharmony_ci DrawBuffers. 3775bd8deadSopenharmony_ci 3785bd8deadSopenharmony_ci 4.2.3.5 Clearing the Multisample Buffer 3795bd8deadSopenharmony_ci 3805bd8deadSopenharmony_ci The color samples of the multisample buffer are cleared when one or 3815bd8deadSopenharmony_ci more color buffers are cleared, as specified by the Clear mask bit 3825bd8deadSopenharmony_ci COLOR_BUFFER_BIT and the DrawBuffers mode. If the DrawBuffers mode 3835bd8deadSopenharmony_ci is NONE, the color samples of the multisample buffer cannot be 3845bd8deadSopenharmony_ci cleared. 3855bd8deadSopenharmony_ci 3865bd8deadSopenharmony_ci Clear mask bits DEPTH_BUFFER_BIT and STENCIL_BUFFER_BIT indicate 3875bd8deadSopenharmony_ci that the depth and stencil samples of the multisample buffer are to 3885bd8deadSopenharmony_ci be cleared. If Clear mask bit DEPTH_BUFFER_BIT is specified, and if 3895bd8deadSopenharmony_ci the DrawBuffers mode is not NONE, then the multisample depth buffer 3905bd8deadSopenharmony_ci samples are cleared. Likewise, if Clear mask bit STENCIL_BUFFER_BIT 3915bd8deadSopenharmony_ci is specified, and if the DrawBuffers mode is not NONE, then the 3925bd8deadSopenharmony_ci multisample stencil buffer is cleared. 3935bd8deadSopenharmony_ci 3945bd8deadSopenharmony_ci 4.3.2 Reading Pixels 3955bd8deadSopenharmony_ci 3965bd8deadSopenharmony_ci [These changes are made to the text in section 4.3.2, following the 3975bd8deadSopenharmony_ci subheading Obtaining Pixels from the Framebuffer.] 3985bd8deadSopenharmony_ci 3995bd8deadSopenharmony_ci Follow the sentence "If there is no depth buffer, the error 4005bd8deadSopenharmony_ci INVALID_OPERATION occurs." with: If there is a multisample buffer 4015bd8deadSopenharmony_ci (SAMPLE_BUFFERS_3DFX is 1) then values are obtained from the depth 4025bd8deadSopenharmony_ci samples in this buffer. It is recommended that the depth value of 4035bd8deadSopenharmony_ci the centermost sample be used, though implementations may choose any 4045bd8deadSopenharmony_ci function of the depth sample values at each pixel. 4055bd8deadSopenharmony_ci 4065bd8deadSopenharmony_ci Follow the sentence "if there is no stencil buffer, the error 4075bd8deadSopenharmony_ci INVALID_OPERATION occurs." with: If there is a multisample buffer, 4085bd8deadSopenharmony_ci then values are obtained from the stencil samples in this buffer. It 4095bd8deadSopenharmony_ci is recommended that the stencil value of the centermost sample be 4105bd8deadSopenharmony_ci used, though implementations may choose any function of the stencil 4115bd8deadSopenharmony_ci sample values at each pixel. 4125bd8deadSopenharmony_ci 4135bd8deadSopenharmony_ci This extension makes no change to the way that color values are 4145bd8deadSopenharmony_ci obtained from the framebuffer. 4155bd8deadSopenharmony_ci 4165bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2 Specification (Special Functions) 4175bd8deadSopenharmony_ci 4185bd8deadSopenharmony_ci None 4195bd8deadSopenharmony_ci 4205bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2 Specification (State and State Requests) 4215bd8deadSopenharmony_ci 4225bd8deadSopenharmony_ci An additional group of state variables, MULTISAMPLE_BIT_3DFX, is 4235bd8deadSopenharmony_ci defined by this extension. When PushAttrib is called with bit 4245bd8deadSopenharmony_ci MULTISAMPLE_BIT_3DFX set, the multisample group of state variables 4255bd8deadSopenharmony_ci is pushed onto the attribute stack. When PopAttrib is called, these 4265bd8deadSopenharmony_ci state variables are restored to their previous values if they were 4275bd8deadSopenharmony_ci pushed. Some multisample state is included in the ENABLE_BIT group 4285bd8deadSopenharmony_ci as well. In order to avoid incompatibility with GL implementations 4295bd8deadSopenharmony_ci that do not support 3DFX_multisample, ALL_ATTRIB_BITS does not 4305bd8deadSopenharmony_ci include MULTISAMPLE_BIT_3DFX. 4315bd8deadSopenharmony_ci 4325bd8deadSopenharmony_ciAdditions to the GLX 1.3 Specification 4335bd8deadSopenharmony_ci 4345bd8deadSopenharmony_ci The parameter GLX_SAMPLE_BUFFERS_3DFX is added to 4355bd8deadSopenharmony_ci glXGetFBConfigAttrib. When queried, by calling glXGetFBConfigAttrib 4365bd8deadSopenharmony_ci with attribute set to GLX_SAMPLE_BUFFERS_3DFX, it returns the number 4375bd8deadSopenharmony_ci of multisample buffers included in the visual. For a normal visual, 4385bd8deadSopenharmony_ci the return value is zero. A return value of one indicates that a 4395bd8deadSopenharmony_ci single multisample buffer is available. The number of samples per 4405bd8deadSopenharmony_ci pixel is queried by calling glXGetFBConfigAttrib with attribute set 4415bd8deadSopenharmony_ci to GLX_SAMPLES_3DFX. It is understood that the number of color, 4425bd8deadSopenharmony_ci depth, and stencil bits per sample in the multisample buffer are as 4435bd8deadSopenharmony_ci specified by the GLX_*_SIZE parameters. It is also understood that 4445bd8deadSopenharmony_ci there are no single-sample depth or stencil buffers associated with 4455bd8deadSopenharmony_ci this visual -- the only depth and stencil buffers are those in the 4465bd8deadSopenharmony_ci multisample buffer. GLX_SAMPLES_3DFX is zero if 4475bd8deadSopenharmony_ci GLX_SAMPLE_BUFFERS_3DFX is zero. 4485bd8deadSopenharmony_ci 4495bd8deadSopenharmony_ci glXChooseFBConfig accepts GLX_SAMPLE_BUFFERS_3DFX in attrib_list, 4505bd8deadSopenharmony_ci followed by the minimum number of multisample buffers that can be 4515bd8deadSopenharmony_ci accepted. Visuals with the smallest number of multisample buffers 4525bd8deadSopenharmony_ci that meets or exceeds the specified minimum number are preferred. 4535bd8deadSopenharmony_ci Currently operation with more than one multisample buffer is 4545bd8deadSopenharmony_ci undefined, so the returned value will be either zero or one. 4555bd8deadSopenharmony_ci 4565bd8deadSopenharmony_ci glXChooseFBConfig accepts GLX_SAMPLES_3DFX in attrib_list, followed 4575bd8deadSopenharmony_ci by the minimum number of samples that can be accepted in the 4585bd8deadSopenharmony_ci multisample buffer. Visuals with the smallest number of samples that 4595bd8deadSopenharmony_ci meets or exceeds the specified minimum number are preferred. 4605bd8deadSopenharmony_ci 4615bd8deadSopenharmony_ci The multisample FBConfig attributes are added to table 3.4 as follows: 4625bd8deadSopenharmony_ci 4635bd8deadSopenharmony_ci Attribute Default Selection Criteria Sort Priority 4645bd8deadSopenharmony_ci --------- ------- ------------------ ------------- 4655bd8deadSopenharmony_ci GLX_SAMPLE_BUFFERS_3DFX 0 Smaller 4665bd8deadSopenharmony_ci GLX_SAMPLES_3DFX 0 Smaller 4675bd8deadSopenharmony_ci 4685bd8deadSopenharmony_ci If the GLX implementation is 1.2 or less, then 4695bd8deadSopenharmony_ci GLX_SAMPLE_BUFFERS_3DFX and GLX_SAMPLES_3DFX are accepted by 4705bd8deadSopenharmony_ci glXChooseVisual and glXGetConfig. 4715bd8deadSopenharmony_ci 4725bd8deadSopenharmony_ci If the color samples in the multisample buffer store fewer bits than 4735bd8deadSopenharmony_ci are stored in the color buffers, this fact will not be reported 4745bd8deadSopenharmony_ci accurately. Presumably a compression scheme is being employed, and 4755bd8deadSopenharmony_ci is expected to maintain an aggregate resolution equal to that of the 4765bd8deadSopenharmony_ci color buffers. 4775bd8deadSopenharmony_ci 4785bd8deadSopenharmony_ciAdditions to WGL 4795bd8deadSopenharmony_ci 4805bd8deadSopenharmony_ci The parameters WGL_SAMPLE_BUFFERS_3DFX and WGL_SAMPLES_3DFX are 4815bd8deadSopenharmony_ci added to wglGetPixelFormatAttribivARB and 4825bd8deadSopenharmony_ci wglGetPixelFormatAttribfvARB. WGL_SAMPLE_BUFFERS_3DFX indicates the 4835bd8deadSopenharmony_ci number of multisample buffers included in the pixel format. For a 4845bd8deadSopenharmony_ci normal pixel format, the return value is zero. A return value of one 4855bd8deadSopenharmony_ci indicates that a single multisample buffer is available. 4865bd8deadSopenharmony_ci WGL_SAMPLES_3DFX gives the number of samples per pixel. It is 4875bd8deadSopenharmony_ci understood that the number of color, depth, and stencil bits per 4885bd8deadSopenharmony_ci sample in the multisample buffer are as specified by the WGL_*_BITS 4895bd8deadSopenharmony_ci parameters. It is also understood that there are no single-sample 4905bd8deadSopenharmony_ci depth or stencil buffers associated with this pixel format -- the 4915bd8deadSopenharmony_ci only depth and stencil buffers are those in the multisample buffer. 4925bd8deadSopenharmony_ci WGL_SAMPLES_3DFX is zero if WGL_SAMPLE_BUFFERS_3DFX is zero. 4935bd8deadSopenharmony_ci 4945bd8deadSopenharmony_ci wglChoosePixelFormatARB accepts WGL_SAMPLE_BUFFERS_3DFX in 4955bd8deadSopenharmony_ci piAttribIList and/or pfAttribFList, followed by the minimum number 4965bd8deadSopenharmony_ci of multisample buffers that can be accepted. Pixel formats with the 4975bd8deadSopenharmony_ci smallest number of multisample buffers that meet or exceed the 4985bd8deadSopenharmony_ci specified minimum number are preferred. Currently operation with 4995bd8deadSopenharmony_ci more than one multisample buffer is undefined, so the returned value 5005bd8deadSopenharmony_ci will be either zero or one. 5015bd8deadSopenharmony_ci 5025bd8deadSopenharmony_ci wglChoosePixelFormatARB accepts WGL_SAMPLES_3DFX in piAttribIList 5035bd8deadSopenharmony_ci and/or pfAttribFList, followed by the minimum number of samples that 5045bd8deadSopenharmony_ci can be accepted in the multisample buffer. Pixel formats with the 5055bd8deadSopenharmony_ci smallest number of samples that meet or exceed the specified minimum 5065bd8deadSopenharmony_ci number are preferred. 5075bd8deadSopenharmony_ci 5085bd8deadSopenharmony_ciErrors 5095bd8deadSopenharmony_ci 5105bd8deadSopenharmony_ci None 5115bd8deadSopenharmony_ci 5125bd8deadSopenharmony_ciNew State 5135bd8deadSopenharmony_ci 5145bd8deadSopenharmony_ci 5155bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Attribute 5165bd8deadSopenharmony_ci --------- ----------- ---- ------------- --------- 5175bd8deadSopenharmony_ci MULTISAMPLE_3DFX IsEnabled B TRUE multisample/enable 5185bd8deadSopenharmony_ci 5195bd8deadSopenharmony_ciNew Implementation Dependent State 5205bd8deadSopenharmony_ci 5215bd8deadSopenharmony_ci Get Value Get Command Type Minimum Value 5225bd8deadSopenharmony_ci --------- ----------- ---- ------------- 5235bd8deadSopenharmony_ci SAMPLE_BUFFERS_3DFX GetIntegerv Z+ 0 5245bd8deadSopenharmony_ci SAMPLES_3DFX GetIntegerv Z+ 0 5255bd8deadSopenharmony_ci 5265bd8deadSopenharmony_ciDependencies on GLX 1.3 and GLX_EXT_fbconfig 5275bd8deadSopenharmony_ci 5285bd8deadSopenharmony_ci If GLX 1.3 is not supported and GLX_EXT_fbconfig is not supported 5295bd8deadSopenharmony_ci then all references to glXGetFBConfigAttrib and glXGetConfig are 5305bd8deadSopenharmony_ci removed. 5315bd8deadSopenharmony_ci 5325bd8deadSopenharmony_ciRevision History 5335bd8deadSopenharmony_ci 5345bd8deadSopenharmony_ci Version 1.1 - April 18, 2000 (Jon Leech, SGI) 5355bd8deadSopenharmony_ci 5365bd8deadSopenharmony_ci Specified value of MULTISAMPLE_BIT_3DFX. Assigned values to 5375bd8deadSopenharmony_ci GLX_SAMPLE_BUFFERS_3DFX and GLX_SAMPLES_3DFX. Conversion from 5385bd8deadSopenharmony_ci HTML -> text and formatting cleanup. 539