1Name 2 3 OES_blend_equation_separate 4 5Name Strings 6 7 GL_OES_blend_equation_separate 8 9Contact 10 11 Benj Lipchak, Apple (lipchak 'at' apple.com) 12 13Notice 14 15 Copyright (c) 2009-2013 The Khronos Group Inc. Copyright terms at 16 http://www.khronos.org/registry/speccopyright.html 17 18Specification Update Policy 19 20 Khronos-approved extension specifications are updated in response to 21 issues and bugs prioritized by the Khronos OpenGL ES Working Group. For 22 extensions which have been promoted to a core Specification, fixes will 23 first appear in the latest version of that core Specification, and will 24 eventually be backported to the extension document. This policy is 25 described in more detail at 26 https://www.khronos.org/registry/OpenGL/docs/update_policy.php 27 28Status 29 30 Ratified by the Khronos BOP, July 31, 2009. 31 32Version 33 34 Date: 06/17/2009 Version 1.1 35 36Number 37 38 OpenGL ES Extension #1 39 40Dependencies 41 42 Written based on the wording of the OpenGL ES 1.1 specification. 43 44 OES_blend_subtract is required for blend equation support. 45 46Overview 47 48 OpenGL ES 1.1 provides a single blend equation that applies to both RGB 49 and alpha portions of blending. This extension provides a separate blend 50 equation for RGB and alpha to match the generality available for blend 51 factors. 52 53New Procedures and Functions 54 55 void BlendEquationSeparateOES(enum modeRGB, enum modeAlpha); 56 57New Tokens 58 59 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, and 60 GetFloatv: 61 62 BLEND_EQUATION_RGB_OES 0x8009 (same as BLEND_EQUATION_OES) 63 BLEND_EQUATION_ALPHA_OES 0x883D 64 65Additions to Chapter 2 of the OpenGL ES 1.1 Specification (OpenGL Operation) 66 67 None 68 69Additions to Chapter 3 of the OpenGL ES 1.1 Specification (Rasterization) 70 71 None 72 73Additions to Chapter 4 of the OpenGL ES 1.1 Specification (Per-Fragment Operations 74and the Framebuffer) 75 76 Replace the first paragraph of the "Blend Equation" discussion in section 77 4.1.7 (Blending) with the following: 78 79 "Blending is controlled by the blend equations, defined by the commands 80 81 void BlendEquationOES(enum mode); 82 void BlendEquationSeparateOES(enum modeRGB, enum modeAlpha); 83 84 BlendEquationSeparateOES argument <modeRGB> determines the RGB blend 85 equation while <modeAlpha> determines the alpha blend equation. 86 BlendEquationOES argument <mode> determines both the RGB and alpha blend 87 equations. <modeRGB> and <modeAlpha> must each be one of FUNC_ADD_OES, 88 FUNC_SUBTRACT_OES, or FUNC_REVERSE_SUBTRACT_OES. 89 90 Replace the last paragraph of the "Blend Equation" discussion in section 91 4.1.7 (Blending) with the following: 92 93 Table 4.blendeq provides the corresponding per-component blend 94 equations for each mode, whether acting on RGB components for <modeRGB> 95 or the alpha component for <modeAlpha>. 96 97 In the table, the "s" subscript on a color component abbreviation 98 (R, G, B, or A) refers to the source color component for an incoming 99 fragment and the "d" subscript on a color component abbreviation refers 100 to the destination color component at the corresponding framebuffer 101 location. A color component abbreviation without a subscript refers to 102 the new color component resulting from blending. Additionally, Sr, Sg, 103 Sb, and Sa are the red, green, blue, and alpha components of the source 104 weighting factors determined by the source blend function, and Dr, Dg, Db, 105 and Da are the red, green, blue, and alpha components of the destination 106 weighting factors determined by the destination blend function. Blend 107 functions are described below. 108 109 Mode RGB components Alpha component 110 --------------------- ---------------------- ---------------------- 111 FUNC_ADD Rc = Rs * Sr + Rd * Dr Ac = As * Sa + Ad * Da 112 Gc = Gs * Sg + Gd * Dg 113 Bc = Bs * Sb + Bd * Db 114 --------------------- ---------------------- ---------------------- 115 FUNC_SUBTRACT Rc = Rs * Sr - Rd * Dr Ac = As * Sa - Ad * Da 116 Gc = Gs * Sg - Gd * Dg 117 Bc = Bs * Sb - Bd * Db 118 --------------------- ---------------------- ---------------------- 119 FUNC_REVERSE_SUBTRACT Rc = Rd * Sr - Rs * Dr Ac = Ad * Sa - As * Da 120 Gc = Gd * Sg - Gs * Dg 121 Bc = Bd * Sb - Bs * Db 122 --------------------- ---------------------- ---------------------- 123 124 Table 4.blendeq: RGB and alpha blend equations." 125 126 In the "Blending State" paragraph, insert the following in place of 127 existing blend equation state: 128 129 "The state required for blending is... two integers indicating the RGB 130 and alpha blend equations... The initial blending equations for RGB and 131 alpha are FUNC_ADD_OES." 132 133Additions to Chapter 5 of the OpenGL ES 1.1 Specification (Special Functions) 134 135 None 136 137Additions to Chapter 6 of the OpenGL ES 1.1 Specification (State and State Requests) 138 139 None 140 141Errors 142 143 INVALID_ENUM is generated if either the modeRGB or modeAlpha 144 parameter of BlendEquationSeparateOES is not one of FUNC_ADD_OES, 145 FUNC_SUBTRACT_OES, or FUNC_REVERSE_SUBTRACT_OES. 146 147New State 148 149 Initial 150 Get Value Get Command Type Value 151 ------------------------ ----------- ---- ------------ 152 BLEND_EQUATION_RGB_OES GetIntegerv Z FUNC_ADD_OES 153 BLEND_EQUATION_ALPHA_OES GetIntegerv Z FUNC_ADD_OES 154 155 [remove BLEND_EQUATION_OES from the table, add a note "BLEND_EQUATION_OES" 156 beside BLEND_EQUATION_RGB_OES to note the aliased name.] 157 158New Implementation Dependent State 159 160 None 161 162Revision History 163 164 2009/06/17 Benj Lipchak Remove MIN/MAX from Table 4.blendeq 165 2009/05/19 Benj Lipchak First draft of true extension specification 166 167