• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    OES_blend_func_separate
4
5Name Strings
6
7    GL_OES_blend_func_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: 05/19/2009  Version 1.0
35
36Number
37
38    OpenGL ES Extension #2
39
40Dependencies
41
42    Written based on the wording of the OpenGL ES 1.1 specification.
43
44Overview
45
46    Blending capability is extended by defining a function that allows
47    independent setting of the RGB and alpha blend factors for blend
48    operations that require source and destination blend factors.  It
49    is not always desired that the blending used for RGB is also applied
50    to alpha.
51
52New Procedures and Functions
53
54    void BlendFuncSeparateOES(enum sfactorRGB,
55                              enum dfactorRGB,
56                              enum sfactorAlpha,
57                              enum dfactorAlpha);
58
59New Tokens
60
61    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, and
62    GetFloatv:
63
64        BLEND_DST_RGB_OES                  0x80C8
65        BLEND_SRC_RGB_OES                  0x80C9
66        BLEND_DST_ALPHA_OES                0x80CA
67        BLEND_SRC_ALPHA_OES                0x80CB
68
69Additions to Chapter 2 of the OpenGL ES 1.1 Specification (OpenGL Operation)
70
71    None
72
73Additions to Chapter 3 of the OpenGL ES 1.1 Specification (Rasterization)
74
75    None
76
77Additions to Chapter 4 of the OpenGL ES 1.1 Specification (Per-Fragment Operations
78and the Framebuffer)
79
80    Replace the "Blend Equation" discussion in section 4.1.7 (Blending) with
81    the following:
82
83    "The weighting factors used by the blend equation are determined by the
84    blend functions.  Blend functions are specified with the commands
85
86        void BlendFuncSeparateOES(enum srcRGB, enum dstRGB, enum srcAlpha, enum dstAlpha);
87        void BlendFunc(enum src, enum dst);
88
89        BlendFuncSeparate arguments <srcRGB and dstRGB determine the source
90    and destination RGB blend functions, respectively, while <srcAlpha> and
91    <dstAlpha> determine the source and destination alpha blend functions.
92    BlendFunc argument <src> determines both the RGB and alpha source
93    functions, while <dst> determines both RGB and alpha destination functions.
94
95        The possible source and destination blend functions and their
96    corresponding computed blend factors are summarized in table 4.blendfunc.
97
98     Function                  RGB Blend Factors             Alpha Blend Factor
99                               (Sr, Sg, Sb) or (Dr, Dg, Db)  Sa or Da
100     ------------------        ----------------------------  ------------------
101     ZERO                      (0, 0, 0)                     0
102     ONE                       (1, 1, 1)                     1
103     SRC_COLOR                 (Rs, Gs, Bs)                  As
104     ONE_MINUS_SRC_COLOR       (1, 1, 1) - (Rs, Gs, Bs)      1 - As
105     DST_COLOR                 (Rd, Gd, Bd)                  Ad
106     ONE_MINUS_DST_COLOR       (1, 1, 1) - (Rd, Gd, Bd)      1 - Ad
107     SRC_ALPHA                 (As, As, As)                  As
108     ONE_MINUS_SRC_ALPHA       (1, 1, 1) - (As, As, As)      1 - As
109     DST_ALPHA                 (Ad, Ad, Ad)                  Ad
110     ONE_MINUS_DST_ALPHA       (1, 1, 1) - (Ad, Ad, Ad)      1 - Ad
111     SRC_ALPHA_SATURATE (*1)   (f, f, f) (*2)                1
112
113     Table 4.blendfunc: RGB and ALPHA source and destination blending functions
114     and the corresponding blend factors.  Addition and subtraction of triplets
115     is performed component-wise.
116
117     *1 SRC_ALPHA_SATURATE is valid only for source RGB and alpha blending
118     functions.
119
120     *2 f = min(As, 1 - Ad)."
121
122    In the "Blending State" paragraph, insert the following in place of
123    existing blend function state:
124
125    "The state required for blending is... four integers indicating the source
126    and destination blend functions for RGB and alpha....  The initial state
127    for both source functions is ONE.  The initial state for both
128    destination functions is ZERO."
129
130Additions to Chapter 5 of the OpenGL ES 1.1 Specification (Special Functions)
131
132    None
133
134Additions to Chapter 6 of the OpenGL ES 1.1 Specification (State and State Requests)
135
136    None
137
138Errors
139
140    GL_INVALID_ENUM is generated if either sfactorRGB, dfactorRGB,
141    sfactorAlpha, or dfactorAlpha is not an accepted value.
142
143New State
144
145    The get values BLEND_SRC and BLEND_DST return the RGB source and
146    destination factor, respectively.
147
148                                              Initial
149    Get Value             Get Command   Type  Value
150    ---------             -----------   ----  -------
151    BLEND_SRC_RGB_OES     GetIntegerv   Z11   ONE
152    BLEND_DST_RGB_OES     GetIntegerv   Z10   ZERO
153    BLEND_SRC_ALPHA_OES   GetIntegerv   Z11   ONE
154    BLEND_DST_ALPHA_OES   GetIntegerv   Z10   ZERO
155
156New Implementation Dependent State
157
158    None
159
160Revision History
161
162    2009/05/19    Benj Lipchak    First draft of true extension specification
163
164