15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci OES_sample_shading 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_OES_sample_shading 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Pat Brown, NVIDIA 165bd8deadSopenharmony_ci Eric Werness, NVIDIA 175bd8deadSopenharmony_ci Graeme Leese, Broadcom 185bd8deadSopenharmony_ci Contributors to ARB_sample_shading 195bd8deadSopenharmony_ci Members of the OpenGL ES working group 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciNotice 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at 245bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ciSpecification Update Policy 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 295bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL ES Working Group. For 305bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 315bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 325bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 335bd8deadSopenharmony_ci described in more detail at 345bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ciStatus 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci Complete. 395bd8deadSopenharmony_ci Ratified by the Khronos Board of Promoters on 2014/03/14. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciVersion 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci Last Modified Date: January 30, 2014 445bd8deadSopenharmony_ci Revision: 8 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ciNumber 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci OpenGL ES Extension #169 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ciDependencies 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci OpenGL ES 3.0 and GLSL ES 3.00 required. 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci This extension is written against the OpenGL ES 3.0.2 (April 8, 2013) 555bd8deadSopenharmony_ci and the OpenGL ES Shading Language Specification Revision 4 565bd8deadSopenharmony_ci (March 6, 2013) specifications. 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci This extension requires OES_sample_variables. 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ciOverview 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci In standard multisample rendering, an implementation is allowed to 635bd8deadSopenharmony_ci assign the same sets of fragment shader input values to each sample. 645bd8deadSopenharmony_ci This can cause aliasing where the fragment shader input values are 655bd8deadSopenharmony_ci used to generate a result that doesn't antialias itself, for example 665bd8deadSopenharmony_ci with alpha-tested transparency. 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci This extension adds the ability to explicitly request that an 695bd8deadSopenharmony_ci implementation use a minimum number of unique set of fragment 705bd8deadSopenharmony_ci computation inputs when multisampling a pixel. Specifying such a 715bd8deadSopenharmony_ci requirement can reduce aliasing that results from evaluating the 725bd8deadSopenharmony_ci fragment computations too few times per pixel. 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci This extension adds new global state that controls the minimum 755bd8deadSopenharmony_ci number of samples for which attribute data is independently 765bd8deadSopenharmony_ci interpolated. When enabled, all fragment-shading operations 775bd8deadSopenharmony_ci are executed independently on each sample. 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ciNew Procedures and Functions 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci void MinSampleShadingOES(float value); 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ciNew Tokens 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, 875bd8deadSopenharmony_ci and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, 885bd8deadSopenharmony_ci and GetInteger64v: 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci SAMPLE_SHADING_OES 0x8C36 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 935bd8deadSopenharmony_ci GetInteger64v, and GetFloatv: 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci MIN_SAMPLE_SHADING_VALUE_OES 0x8C37 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 3.0 Specification (OpenGL ES Operation) 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci None. 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 3.0 Specification (Rasterization) 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci Modify Section 3.3 Multisampling p. 95 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci (add a new subsection at the end of the section, p. 96) 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci 3.3.1 Sample Shading 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci Sample shading can be used to specify a minimum number of unique samples 1105bd8deadSopenharmony_ci to process for each fragment. Sample shading is controlled by calling 1115bd8deadSopenharmony_ci Enable or Disable with the symbolic constant SAMPLE_SHADING_OES. 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci If the value of SAMPLE_BUFFERS is zero or SAMPLE_SHADING_OES is 1145bd8deadSopenharmony_ci disabled, sample shading has no effect. Otherwise, an implementation must 1155bd8deadSopenharmony_ci provide a minimum of 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci max(ceil(<mss> * <samples>),1) 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci unique sets of fragment shader inputs for each 1205bd8deadSopenharmony_ci fragment, where <mss> is the value of MIN_SAMPLE_SHADING_VALUE_OES and 1215bd8deadSopenharmony_ci <samples> is the number of samples (the values of SAMPLES). These are 1225bd8deadSopenharmony_ci associated with the samples in an implementation-dependent manner. The 1235bd8deadSopenharmony_ci value of MIN_SAMPLE_SHADING_VALUE_OES is specified by calling 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci void MinSampleShadingOES(float value); 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci with <value> set to the desired minimum sample shading fraction. <value> 1285bd8deadSopenharmony_ci is clamped to [0,1] when specified. The sample shading fraction may be 1295bd8deadSopenharmony_ci queried by calling GetFloatv with pname set to 1305bd8deadSopenharmony_ci MIN_SAMPLE_SHADING_VALUE_OES. 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci When the sample shading fraction is 1.0, a separate set of fragment shader 1335bd8deadSopenharmony_ci input values are evaluated for each sample, and each set of values 1345bd8deadSopenharmony_ci is evaluated at the sample location. 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL ES 3.0.2 Specification (Per-Fragment 1385bd8deadSopenharmony_ciOperations and the Framebuffer) 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci None. 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL ES 3.0.2 Specification (Special Functions) 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci None. 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL ES 3.0.2 Specification (State and 1475bd8deadSopenharmony_ciState Requests) 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci None. 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ciModifications to The OpenGL ES Shading Language Specification, Version 3.00.04 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci None. 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL/EGL Specifications 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci None 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ciErrors 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci None. 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ciNew State 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci Add to Table 6.7 (Multisampling) 1665bd8deadSopenharmony_ci Get Initial 1675bd8deadSopenharmony_ci Get Value Type Command Value Description Sec. 1685bd8deadSopenharmony_ci --------- ---- --------- -------- ----------- ---- 1695bd8deadSopenharmony_ci SAMPLE_SHADING_OES B IsEnabled FALSE sample coverage 3.3.1 1705bd8deadSopenharmony_ci enable 1715bd8deadSopenharmony_ci MIN_SAMPLE_SHADING_VALUE_OES R+ GetFloatv 0 fraction of multi- 3.3.1 1725bd8deadSopenharmony_ci samples to use for 1735bd8deadSopenharmony_ci sample shading 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ciNew Implementation Dependent State 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ci None. 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ciIssues 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci (0) This extension is based on ARB_sample_shading. What are the major 1825bd8deadSopenharmony_ci differences? 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci 1- rebased against ES 3.0 1855bd8deadSopenharmony_ci 2- various editing for consistency to GL 4.4/GLSL 440 specs 1865bd8deadSopenharmony_ci 3- parameter to MinSampleShading changed to float to match GL 4.x 1875bd8deadSopenharmony_ci 4- removed mention of SAMPLE_ALPHA_TO_ONE 1885bd8deadSopenharmony_ci 5- replaced mention of "color and texture coordinates" with more 1895bd8deadSopenharmony_ci generic language about fragment shader inputs. 1905bd8deadSopenharmony_ci 6- removed mention of multisample enable. 1915bd8deadSopenharmony_ci 7- moved shading language sample variables to OES_sample_variables 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci For historical issues, please see ARB_sample_shading. 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci (1) OpenGL has a MULTISAMPLE enable that was not included in OpenGL ES. 1965bd8deadSopenharmony_ci Should we add it into this extension or base it purely on if the target 1975bd8deadSopenharmony_ci surface is multisample? 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci DISCUSSION: 2005bd8deadSopenharmony_ci GL (4.4) says: 2015bd8deadSopenharmony_ci "Multisample rasterization is enabled or disabled by calling Enable or 2025bd8deadSopenharmony_ci Disable with the symbolic constant MULTISAMPLE." 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci GL ES (3.0.2) says: 2055bd8deadSopenharmony_ci "Multisample rasterization cannot be enabled or disabled after a GL 2065bd8deadSopenharmony_ci context is created." 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ci RESOLVED. Multisample rasterization should be based on the target 2095bd8deadSopenharmony_ci surface properties. Will not pick up the explicit multisample 2105bd8deadSopenharmony_ci enable, but the language for ES3.0.2 doesn't sound right either. 2115bd8deadSopenharmony_ci Bug 10690 tracks this and it should be fixed in later versions 2125bd8deadSopenharmony_ci of the ES3.0 specification. 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ciRevision History 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci Rev. Date Author Changes 2185bd8deadSopenharmony_ci ---- ---------- -------- ----------------------------------------- 2195bd8deadSopenharmony_ci 8 2014-01-20 dkoch rename to OES, clean editing notess 2205bd8deadSopenharmony_ci 7 2014-01-20 dkoch Fix a typo, and dangling ARB suffix 2215bd8deadSopenharmony_ci 6 2013-10-03 dkoch Minor edits 2225bd8deadSopenharmony_ci 5 2013-09-09 dkoch Require OES_sample_variables. 2235bd8deadSopenharmony_ci Move gl_SampleMaskIn interaction base extension. 2245bd8deadSopenharmony_ci 4 2013-09-03 gleese Moved sample variables to OES_sample_variables 2255bd8deadSopenharmony_ci 3 2013-08-26 dkoch resolved issues 1&2 and supporting edits. 2265bd8deadSopenharmony_ci replaced discussion of fixed-function inputs 2275bd8deadSopenharmony_ci with generic language. 2285bd8deadSopenharmony_ci 2 2013-08-13 dkoch add missing suffices, follow extension template 2295bd8deadSopenharmony_ci 1 2013-08-12 dkoch Port ARB_sample_shading to ES 3.0 2305bd8deadSopenharmony_ci 231