OLD | NEW |
(Empty) | |
| 1 Name |
| 2 |
| 3 CHROMIUM_framebuffer_mixed_samples |
| 4 |
| 5 Name Strings |
| 6 |
| 7 GL_CHROMIUM_framebuffer_mixed_samples |
| 8 |
| 9 Version |
| 10 |
| 11 Last Modifed Date: 7. December, 2015 |
| 12 |
| 13 Dependencies |
| 14 |
| 15 OpenGL ES 2.0 is required. |
| 16 |
| 17 This extension interacts with CHROMIUM_framebuffer_multisample. |
| 18 |
| 19 Overview |
| 20 |
| 21 This extension allows multisample rendering with a raster and |
| 22 depth/stencil sample count that is larger than the color sample count. |
| 23 Rasterization and the results of the depth and stencil tests together |
| 24 determine the portion of a pixel that is "covered". It can be useful to |
| 25 evaluate coverage at a higher frequency than color samples are stored. |
| 26 This coverage is then "reduced" to a collection of covered color samples, |
| 27 each having an opacity value corresponding to the fraction of the color |
| 28 sample covered. The opacity can optionally be blended into individual |
| 29 color samples. |
| 30 |
| 31 The key features of this extension are: |
| 32 |
| 33 - It allows a framebuffer object to be considered complete when its depth |
| 34 or stencil samples are a multiple of the number of color samples. |
| 35 |
| 36 - It redefines SAMPLES to be the number of depth/stencil samples (if any); |
| 37 otherwise, it uses the number of color samples. SAMPLE_BUFFERS is one if |
| 38 there are multisample depth/stencil attachments. Multisample |
| 39 rasterization and multisample fragment ops are allowed if SAMPLE_BUFFERS |
| 40 is one. |
| 41 |
| 42 - It replaces several error checks involving SAMPLE_BUFFERS by error |
| 43 checks directly referencing the number of samples in the relevant |
| 44 attachments. |
| 45 |
| 46 - A coverage reduction step is added to Per-Fragment Operations which |
| 47 converts a set of covered raster/depth/stencil samples to a set of |
| 48 covered color samples. The coverage reduction step also includes an |
| 49 optional coverage modulation step, multiplying color values by a |
| 50 fractional opacity corresponding to the number of associated |
| 51 raster/depth/stencil samples covered. |
| 52 |
| 53 New Procedures and Functions |
| 54 |
| 55 void CoverageModulationCHROMIUM(enum components); |
| 56 |
| 57 New Tokens |
| 58 |
| 59 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv and |
| 60 GetFloatv: |
| 61 |
| 62 COVERAGE_MODULATION_CHROMIUM 0x9332 |
| 63 |
| 64 |
| 65 Additions to specification text related to framebuffers and framebuffer objects |
| 66 (Framebuffers and Framebuffer Objects) |
| 67 |
| 68 Pending CHROMIUM_framebuffer_multisample specification. |
| 69 Apply relevant rules in spirit of the overview to the specification text. |
| 70 |
| 71 |
| 72 |
| 73 Additions to Chapter 3 of OpenGL ES 2.0 Specification (Rasterization) |
| 74 |
| 75 |
| 76 Modify Section 3.2 (Multisampling) |
| 77 |
| 78 Pending CHROMIUM_framebuffer_multisample specification. |
| 79 Apply relevant rules in spirit of the overview to the specification text. |
| 80 |
| 81 Additions to Chapter 4 of OpenGL ES 2.0 Specification |
| 82 (Per-Fragment Operations and the Framebuffer) |
| 83 |
| 84 Modify Figure 4.1 (Per-fragment operations) |
| 85 |
| 86 Add a new stage called "Coverage Reduction" between "Dept Buffer Test" and |
| 87 "Blending". |
| 88 |
| 89 Add a new Section 4.1.Y (Coverage Reduction) after 4.1.5. |
| 90 |
| 91 If the value of effective raster samples is greater than the value of |
| 92 color samples, a fragment's coverage is reduced from |
| 93 effective raster samples bits to color samples bits. There is an |
| 94 implementation-dependent association of raster samples to color samples. |
| 95 The reduced "color coverage" is computed such that the coverage bit for |
| 96 each color sample is 1 if any of the associated bits in the fragment's |
| 97 coverage is on, and 0 otherwise. Blending and writes to the framebuffer |
| 98 are not performed on samples whose color coverage bit is zero. |
| 99 |
| 100 For each color sample, the associated bits of the fragment's coverage are |
| 101 counted and divided by the number of associated bits to produce a |
| 102 modulation factor R in the range (0,1] (a value of zero would have been |
| 103 killed due to a color coverage of 0). Specifically: |
| 104 |
| 105 N = value of effective raster samples; |
| 106 M = value of color samples; |
| 107 R = popcount(associated coverage bits) / (N / M); |
| 108 |
| 109 For each draw buffer with a floating point or normalized color format, the |
| 110 fragment's color value is replicated to M values which may each be |
| 111 modulated (multiplied) by that color sample's associated value of R. This |
| 112 modulation is controlled by the function: |
| 113 |
| 114 CoverageModulationCHROMIUM(enum components); |
| 115 |
| 116 <components> may be RGB, RGBA, ALPHA, or NONE. If <components> is RGB or |
| 117 RGBA, the red, green, and blue components are modulated. If components is |
| 118 RGBA or ALPHA, the alpha component is modulated. The initial value of |
| 119 COVERAGE_MODULATION_CHROMIUM is NONE. |
| 120 |
| 121 New State |
| 122 |
| 123 Get Value Get Command Type Initial Value Desc
ription Sec. Attribute |
| 124 --------- ----------- ---- ------------- ----
------- ---- --------- |
| 125 |
| 126 COVERAGE_MODULATION_CHROMIUM GetIntegerv E NONE Whic
h components are 4.1.Y - |
| 127 mult
iplied by coverage |
| 128 frac
tion |
| 129 Issues |
| 130 |
| 131 (1) How is coverage modulation intended to be used? |
| 132 |
| 133 RESOLVED: Coverage modulation allows the coverage to be converted to |
| 134 "opacity", which can then be blended into the color buffer to accomplish |
| 135 antialiasing. This is similar to the intent of POLYGON_SMOOTH. For example, |
| 136 if non-premultiplied alpha colors are in use (common OpenGL usage): |
| 137 |
| 138 glCoverageModulationCHROMIUM(GL_ALPHA); |
| 139 glEnable(GL_BLEND); |
| 140 glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, |
| 141 GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
| 142 |
| 143 or if using pre-multiplied alpha colors (common in 2D rendering): |
| 144 |
| 145 glCoverageModulationCHROMIUM(GL_RGBA); |
| 146 glEnable(GL_BLEND); |
| 147 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
OLD | NEW |