15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci OES_blend_func_separate 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_OES_blend_func_separate 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Benj Lipchak, Apple (lipchak 'at' apple.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNotice 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Copyright (c) 2009-2013 The Khronos Group Inc. Copyright terms at 165bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciSpecification Update Policy 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 215bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL ES Working Group. For 225bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 235bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 245bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 255bd8deadSopenharmony_ci described in more detail at 265bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ciStatus 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci Ratified by the Khronos BOP, July 31, 2009. 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciVersion 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Date: 05/19/2009 Version 1.0 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ciNumber 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci OpenGL ES Extension #2 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ciDependencies 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci Written based on the wording of the OpenGL ES 1.1 specification. 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ciOverview 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci Blending capability is extended by defining a function that allows 475bd8deadSopenharmony_ci independent setting of the RGB and alpha blend factors for blend 485bd8deadSopenharmony_ci operations that require source and destination blend factors. It 495bd8deadSopenharmony_ci is not always desired that the blending used for RGB is also applied 505bd8deadSopenharmony_ci to alpha. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ciNew Procedures and Functions 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci void BlendFuncSeparateOES(enum sfactorRGB, 555bd8deadSopenharmony_ci enum dfactorRGB, 565bd8deadSopenharmony_ci enum sfactorAlpha, 575bd8deadSopenharmony_ci enum dfactorAlpha); 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ciNew Tokens 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, and 625bd8deadSopenharmony_ci GetFloatv: 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci BLEND_DST_RGB_OES 0x80C8 655bd8deadSopenharmony_ci BLEND_SRC_RGB_OES 0x80C9 665bd8deadSopenharmony_ci BLEND_DST_ALPHA_OES 0x80CA 675bd8deadSopenharmony_ci BLEND_SRC_ALPHA_OES 0x80CB 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 1.1 Specification (OpenGL Operation) 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci None 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 1.1 Specification (Rasterization) 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci None 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL ES 1.1 Specification (Per-Fragment Operations 785bd8deadSopenharmony_ciand the Framebuffer) 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci Replace the "Blend Equation" discussion in section 4.1.7 (Blending) with 815bd8deadSopenharmony_ci the following: 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci "The weighting factors used by the blend equation are determined by the 845bd8deadSopenharmony_ci blend functions. Blend functions are specified with the commands 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci void BlendFuncSeparateOES(enum srcRGB, enum dstRGB, enum srcAlpha, enum dstAlpha); 875bd8deadSopenharmony_ci void BlendFunc(enum src, enum dst); 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci BlendFuncSeparate arguments <srcRGB and dstRGB determine the source 905bd8deadSopenharmony_ci and destination RGB blend functions, respectively, while <srcAlpha> and 915bd8deadSopenharmony_ci <dstAlpha> determine the source and destination alpha blend functions. 925bd8deadSopenharmony_ci BlendFunc argument <src> determines both the RGB and alpha source 935bd8deadSopenharmony_ci functions, while <dst> determines both RGB and alpha destination functions. 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci The possible source and destination blend functions and their 965bd8deadSopenharmony_ci corresponding computed blend factors are summarized in table 4.blendfunc. 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci Function RGB Blend Factors Alpha Blend Factor 995bd8deadSopenharmony_ci (Sr, Sg, Sb) or (Dr, Dg, Db) Sa or Da 1005bd8deadSopenharmony_ci ------------------ ---------------------------- ------------------ 1015bd8deadSopenharmony_ci ZERO (0, 0, 0) 0 1025bd8deadSopenharmony_ci ONE (1, 1, 1) 1 1035bd8deadSopenharmony_ci SRC_COLOR (Rs, Gs, Bs) As 1045bd8deadSopenharmony_ci ONE_MINUS_SRC_COLOR (1, 1, 1) - (Rs, Gs, Bs) 1 - As 1055bd8deadSopenharmony_ci DST_COLOR (Rd, Gd, Bd) Ad 1065bd8deadSopenharmony_ci ONE_MINUS_DST_COLOR (1, 1, 1) - (Rd, Gd, Bd) 1 - Ad 1075bd8deadSopenharmony_ci SRC_ALPHA (As, As, As) As 1085bd8deadSopenharmony_ci ONE_MINUS_SRC_ALPHA (1, 1, 1) - (As, As, As) 1 - As 1095bd8deadSopenharmony_ci DST_ALPHA (Ad, Ad, Ad) Ad 1105bd8deadSopenharmony_ci ONE_MINUS_DST_ALPHA (1, 1, 1) - (Ad, Ad, Ad) 1 - Ad 1115bd8deadSopenharmony_ci SRC_ALPHA_SATURATE (*1) (f, f, f) (*2) 1 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci Table 4.blendfunc: RGB and ALPHA source and destination blending functions 1145bd8deadSopenharmony_ci and the corresponding blend factors. Addition and subtraction of triplets 1155bd8deadSopenharmony_ci is performed component-wise. 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci *1 SRC_ALPHA_SATURATE is valid only for source RGB and alpha blending 1185bd8deadSopenharmony_ci functions. 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci *2 f = min(As, 1 - Ad)." 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci In the "Blending State" paragraph, insert the following in place of 1235bd8deadSopenharmony_ci existing blend function state: 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci "The state required for blending is... four integers indicating the source 1265bd8deadSopenharmony_ci and destination blend functions for RGB and alpha.... The initial state 1275bd8deadSopenharmony_ci for both source functions is ONE. The initial state for both 1285bd8deadSopenharmony_ci destination functions is ZERO." 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL ES 1.1 Specification (Special Functions) 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci None 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL ES 1.1 Specification (State and State Requests) 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci None 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ciErrors 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci GL_INVALID_ENUM is generated if either sfactorRGB, dfactorRGB, 1415bd8deadSopenharmony_ci sfactorAlpha, or dfactorAlpha is not an accepted value. 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ciNew State 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci The get values BLEND_SRC and BLEND_DST return the RGB source and 1465bd8deadSopenharmony_ci destination factor, respectively. 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci Initial 1495bd8deadSopenharmony_ci Get Value Get Command Type Value 1505bd8deadSopenharmony_ci --------- ----------- ---- ------- 1515bd8deadSopenharmony_ci BLEND_SRC_RGB_OES GetIntegerv Z11 ONE 1525bd8deadSopenharmony_ci BLEND_DST_RGB_OES GetIntegerv Z10 ZERO 1535bd8deadSopenharmony_ci BLEND_SRC_ALPHA_OES GetIntegerv Z11 ONE 1545bd8deadSopenharmony_ci BLEND_DST_ALPHA_OES GetIntegerv Z10 ZERO 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ciNew Implementation Dependent State 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ci None 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ciRevision History 1615bd8deadSopenharmony_ci 1625bd8deadSopenharmony_ci 2009/05/19 Benj Lipchak First draft of true extension specification 1635bd8deadSopenharmony_ci 164