blob: 522ac202233269c0aeb8b78c5890f250ecbb55f7 [file] [log] [blame]
Geoff Lang496123f2014-02-12 11:33:51 -05001Name
2
3 EXT_blend_minmax
4
5Name Strings
6
7 GL_EXT_blend_minmax
8
9Version
10
11 Last Modified Date: September 17, 2009
12 Version: 1.5
13
14Number
15
16 OpenGL Extension #37
17 OpenGL ES Extension #65
18
19Dependencies
20
21 There is an interaction with OpenGL ES.
22
23Overview
24
25 Blending capability is extended by respecifying the entire blend
26 equation. While this document defines only two new equations, the
27 BlendEquationEXT procedure that it defines will be used by subsequent
28 extensions to define additional blending equations.
29
30 The two new equations defined by this extension produce the minimum
31 (or maximum) color components of the source and destination colors.
32 Taking the maximum is useful for applications such as maximum projection
33 in medical imaging.
34
35Issues
36
37 * I've prefixed the ADD token with FUNC, to indicate that the blend
38 equation includes the parameters specified by BlendFunc. (The min
39 and max equations don't.) Is this necessary? Is it too ugly?
40 Is there a better way to accomplish the same thing?
41
42New Procedures and Functions
43
44 void BlendEquationEXT(enum mode);
45
46New Tokens
47
48 Accepted by the <mode> parameter of BlendEquationEXT:
49
50 FUNC_ADD_EXT 0x8006
51 MIN_EXT 0x8007
52 MAX_EXT 0x8008
53
54 Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
55 GetFloatv, and GetDoublev:
56
57 BLEND_EQUATION_EXT 0x8009
58
59Additions to Chapter 2 of the GL Specification (OpenGL Operation)
60
61 None
62
63Additions to Chapter 3 of the GL Specification (Rasterization)
64
65 None
66
67Additions to Chapter 4 of the GL Specification (Per-Fragment Operations
68and the Framebuffer)
69
70 The GL Specification defines a single blending equation. This
71 extension introduces a blend equation mode that is specified by calling
72 BlendEquationEXT with one of three enumerated values. The default
73 value FUNC_ADD_EXT specifies that the blending equation defined in
74 the GL Specification be used. This equation is
75
76 C' = (Cs * S) + (Cd * D)
77
78 / 1.0 C' > 1.0
79 C = (
80 \ C' C' <= 1.0
81
82 where Cs and Cd are the source and destination colors, and S and D are
83 as specified by BlendFunc.
84
85 If BlendEquationEXT is called with <mode> set to MIN_EXT, the
86 blending equation becomes
87
88 C = min (Cs, Cd)
89
90 Finally, if BlendEquationEXT is called with <mode> set to MAX_EXT, the
91 blending equation becomes
92
93 C = max (Cs, Cd)
94
95 In all cases the blending equation is evaluated separately for each
96 color component.
97
98Additions to Chapter 5 of the GL Specification (Special Functions)
99
100 None
101
102Additions to Chapter 6 of the GL Specification (State and State Requests)
103
104 None
105
106Additions to the GLX Specification
107
108 None
109
110GLX Protocol
111
112 A new GL rendering command is added. The following command is sent to the
113 server as part of a glXRender request:
114
115 BlendEquationEXT
116 2 8 rendering command length
117 2 4097 rendering command opcode
118 4 ENUM mode
119
120Dependencies on OpenGL ES
121
122 If the GL is OpenGL ES, only the new MIN_EXT and MAX_EXT blend equations
123 are introduced by this extension. BlendEquationOES, FUNC_ADD_OES, and
124 BLEND_EQUATION_OES are introduced by the OES_blend_subtract extension,
125 which is required for this extension to operate. Alternatively,
126 OpenGL ES 2.0 is required, which introduces BlendEquation, FUNC_ADD, and
127 BLEND_EQUATION without the suffixes.
128
129 MIN_EXT and MAX_EXT should be added to Table 4.blendeq described in the
130 OES_blend_subtract extension specification, and Table 4.1 of the OpenGL
131 ES 2.0 specification.
132
133 Mentions of GetDoublev, Begin/End, and GLX in this extension specification
134 can be ignored for OpenGL ES. Also, BlendEquationEXT and FUNC_ADD_EXT
135 instead have the OES suffix courtesy of OES_blend_subtract, or no suffix
136 courtesy of core OpenGL ES 2.0.
137
138Errors
139
140 INVALID_ENUM is generated by BlendEquationEXT if its single parameter
141 is not FUNC_ADD_EXT, MIN_EXT, or MAX_EXT.
142
143 INVALID_OPERATION is generated if BlendEquationEXT is executed between
144 the execution of Begin and the corresponding execution to End.
145
146New State
147
148 Get Value Get Command Type Initial Value Attribute
149 --------- ----------- ---- ------------- ---------
150 BLEND_EQUATION_EXT GetIntegerv Z3 FUNC_ADD_EXT color-buffer
151
152New Implementation Dependent State
153
154 None
155
156Revision History
157
158 Version 1.5, September 17, 2009 (Jon Leech) -
159 Merge into OpenGL Registry version of the extension and assign
160 OpenGL ES extension number.
161 Version 1.4, May 19, 2009 (Benj Lipchak) -
162 Adapted for OpenGL ES.
163 Version 1.3, May 31, 1995 -
164 Last SGI revision.