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