1Name 2 3 OES_sample_shading 4 5Name Strings 6 7 GL_OES_sample_shading 8 9Contact 10 11 Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com) 12 13Contributors 14 15 Pat Brown, NVIDIA 16 Eric Werness, NVIDIA 17 Graeme Leese, Broadcom 18 Contributors to ARB_sample_shading 19 Members of the OpenGL ES working group 20 21Notice 22 23 Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at 24 http://www.khronos.org/registry/speccopyright.html 25 26Status 27 28 Complete. 29 Ratified by the Khronos Board of Promoters on 2014/03/14. 30 31Version 32 33 Last Modified Date: January 30, 2014 34 Revision: 8 35 36Number 37 38 OpenGL ES Extension #169 39 40Dependencies 41 42 OpenGL ES 3.0 and GLSL ES 3.00 required. 43 44 This extension is written against the OpenGL ES 3.0.2 (April 8, 2013) 45 and the OpenGL ES Shading Language Specification Revision 4 46 (March 6, 2013) specifications. 47 48 This extension requires OES_sample_variables. 49 50Overview 51 52 In standard multisample rendering, an implementation is allowed to 53 assign the same sets of fragment shader input values to each sample. 54 This can cause aliasing where the fragment shader input values are 55 used to generate a result that doesn't antialias itself, for example 56 with alpha-tested transparency. 57 58 This extension adds the ability to explicitly request that an 59 implementation use a minimum number of unique set of fragment 60 computation inputs when multisampling a pixel. Specifying such a 61 requirement can reduce aliasing that results from evaluating the 62 fragment computations too few times per pixel. 63 64 This extension adds new global state that controls the minimum 65 number of samples for which attribute data is independently 66 interpolated. When enabled, all fragment-shading operations 67 are executed independently on each sample. 68 69 70New Procedures and Functions 71 72 void MinSampleShadingOES(float value); 73 74New Tokens 75 76 Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, 77 and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, 78 and GetInteger64v: 79 80 SAMPLE_SHADING_OES 0x8C36 81 82 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 83 GetInteger64v, and GetFloatv: 84 85 MIN_SAMPLE_SHADING_VALUE_OES 0x8C37 86 87Additions to Chapter 2 of the OpenGL ES 3.0 Specification (OpenGL ES Operation) 88 89 None. 90 91Additions to Chapter 3 of the OpenGL ES 3.0 Specification (Rasterization) 92 93 Modify Section 3.3 Multisampling p. 95 94 95 (add a new subsection at the end of the section, p. 96) 96 97 3.3.1 Sample Shading 98 99 Sample shading can be used to specify a minimum number of unique samples 100 to process for each fragment. Sample shading is controlled by calling 101 Enable or Disable with the symbolic constant SAMPLE_SHADING_OES. 102 103 If the value of SAMPLE_BUFFERS is zero or SAMPLE_SHADING_OES is 104 disabled, sample shading has no effect. Otherwise, an implementation must 105 provide a minimum of 106 107 max(ceil(<mss> * <samples>),1) 108 109 unique sets of fragment shader inputs for each 110 fragment, where <mss> is the value of MIN_SAMPLE_SHADING_VALUE_OES and 111 <samples> is the number of samples (the values of SAMPLES). These are 112 associated with the samples in an implementation-dependent manner. The 113 value of MIN_SAMPLE_SHADING_VALUE_OES is specified by calling 114 115 void MinSampleShadingOES(float value); 116 117 with <value> set to the desired minimum sample shading fraction. <value> 118 is clamped to [0,1] when specified. The sample shading fraction may be 119 queried by calling GetFloatv with pname set to 120 MIN_SAMPLE_SHADING_VALUE_OES. 121 122 When the sample shading fraction is 1.0, a separate set of fragment shader 123 input values are evaluated for each sample, and each set of values 124 is evaluated at the sample location. 125 126 127Additions to Chapter 4 of the OpenGL ES 3.0.2 Specification (Per-Fragment 128Operations and the Framebuffer) 129 130 None. 131 132Additions to Chapter 5 of the OpenGL ES 3.0.2 Specification (Special Functions) 133 134 None. 135 136Additions to Chapter 6 of the OpenGL ES 3.0.2 Specification (State and 137State Requests) 138 139 None. 140 141Modifications to The OpenGL ES Shading Language Specification, Version 3.00.04 142 143 None. 144 145Additions to the AGL/GLX/WGL/EGL Specifications 146 147 None 148 149Errors 150 151 None. 152 153New State 154 155 Add to Table 6.7 (Multisampling) 156 Get Initial 157 Get Value Type Command Value Description Sec. 158 --------- ---- --------- -------- ----------- ---- 159 SAMPLE_SHADING_OES B IsEnabled FALSE sample coverage 3.3.1 160 enable 161 MIN_SAMPLE_SHADING_VALUE_OES R+ GetFloatv 0 fraction of multi- 3.3.1 162 samples to use for 163 sample shading 164 165New Implementation Dependent State 166 167 None. 168 169Issues 170 171 (0) This extension is based on ARB_sample_shading. What are the major 172 differences? 173 174 1- rebased against ES 3.0 175 2- various editing for consistency to GL 4.4/GLSL 440 specs 176 3- parameter to MinSampleShading changed to float to match GL 4.x 177 4- removed mention of SAMPLE_ALPHA_TO_ONE 178 5- replaced mention of "color and texture coordinates" with more 179 generic language about fragment shader inputs. 180 6- removed mention of multisample enable. 181 7- moved shading language sample variables to OES_sample_variables 182 183 For historical issues, please see ARB_sample_shading. 184 185 (1) OpenGL has a MULTISAMPLE enable that was not included in OpenGL ES. 186 Should we add it into this extension or base it purely on if the target 187 surface is multisample? 188 189 DISCUSSION: 190 GL (4.4) says: 191 "Multisample rasterization is enabled or disabled by calling Enable or 192 Disable with the symbolic constant MULTISAMPLE." 193 194 GL ES (3.0.2) says: 195 "Multisample rasterization cannot be enabled or disabled after a GL 196 context is created." 197 198 RESOLVED. Multisample rasterization should be based on the target 199 surface properties. Will not pick up the explicit multisample 200 enable, but the language for ES3.0.2 doesn't sound right either. 201 Bug 10690 tracks this and it should be fixed in later versions 202 of the ES3.0 specification. 203 204 205Revision History 206 207 Rev. Date Author Changes 208 ---- ---------- -------- ----------------------------------------- 209 8 2014-01-20 dkoch rename to OES, clean editing notess 210 7 2014-01-20 dkoch Fix a typo, and dangling ARB suffix 211 6 2013-10-03 dkoch Minor edits 212 5 2013-09-09 dkoch Require OES_sample_variables. 213 Move gl_SampleMaskIn interaction base extension. 214 4 2013-09-03 gleese Moved sample variables to OES_sample_variables 215 3 2013-08-26 dkoch resolved issues 1&2 and supporting edits. 216 replaced discussion of fixed-function inputs 217 with generic language. 218 2 2013-08-13 dkoch add missing suffices, follow extension template 219 1 2013-08-12 dkoch Port ARB_sample_shading to ES 3.0 220 221