1Name 2 3 ARB_multisample 4 5Name Strings 6 7 GL_ARB_multisample 8 GLX_ARB_multisample 9 WGL_ARB_multisample 10 11Contact 12 13 Dale Kirkland, NVIDIA (dkirkland 'at' nvidia.com) 14 Bill Armstrong, E&S (armstron 'at' es.com) 15 Michael Gold, NVIDIA (gold 'at' nvidia.com) 16 Jon Leech, SGI (ljp 'at' sgi.com) 17 Paula Womack, 3dfx (paulaw 'at' 3dfx.com) 18 19Notice 20 21 Copyright (c) 1999-2013 The Khronos Group Inc. Copyright terms at 22 http://www.khronos.org/registry/speccopyright.html 23 24Specification Update Policy 25 26 Khronos-approved extension specifications are updated in response to 27 issues and bugs prioritized by the Khronos OpenGL Working Group. For 28 extensions which have been promoted to a core Specification, fixes will 29 first appear in the latest version of that core Specification, and will 30 eventually be backported to the extension document. This policy is 31 described in more detail at 32 https://www.khronos.org/registry/OpenGL/docs/update_policy.php 33 34Status 35 36 Approved by ARB on 12/8/1999. 37 GLX protocol must still be defined. 38 39Version 40 41 Last Modified Date: March 12, 2002 42 Author Revision: 0.6 43 44 Based on: SGIS_Multisample Specification 45 Date: 1994/11/22 Revision: 1.14 46 47Number 48 49 ARB Extension #5 50 51Dependencies 52 53 WGL_EXT_extensions_string is required. 54 WGL_EXT_pixel_format is required. 55 56Overview 57 58 This extension provides a mechanism to antialias all GL primitives: 59 points, lines, polygons, bitmaps, and images. The technique is to 60 sample all primitives multiple times at each pixel. The color 61 sample values are resolved to a single, displayable color each time 62 a pixel is updated, so the antialiasing appears to be automatic at 63 the application level. Because each sample includes depth and 64 stencil information, the depth and stencil functions perform 65 equivalently to the single-sample mode. 66 67 An additional buffer, called the multisample buffer, is added to 68 the framebuffer. Pixel sample values, including color, depth, and 69 stencil values, are stored in this buffer. When the framebuffer 70 includes a multisample buffer, it does not also include separate 71 depth or stencil buffers, even if the multisample buffer does not 72 store depth or stencil values. Color buffers (left/right, front/ 73 back, and aux) do coexist with the multisample buffer, however. 74 75 Multisample antialiasing is most valuable for rendering polygons, 76 because it requires no sorting for hidden surface elimination, and 77 it correctly handles adjacent polygons, object silhouettes, and 78 even intersecting polygons. If only points or lines are being 79 rendered, the "smooth" antialiasing mechanism provided by the base 80 GL may result in a higher quality image. This extension is 81 designed to allow multisample and smooth antialiasing techniques 82 to be alternated during the rendering of a single scene. 83 84IP Status 85 86 TBD 87 88Issues 89 90 1. Multiple passes have been taken out. Is this acceptable? 91 92 RESOLUTION: Yes. This can be added back with an additional 93 extension if needed. 94 95 2. Would SampleAlphaARB be a better name for the function 96 SampleMaskARB? If so, the name SAMPLE_MASK_ARB should also be 97 changed to SAMPLE_ALPHA_ARB. 98 99 RESOLUTION: Names containing "mask" were changed to use 100 "coverage" instead. 101 102 3. Should the SampleCoverageARB function be changed to allow 103 blending between more than two objects? 104 105 RESOLUTION: Not addressed by this extension. An additional 106 extension has been proposed that allows a coverage range for 107 each object. The coverage range is a min and max value that 108 can be used to blend multiple objects at different level-of- 109 detail fading. The SampleCoverageARB function will layer on 110 this new extension. 111 112New Procedures and Functions 113 114 void SampleCoverageARB(clampf value, 115 boolean invert); 116 117New Tokens 118 119 Accepted by the <attribList> parameter of glXChooseVisual, and by 120 the <attrib> parameter of glXGetConfig: 121 122 GLX_SAMPLE_BUFFERS_ARB 100000 123 GLX_SAMPLES_ARB 100001 124 125 Accepted by the <piAttributes> parameter of 126 wglGetPixelFormatAttribivEXT, wglGetPixelFormatAttribfvEXT, and 127 the <piAttribIList> and <pfAttribIList> of wglChoosePixelFormatEXT: 128 129 WGL_SAMPLE_BUFFERS_ARB 0x2041 130 WGL_SAMPLES_ARB 0x2042 131 132 Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, 133 and by the <pname> parameter of GetBooleanv, GetIntegerv, 134 GetFloatv, and GetDoublev: 135 136 MULTISAMPLE_ARB 0x809D 137 SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E 138 SAMPLE_ALPHA_TO_ONE_ARB 0x809F 139 SAMPLE_COVERAGE_ARB 0x80A0 140 141 Accepted by the <mask> parameter of PushAttrib: 142 143 MULTISAMPLE_BIT_ARB 0x20000000 144 145 Accepted by the <pname> parameter of GetBooleanv, GetDoublev, 146 GetIntegerv, and GetFloatv: 147 148 SAMPLE_BUFFERS_ARB 0x80A8 149 SAMPLES_ARB 0x80A9 150 SAMPLE_COVERAGE_VALUE_ARB 0x80AA 151 SAMPLE_COVERAGE_INVERT_ARB 0x80AB 152 153Additions to Chapter 2 of the 1.2.1 Specification (OpenGL Operation) 154 155 None 156 157Additions to Chapter 3 of the 1.2.1 Specification (Rasterization) 158 159 If SAMPLE_BUFFERS_ARB is a value of one, the rasterization of all 160 GL primitives is changed, and is referred to as multisample 161 rasterization. Otherwise, primitive rasterization operates as it is 162 described in the GL specification, and is referred to as single- 163 sample rasterization. The value of SAMPLE_BUFFERS_ARB is an 164 implementation dependent constant, and is queried by calling 165 GetIntegerv with <pname> set to SAMPLE_BUFFERS_ARB. This value is 166 the same as GLX_SAMPLE_BUFFERS_ARB or WGL_SAMPLE_BUFFERS_ARB for 167 the visual or pixel format associated with the context. 168 169 During multisample rendering the contents of a pixel fragment are 170 changed in two ways. First, each fragment includes a coverage 171 value with SAMPLES_ARB bits. The value of SAMPLES_ARB is an 172 implementation-dependent constant, and is queried by calling 173 GetIntegerv with <pname> set to SAMPLES_ARB. Second, each fragment 174 includes SAMPLES_ARB depth values, instead of the single depth 175 value that is maintained in single-sample rendering mode. Each 176 pixel fragment thus consists of integer x and y grid coordinates, 177 a color, SAMPLES_ARB depth values, texture coordinates, and a 178 coverage value with a maximum of SAMPLES_ARB bits. 179 180 The behavior of multisample rasterization is a function of 181 MULTISAMPLE_ARB, which is enabled and disabled by calling Enable or 182 Disable, with <cap> set to MULTISAMPLE_ARB. Its value is queried 183 using IsEnabled, with <cap> set to MULTISAMPLE_ARB. 184 185 If MULTISAMPLE_ARB is disabled, multisample rasterization of all 186 primitives is equivalent to single-sample rasterization, except 187 that the fragment coverage value is set to full coverage. The 188 depth values may all be set to the single value that would have 189 been assigned by single-sample rasterization, or they may be 190 assigned as described below for multisample rasterization. 191 192 If MULTISAMPLE_ARB is enabled, multisample rasterization of all 193 primitives differs substantially from single-sample rasterization. 194 It is understood that each pixel in the framebuffer has SAMPLES_ARB 195 locations associated with it. These locations are exact positions, 196 rather than regions or areas, and each is referred to as a sample 197 point. The sample points associated with a pixel may be located 198 inside or outside of the unit square that is considered to bound 199 the pixel. Furthermore, the relative locations of sample points 200 may be identical for each pixel in the framebuffer, or they may 201 differ. 202 203 If the sample locations differ per pixel, they should be aligned to 204 window, not screen, boundaries. Otherwise rendering results will 205 be window-position specific. The invariance requirement described 206 in section 3.1 is relaxed for all enabled multisample rendering, 207 because the sample locations may be a function of pixel location. 208 209 It is not possible to query the actual sample locations of a pixel. 210 211 Point Multisample Rasterization 212 [Insert before section 3.3.1] 213 214 If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is a value of 215 one, then points are rasterized using the following algorithm, 216 regardless of whether point antialiasing (POINT_SMOOTH) is enabled 217 or disabled. Point rasterization produces a fragment for each 218 framebuffer pixel with one or more sample points that intersect the 219 region lying within the circle having diameter equal to the current 220 point width and centered at the point's (Xw,Yw). Coverage bits 221 that correspond to sample points that intersect the circular region 222 are 1, other coverage bits are 0. All depth values of the fragment 223 are assigned the depth value of the point being rasterized. Other 224 data associated with each fragment are the data associated with the 225 point being rasterized. 226 227 Point size range and number of gradations are equivalent to those 228 supported for antialiased points. 229 230 Line Multisample Rasterization 231 [Insert before section 3.4.3] 232 233 If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is a value of 234 one, then lines are rasterized using the following algorithm, 235 regardless of whether line antialiasing (LINE_SMOOTH) is enabled 236 or disabled. Line rasterization produces a fragment for each 237 framebuffer pixel with one or more sample points that intersect the 238 rectangular region that is described in the Antialiasing section of 239 3.4.2 (Other Line Segment Features). If line stippling is enabled, 240 the rectangular region is subdivided into adjacent unit-length 241 rectangles, with some rectangles eliminated according to the 242 procedure given under Line Stipple, where "fragment" is replaced 243 by "rectangle". 244 245 Coverage bits that correspond to sample points that intersect a 246 retained rectangle are 1, other coverage bits are 0. Each depth 247 value is produced by substituting the corresponding sample location 248 into equation 3.1, then using the result to evaluate equation 3.3. 249 The data associated with each fragment are otherwise computed by 250 evaluating equation 3.1 at the fragment center, then substituting 251 into equation 3.2. 252 253 Line width range and number of gradations are equivalent to those 254 supported for antialiased lines. 255 256 Polygon Multisample Rasterization 257 [Insert before section 3.5.6] 258 259 If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is a value of 260 one, then polygons are rasterized using the following algorithm, 261 regardless of whether polygon antialiasing (POLYGON_SMOOTH) is 262 enabled or disabled. Polygon rasterization produces a fragment for 263 each framebuffer pixel with one or more sample points that satisfy 264 the point sampling criteria described in section 3.5.1, including 265 the special treatment for sample points that lie on a polygon 266 boundary edge. If a polygon is culled, based on its orientation 267 and the CullFace mode, then no fragments are produced during 268 rasterization. Fragments are culled by the polygon stipple just as 269 they are for aliased and antialiased polygons. 270 271 Coverage bits that correspond to sample points that satisfy the 272 point sampling criteria are 1, other coverage bits are 0. Each 273 depth value is produced by substituting the corresponding sample 274 location into the barycentric equations described in section 3.5.1, 275 using the approximation to equation 3.4 that omits w components. 276 The data associated with each fragment are otherwise computed by 277 barycentric evaluation using the fragment's center point. 278 279 The rasterization described above applies only to the FILL state of 280 PolygonMode. For POINT and LINE, the rasterizations described in 281 the Point Multisample Rasterization and the Line Multisample 282 Rasterization sections apply. 283 284 Pixel Rectangle Multisample Rasterization 285 [Insert before section 3.6.5] 286 287 If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is a value of 288 one, then pixel rectangles are rasterized using the following 289 algorithm. Let (Xrp,Yrp) be the current raster position. (If the 290 current raster position is invalid, then DrawPixels is ignored.) 291 If a particular group (index or components) is the nth in a row and 292 belongs to the mth row, consider the region in window coordinates 293 bounded by the rectangle with corners 294 295 (Xrp + Zx*n, Yrp + Zy*m) 296 297 and 298 299 (Xrp + Zx*(n+1), Yrp + Zy*(m+1)) 300 301 where Zx and Zy are the pixel zoom factors specified by PixelZoom, 302 and may each be either positive or negative. A fragment 303 representing group n,m is produced for each framebuffer pixel with 304 one or more sample points that lie inside, or on the bottom or 305 left boundary, of this rectangle. Each fragment so produced takes 306 its associated data from the group and from the current raster 307 position, in a manner consistent with the discussion in the 308 Conversion to Fragments subsection of section 3.6.4 of the GL 309 specification. All depth sample values are assigned the same 310 value, taken either from the group (if it is a depth component 311 group) or from the current raster position (if it is not). 312 313 A single pixel rectangle will generate multiple, perhaps very many 314 fragments for the same framebuffer pixel, depending on the pixel 315 zoom factors. 316 317 Bitmap Multisample Rasterization 318 [Insert at the end section 3.7] 319 320 If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is a value of 321 one, then bitmaps are rasterized using the following algorithm. If 322 the current raster position is invalid, the bitmap is ignored. 323 Otherwise, a screen-aligned array of pixel-size rectangles is 324 constructed, with its lower-left corner at (Xrp,Yrp), and its upper 325 right corner at (Xrp+w,Yrp+h), where w and h are the width and 326 height of the bitmap. Rectangles in this array are eliminated if 327 the corresponding bit in the bitmap is zero, and are retained 328 otherwise. Bitmap rasterization produces a fragment for each 329 framebuffer pixel with one or more sample points either inside or 330 on the bottom or left edge of a retained rectangle. 331 332 Coverage bits that correspond to sample points either inside or on 333 the bottom or left edge of a retained rectangle are 1, other 334 coverage bits are 0. The associated data for each fragment are 335 those associated with the current raster position. Once the 336 fragments have been produced, the current raster position is 337 updated exactly as it is in the single-sample rasterization case. 338 339Additions to Chapter 4 of the 1.2.1 Specification (Per-Fragment 340Operations and the Frame Buffer) 341 342 Multisample Fragment Operations 343 [Insert after section 4.1.2] 344 345 This step modifies fragment alpha and coverage values based on the 346 values of SAMPLE_ALPHA_TO_COVERAGE_ARB, SAMPLE_ALPHA_TO_ONE_ARB, 347 SAMPLE_COVERAGE_ARB, SAMPLE_COVERAGE_VALUE_ARB, and 348 SAMPLE_COVERAGE_INVERT_ARB. No changes to the fragment alpha or 349 coverage values are made at this step if MULTISAMPLE_ARB is 350 disabled, or if SAMPLE_BUFFERS_ARB is not a value of one. 351 352 SAMPLE_ALPHA_TO_COVERAGE_ARB, SAMPLE_ALPHA_TO_ONE_ARB, and 353 SAMPLE_COVERAGE_ARB are enabled and disabled by calling Enable and 354 Disable with <cap> specified as one of the three token values. All 355 three values are queried by calling IsEnabled, with <cap> set to 356 the desired token value. If SAMPLE_ALPHA_TO_COVERAGE_ARB is 357 enabled, the fragment alpha value is used to generate a temporary 358 coverage value, which is then ANDed with the fragment coverage 359 value. Otherwise the fragment coverage value is unchanged at 360 this point. 361 362 This specification does not require a specific algorithm for 363 converting an alpha value to a temporary coverage value. It is 364 intended that the number of 1's in the temporary coverage be 365 proportional to the alpha value, with all 1's corresponding to the 366 maximum alpha value, and all 0's corresponding to an alpha value 367 of 0. It is also intended that the algorithm be pseudo-random in 368 nature, to avoid image artifacts due to regular coverage sample 369 locations. The algorithm can and probably should be different 370 at different pixel locations. If it does differ, it should be 371 defined relative to window, not screen, coordinates, so that 372 rendering results are invariant with respect to window position. 373 374 Next, if SAMPLE_ALPHA_TO_ONE_ARB is enabled, fragment alpha is 375 replaced by the maximum representable alpha value. Otherwise, 376 fragment alpha value is not changed. 377 378 Finally, if SAMPLE_COVERAGE_ARB is enabled, the fragment coverage 379 is ANDed with another temporary coverage. This temporary coverage 380 is generated in the same manner as the one described above, but as 381 a function of the value of SAMPLE_COVERAGE_VALUE_ARB. The function 382 need not be identical, but it must have the same properties of 383 proportionality and invariance. If SAMPLE_COVERAGE_INVERT_ARB is 384 TRUE, the temporary coverage is inverted (all bit values are 385 inverted) before it is ANDed with the fragment coverage. 386 387 The values of SAMPLE_COVERAGE_VALUE_ARB and 388 SAMPLE_COVERAGE_INVERT_ARB are specified simultaneously by calling 389 SampleCoverageARB, with <value> set to the desired coverage value, 390 and <invert> set to TRUE or FALSE. <value> is clamped to [0,1] 391 before being stored as SAMPLE_COVERAGE_VALUE_ARB. 392 SAMPLE_COVERAGE_VALUE_ARB is queried by calling GetFloatv with 393 <pname> set to SAMPLE_COVERAGE_VALUE_ARB. 394 SAMPLE_COVERAGE_INVERT_ARB is queried by calling GetBooleanv with 395 <pname> set to SAMPLE_COVERAGE_INVERT_ARB. 396 397 Multisample Fragment Operations 398 [Insert after section 4.1.8] 399 400 If the DrawBuffers mode is NONE, no change is made to any 401 multisample or color buffer. Otherwise, fragment processing is as 402 described below. 403 404 If MULTISAMPLE_ARB is enabled, and SAMPLE_BUFFERS_ARB is one, the 405 stencil test, depth test, blending, and dithering operations 406 are performed for each pixel sample, rather than just once for each 407 fragment. Failure of the stencil or depth test results in 408 termination of the processing of that sample, rather than 409 discarding of the fragment. All operations are performed on the 410 color, depth, and stencil values stored in the multisample buffer 411 (to be described in a following section). The contents of the 412 color buffers are not modified at this point. 413 414 Stencil, depth, blending, and dithering operations are performed 415 for a pixel sample only if that sample's fragment coverage bit is 416 a value of 1. If the corresponding coverage bit is 0, no 417 operations are performed for that sample. Depth operations use 418 the fragment depth value that is specific for each sample. The 419 single fragment color value is used for all sample operations, 420 however, as is the current stencil value. 421 422 If MULTISAMPLE_ARB is disabled, and SAMPLE_BUFFERS_ARB is one, the 423 fragment may be treated exactly as described above, with 424 optimization possible because the fragment coverage must be set 425 to full coverage. Further optimization is allowed, however. An 426 implementation may choose to identify a centermost sample, and to 427 perform stencil and depth tests on only that sample. Regardless 428 of the outcome of the stencil test, all multisample buffer stencil 429 sample values are set to the appropriate new stencil value. If 430 the depth test passes, all multisample buffer depth sample values 431 are set to the depth of the fragment's centermost sample's depth 432 value, and all multisample buffer color sample values are set to 433 the color value of the incoming fragment. Otherwise, no change is 434 made to any multisample buffer color or depth value. 435 436 After all operations have been completed on the multisample buffer, 437 the color sample values are combined to produce a single color 438 value, and that value is written into each color buffer that is 439 currently enabled, based on the DrawBuffers mode. An 440 implementation may defer the writing of the color buffer until a 441 later time, but the state of the framebuffer must behave as if the 442 color buffer was updated as each fragment was processed. The 443 method of combination is not specified, though a simple average 444 computed independently for each color component is recommended. 445 446 Fine Control of Multisample Buffer Updates 447 [Insert at the end of section 4.2.2] 448 449 When SAMPLE_BUFFERS_ARB is one, ColorMask, DepthMask, and 450 StencilMask control the modification of values in the multisample 451 buffer. The color mask has no effect on modifications to the color 452 buffers. If the color mask is entirely disabled, the color sample 453 values must still be combined (as described above) and the result 454 used to replace the color values of the buffers enabled by 455 DrawBuffers. 456 457 Clearing the Multisample Buffer 458 [Insert as a subsection for section 4.2.3] 459 460 The color samples of the multisample buffer are cleared when one or 461 more color buffers are cleared, as specified by the Clear mask bit 462 COLOR_BUFFER_BIT and the DrawBuffers mode. If the DrawBuffers mode 463 is NONE, the color samples of the multisample buffer cannot be 464 cleared. 465 466 Clear mask bits DEPTH_BUFFER_BIT and STENCIL_BUFFER_BIT indicate 467 that the depth and stencil samples of the multisample buffer are to 468 be cleared. If Clear mask bit DEPTH_BUFFER_BIT is specified, and 469 if the DrawBuffers mode is not NONE, then the multisample depth 470 buffer samples are cleared. Likewise, if Clear mask bit 471 STENCIL_BUFFER_BIT is specified, and if the DrawBuffers mode is 472 not NONE, then the multisample stencil buffer is cleared. 473 474 Reading Pixels 475 [These changes are made to the text in section 4.3.2, following the 476 subheading Obtaining Pixels from the Framebuffer.] 477 478 Follow the sentence "If there is no depth buffer, the error 479 INVALID_OPERATION occurs." with: If there is a multisample buffer 480 (SAMPLE_BUFFERS_ARB is 1) then values are obtained from the depth 481 samples in this buffer. It is recommended that the depth value 482 of the centermost sample be used, though implementations may choose 483 any function of the depth sample values at each pixel. 484 485 Follow the sentence "if there is no stencil buffer, the error 486 INVALID_OPERATION occurs." with: If there is a multisample buffer, 487 then values are obtained from the stencil samples in this buffer. 488 It is recommended that the stencil value of the centermost sample 489 be used, though implementations may choose any function of the 490 stencil sample values at each pixel. 491 492 [This extension makes no change to the way that color values are 493 obtained from the framebuffer.] 494 495Additions to Chapter 5 of the 1.2.1 Specification (Special Functions) 496 497 None 498 499Additions to Chapter 6 of the 1.2 Specification (State and State 500Requests) 501 502 An additional group of state variables, MULTISAMPLE_BIT_ARB, is 503 defined by this extension. When PushAttrib is called with bit 504 MULTISAMPLE_BIT_ARB set, the multisample group of state variables 505 is pushed onto the attribute stack. When PopAttrib is called, 506 these state variables are restored to their previous values if 507 they were pushed. Some multisample state is included in the 508 ENABLE_BIT group as well. In order to avoid incompatibility with 509 GL implementations that do not support SGIS_multisample, 510 ALL_ATTRIB_BITS does not include MULTISAMPLE_BIT_ARB. 511 512Additions to the GLX Specification 513 514 The parameter GLX_SAMPLE_BUFFERS_ARB is added to glXGetConfig. 515 When queried, by calling glXGetConfig with <attrib> set to 516 GLX_SAMPLE_BUFFERS_ARB, it returns the number of multisample 517 buffers included in the visual. For a normal visual, the return 518 value is zero. A return value of one indicates that a single 519 multisample buffer is available. The number of samples per pixel 520 is queried by calling glXGetConfig with <attrib> set to 521 GLX_SAMPLES_ARB. It is understood that the number of color, depth, 522 and stencil bits per sample in the multisample buffer are as 523 specified by the GLX_*_SIZE parameters. It is also understood that 524 there are no single-sample depth or stencil buffers associated with 525 this visual -- the only depth and stencil buffers are those in the 526 multisample buffer. GLX_SAMPLES_ARB is zero if 527 GLX_SAMPLE_BUFFERS_ARB is zero. 528 529 glXChooseVisual accepts GLX_SAMPLE_BUFFERS_ARB in <attribList>, 530 followed by the minimum number of multisample buffers that can be 531 accepted. Visuals with the smallest number of multisample buffers 532 that meets or exceeds the specified minimum number are preferred. 533 Currently operation with more than one multisample buffer is 534 undefined, so the returned value will be either zero or one. 535 536 glXChooseVisual accepts GLX_SAMPLES_ARB in <attribList>, followed 537 by the minimum number of samples that can be accepted in the 538 multisample buffer. Visuals with the smallest number of samples 539 that meets or exceeds the specified minimum number are preferred. 540 541 If the color samples in the multisample buffer store fewer bits 542 than are stored in the color buffers, this fact will not be 543 reported accurately. Presumably a compression scheme is being 544 employed, and is expected to maintain an aggregate resolution 545 equal to that of the color buffers. 546 547GLX Protocol 548 549 One new GL rendering commands is added. The following command is 550 sent to the server as part of a glXRender request: 551 552 SampleCoverageARB 553 2 12 rendering command length 554 2 229 rendering command opcode 555 4 FLOAT32 value 556 1 BOOL invert 557 3 unused 558 559Additions to the WGL Specification 560 561 The parameter WGL_SAMPLE_BUFFERS_ARB is added to 562 wglGetPixelFormatAttrib*v. When queried, by calling 563 wglGetPixelFormatAttrib*v with <piAttributes> set to 564 WGL_SAMPLE_BUFFERS_ARB, it returns the number of multisample 565 buffers included in the pixel format. For a normal pixel format, 566 the return value is zero. A return value of one indicates that a 567 single multisample buffer is available. The number of samples per 568 pixel is queried by calling wglGetPixelFormatAttrib*v with 569 <piAttributes> set to WGL_SAMPLES_ARB. It is understood that the 570 number of color, depth, and stencil bits per sample in the 571 multisample buffer are as specified by the WGL_*_SIZE parameters. 572 It is also understood that there are no single-sample depth or 573 stencil buffers associated with this visual -- the only depth and 574 stencil buffers are those in the multisample buffer. 575 WGL_SAMPLES_ARB is zero if WGL_SAMPLE_BUFFERS_ARB is zero. 576 577 wglChoosePixelFormatEXT accepts WGL_SAMPLE_BUFFERS_ARB in 578 <piAttribIList> and <pfAttribIList> with the corresponding value 579 set to the minimum number of multisample buffers that can be 580 accepted. Pixel formats with the smallest number of multisample 581 buffers that meets or exceeds the specified minimum number are 582 preferred. Currently operation with more than one multisample 583 buffer is undefined, so the returned value will be either zero or 584 one. 585 586 If the color samples in the multisample buffer store fewer bits 587 than are stored in the color buffers, this fact will not be 588 reported accurately. Presumably a compression scheme is being 589 employed, and is expected to maintain an aggregate resolution 590 equal to that of the color buffers. 591 592Errors 593 594 INVALID_OPERATION is generated if SampleCoverageARB is called 595 between the execution of Begin and the execution of the 596 corresponding End. 597 598New State 599 600 Get Value Get Command Type Initial Value Attribute 601 --------- ----------- ---- ------------- --------- 602 MULTISAMPLE_ARB IsEnabled B TRUE multisample/enable 603 SAMPLE_ALPHA_TO_COVERAGE_ARB IsEnabled B FALSE multisample/enable 604 SAMPLE_ALPHA_TO_ONE_ARB IsEnabled B FALSE multisample/enable 605 SAMPLE_COVERAGE_ARB IsEnabled B FALSE multisample/enable 606 SAMPLE_COVERAGE_VALUE_ARB GetFloatv R+ 1 multisample 607 SAMPLE_COVERAGE_INVERT_ARB GetBooleanv B FALSE multisample 608 609New Implementation Dependent State 610 611 Get Value Get Command Type Minimum Value 612 --------- ----------- ---- ------------- 613 SAMPLE_BUFFERS_ARB GetIntegerv Z+ 0 614 SAMPLES_ARB GetIntegerv Z+ 0 615 616Conformance Testing 617 618 TBD 619 620Revision History 621 622 09/20/1999 0.1 623 - First ARB draft based on the original SGI draft. 624 625 10/1/1999 0.2 626 - Added query for the number of passes. 627 628 11/8/1999 0.3 629 - Fixed numerous typos reported by E&S. 630 631 12/7/1999 0.4 632 - Removed the multiple pass feature. 633 - Resolved the working group issues at the ARB meeting. 634 - Added language that stated that SAMPLE_BUFFERS_ARB is the 635 same value as either GLX_SAMPLE_BUFFERS_ARB or 636 WGL_SAMPLE_BUFFERS_ARB. 637 638 12/15/1999 0.5 639 - Added back in the statement about ALL_ATTRIB_BITS not 640 including MULTISAMPLE_BIT_ARB. 641 642 03/12/2002 0.6 643 - Added GLX protocol for SampleCoverageARB. Updated contact 644 information. 645